【发布时间】:2012-01-11 13:21:41
【问题描述】:
我有一个这种形式的 SOAP 请求:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:myqname="http://example.com/hello"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<myqname:MyRequest xmlns:myqname="http://example.com/hello">
...
</myqname:MyRequest>
</soapenv:Body>
</soapenv:Envelope>
如果我让 SOAPUI “格式化 XML”这个请求, 它删除了 myqname 的第二个声明,所以我得到了这个:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:myqname="http://example.com/hello"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<myqname:MyRequest>
...
</myqname:MyRequest>
</soapenv:Body>
</soapenv:Envelope>
原始请求工作正常, 但应用服务器因修改后的请求而失败,并出现以下错误:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Unmarshalling Error: UndeclaredPrefix: Cannot resolve 'myqname:MyRequest' as a QName: the prefix 'myqname' is not declared.</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
根据网络服务规范, qname 是否必须在soapenv:Body 节点中重新声明? 这是 SOAPUI 错误还是应用程序服务器错误?还是我的误解?
SOAPUI 4.0.1,WebLogic Server 版本:10.3.2.0
编辑:ups,即使使用WebLogic应用服务器,我也是使用CXF web services框架。我在那里发布了这个问题。 issues.apache.org/jira/browse/CXF-4026
所以:SOAPUI 4.0.1、CXF 2.5.0
【问题讨论】:
标签: web-services soap cxf soapui