【问题标题】:Webservices in Websphere portal serverWebsphere 门户服务器中的 Web 服务
【发布时间】:2011-11-19 12:29:07
【问题描述】:

我正在尝试从 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>

问候 斯内汉所罗门

【问题讨论】:

  • 您能举例说明这些额外的标题吗?您还应该提及您正在使用哪个 Web 服务 API(JAX-RPC、JAX-WS、第三方?)。
  • 安德烈亚斯,我已根据您要求的详细信息更新了问题。

标签: web-services soap websphere websphere-portal soapheader


【解决方案1】:

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

【讨论】:

  • 您好 Andreas,感谢您帮我解决这个问题,我相信 WPS 中默认启用此功能,您是否知道是否可以为个别 WS 客户端禁用此功能?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-12-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-04-10
  • 1970-01-01
  • 2013-06-17
相关资源
最近更新 更多