Specifying the Session Language

The following example specifies the session language in the SOAP header.

<soap:Header>
    <common:UserLocaleHeader xmlns:common="http://mercury.com/
ppm/common/1.0">
        <common:LanguageLocale>de</common:LanguageLocale>
    </common:UserLocaleHeader>
    <wsseecurity xmlns:wsse="http://docs.oasis-open.org/wss/
2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
soap:mustUnderstand="1">
        <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/
wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="Timestamp-6557466">
             <wsu:Created>2009-08-21T18:29:15.687Z</wsu:Created>
             <wsu:Expires>2009-08-21T18:34:15.687Z</wsu:Expires>
         </wsu:Timestamp>
         <wsse:UsernameToken xmlns:wsu="http://docs.oasisopen.
org/wss/2004/01/oasis-200401-wss-wssecurity-utility-
1.0.xsd" wsu:Id="UsernameToken-7433399">
            <wsse:Username>admin</wsse:Username>
            <wsseassword Type="http://docs.oasis-open.org/wss/
2004/01/oasis-200401-wss-username-token-profile-
1.0#PasswordText">admin</wsseassword>
        </wsse:UsernameToken>
     </wsseecurity>
</soap:Header>

When invoking a Web service operation, a caller can specify the preferred language in the UserLocaleHeader SOAP header element. To make it easier for the caller to set this SOAP header element, the Web service toolkit has enhanced the SOAPHeaderCreater class by adding the setUserLocaleHeader method.