NonStop SOAP User's Manual
NonStop SOAP Features and Functions
NonStop SOAP User’s Manual—520501-012
4-29
Specifying the Default Output Encoding for a Service
Specifying the Default Output Encoding for a Service
To specify the default output encoding for a service, you use the RspEncoding attribute
in the SDL definition of the service, as described in SDL DTD for TS/MP and NonStop
Processes on page 3-1.
Matching the Output Encoding to the Request Message
If the request message does not include the Encoding element in the header and the
SDL file does not prescribe the encoding type for the service, the SOAP server uses
the encoding of the request. The encoding of the request message is “UTF-8” unless
the xml prolog element specifies another encoding.
For example, this message identifies the encoding as “Shift_JIS.”
For another example, see Controlling the Output Encoding on page 6-42.
Example 4-16. Fault for Unsupported Encoding
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode> SOAP-ENV:Client.Process</faultcode>
<faultstring>Error parsing the header of the XML
document</faultstring>
<detail>
<detailCode>-1007</detailCode>
<detailString>Bad OutputEncoding value <encoding name> was
specified
</detailString>
</detail>
<SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Example 4-17. A Message Specifying Its Own Encoding in the XML Prolog
<?xml version="1.0" encoding="Shift_JIS" ?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body xmlns:admin="urn:compaq_nsk_oss_soapquery">
<admin:ListServices serviceType="all">
</admin:ListServices>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>