aspose file tools*
The moose likes Web Services and the fly likes SOAP XML encoding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "SOAP XML encoding" Watch "SOAP XML encoding" New topic
Author

SOAP XML encoding

Padmanabh Sahasrabudhe
Ranch Hand

Joined: Mar 04, 2008
Posts: 50
Does anybody know how to set the encoding of the SOAP result xml.

I have the following scenario:

I am getting an XML as a result String from a webservice which needs to have UTF-8 encoding. But the SOAP Response shows junk characters in the body(the XML String). How to resolve this issue?

I am using XFire 1.2 with Myeclipse and running it on websphere.
Faraz Masood
Ranch Hand

Joined: May 03, 2002
Posts: 55
you may want to try InputStreamReader/ByteInputStream to read the incoming xml, and there you have the possibility to specify the encoding

I guess the default encoding in websphere is not UTF-8 and that is why you see all those junk characters.

try reading the message as bytes and then convert it to required encoding also when using System.out.println(), do not forget to specify the encoding
Padmanabh Sahasrabudhe
Ranch Hand

Joined: Mar 04, 2008
Posts: 50
Thanks Faraz. The issue got resolved. It was insertion of beginning of file characters in the XML which was first getting saved. I am removing those characters and now it is working. Thanks for the input.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SOAP XML encoding
 
Similar Threads
xsd compilation problem
Sending requests in xml
xmlns ="" is added after changing the value of an element
encoding style: literal vs encoded
problem while calling document style web service