aspose file tools*
The moose likes Web Services and the fly likes Special Character Encoding Problem with WebService Base64Binary Data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Special Character Encoding Problem with WebService Base64Binary Data" Watch "Special Character Encoding Problem with WebService Base64Binary Data" New topic
Author

Special Character Encoding Problem with WebService Base64Binary Data

Tulsi Ram Lokku
Greenhorn

Joined: May 04, 2010
Posts: 1
Hi,

I have deployed a webservices in OAS9i application server. I am encoding data that has special characters (non ascii/unicode) using Base64Encoder in the xml and sending the webservices request. The type of the xml payload element is mentioned as Base64Binary in the schema.
In java implementation code, the payload data is retrieved as a new String(payloadData) which return the value of the decoded string. The string returned loses the special character which is not a key board character and displays a junk letter like � �. This seems to be an encoding issue. Can anyone please help us resolving the issue.

Regards,
Tulsi Ram
R Srini
Ranch Hand

Joined: Feb 19, 2010
Posts: 215
Hi Tulsi Ram. In the past, I have used xs:base64Binary (in xmlbeans) by mapping it to byte arrays, i.e. byte[]. Can you try byte[] instead of String?

For example, for this element
xjc generates this code:
Hope that addresses your question.

Thanks.
- Srini
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Special Character Encoding Problem with WebService Base64Binary Data