【发布时间】: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