0

我正在尝试从 Websphere Portal 服务器调用 Web 服务,但是我注意到 SOAP 消息有一个非常奇怪的行为。

在我发送的请求消息中,没有标头,而在生产者收到的请求中,添加了额外的标头,例如日期时区语言环境等。这最初导致了一些问题,但后来生产者设法绕过了标题,所以现在一切都很好。但我只是想知道为什么它们被添加到门户中并且可以被禁用。

我正在使用 JAX RPC,

这是我在发送请求之前在最后打印时收到的消息

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header/>
    <soapenv:Body>

这是在生产者端收到的消息。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
    <InternationalizationContext soapenv:mustUnderstand="0" xmlns="http://www.ibm.com/webservices/InternationalizationContext">
        <Locales xmlns="">
            <Locale>
                <LanguageCode>en</LanguageCode>
                <CountryCode>US</CountryCode>
            </Locale>
            <Locale>
                <LanguageCode>en</LanguageCode>
            </Locale>
        </Locales>
        <TimeZoneId xmlns="">GMT</TimeZoneId>
    </InternationalizationContext>
</soapenv:Header>
<soapenv:Body>

问候斯内汉所罗门

4

1 回答 1

0

此标头由WebSphere 中的国际化服务生成。可以完全禁用该服务,但门户服务器可能需要它。很可能还有一种方法可以禁用给定 JAX-RPC 请求的国际化上下文的传播,但我没有找到任何文档。

于 2011-11-19T17:33:14.033 回答