SOAP 信封中的命名空间前缀导致解析错误:“服务器无法读取请求”
我有一个客户正在尝试在他们的 Java 环境中使用我们的 .Net WebService。他们使用“javax.xml.soap.*”,它需要命名空间前缀。这些相同的命名空间前缀会导致我们端出现解析异常。
SoapServerMessage.Exception:“服务器无法读取请求。”
我们正在使用“System.Web.Services.WebService”,
这是他们试图传递的请求:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header>
<ct:CredentialsSoapHeader xmlns:ct="http://ourwebsite.com/webservices/"
xsi:type="WebServiceKeyCredentials">
<Key>demoKey</Key>
<Password>demoPassword</Password>
</ct:CredentialsSoapHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ct1:GetUserID xmlns:ct1="http://ourwebsite.com/webservices/">
<EmailAddress>[email protected]</EmailAddress>
</ct1:GetUserID>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
生成的响应:
HTTP/1.1 500 Internal Server Error
Cache-Control: private
Content-Type: text/xml; charset=utf-8
ETag: ""
Server: Microsoft-IIS/7.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 17 Jan 2012 19:28:20 GMT
Content-Length: 0
一旦我去掉名称空间前缀,请求就可以正常工作。我对这个系统不是很熟悉,但我会尽力根据需要提供任何信息。
预先感谢您提供的任何帮助!
I have a client who is attempting to use our .Net WebService with their Java environment. They're using 'javax.xml.soap.*' which requires a namespace prefix. These same namespace prefixes cause parsing exceptions on our end.
SoapServerMessage.Exception : "Server was unable to read request."
We are using 'System.Web.Services.WebService'
Here is a request they are trying to pass through:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header>
<ct:CredentialsSoapHeader xmlns:ct="http://ourwebsite.com/webservices/"
xsi:type="WebServiceKeyCredentials">
<Key>demoKey</Key>
<Password>demoPassword</Password>
</ct:CredentialsSoapHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ct1:GetUserID xmlns:ct1="http://ourwebsite.com/webservices/">
<EmailAddress>[email protected]</EmailAddress>
</ct1:GetUserID>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The generated response:
HTTP/1.1 500 Internal Server Error
Cache-Control: private
Content-Type: text/xml; charset=utf-8
ETag: ""
Server: Microsoft-IIS/7.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 17 Jan 2012 19:28:20 GMT
Content-Length: 0
As soon as I strip away the namespace prefix, the request works fine. I'm not very familiar with this system but I will try to provide any information as needed.
Thank you in advance for any help that can be provided!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论