【发布时间】:2011-08-15 20:07:06
【问题描述】:
我正在处理一个问题,我必须使用从 WSDL 开发的遗留 Web 服务客户端,该客户端将实际 XML 请求作为请求中唯一一个变量的值传递。我现在使用的 Web 服务具有不同的 WSDL,我试图欺骗我的 XML 解析器,但它正在编码我的实际 XML 响应。
有没有配置解析器所以请求:
<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>
<request><elemA><elemB>abc</elemB></elemA></request>
</soapenv:Body>
</soapenv:Envelope>
改成这样:
<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>
<foo>
<elemA>
<elemB>abc</elemB>
</elemA>
</foo>
</soapenv:Body>
</soapenv:Envelope>
我正在使用 JAX-WS 和 WebSphere 7。
提前致谢。
巴勃罗
【问题讨论】:
-
原创设计值得发到thedailywtf.com