I am trying to send a SOAP Message from Java based on the encoding of the types in WSDL.
How do I find it in WSDL? Is the WSDL file's XML encoding type same as the encoding needed for its SOAP operations (I think there can be a case where the WSDL itself is in UTF-8 but one of its operation needs to be encoded as gb2312 while sending as a SOAP request).
Encoding of request and response messages are specified in the <binding> element of a WSDL. In that element you will be able to see <body> elements belonging to the namespace http://schemas.xmlsoap.org/wsdl/soap/ (for WSDL 1.1). The value of the use attribute specifies the encoding.
Note that the WS-I Basic Profile only allows for literal encoding!
If you want to enclose character data encoded using some other character encoding scheme in a web service request or response, then you may want to encode that data using, for instance, Base64 before sending it in a SOAP message and then decoding it, of course, once it arrives at its destination.
The character encoding of SOAP messages has to, as far as I understand, be UTF-8 or UTF-16 according to the WS-I Basic Profile 1.1:
http://www.ws-i.org/Profiles/BasicProfile-1.1.html#Acceptable_WSDL_Character_Encodings As I said in my earlier message, you can encode data enclosed in a SOAP request or response using, for instance, Base64, if you have character data encoded in some other fashion. Note that both clients and server have to be aware of such encoding.