请求和响应之间使用不同的 SOAP 命名空间/版本是否合法?
第三次编辑:我现在相信这个问题是由于 SOAP 版本不匹配(1.1 请求,1.2 响应)伪装成名称空间问题造成的。混合版本是非法的,还是只是风格不好?如果我无法更改我的 SOAP 版本或服务的版本,我是否完全不走运?
第二次编辑:澄清错误消息,并尝试减少“tl;dr”的程度。
编辑:[链接已删除,不相关]
使用soapUI,我发送一个以:开头的请求,
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ...
并收到以:开头的响应
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" ...
我知道服务正在获取信息,因为下游进程正在运行。但是,我的soapUI 测试步骤失败了。它有两个活动断言:“SOAP 响应”和“不是 SOAP 错误”。失败标记位于“SOAP 响应”旁边,并包含以下消息:
第-1行:Element Envelope@http://www.w3.org/ 2003/05/soap-envelope 不是有效的 Envelope@http://schemas。 xmlsoap.org/soap/envelope/ 文档或有效的替换。
我尝试过混合和匹配命名空间前缀和架构 URL。更改前缀似乎没有效果;更改 URL 会导致 VersionMismatch
错误。我也尝试过使用替换组,但这似乎不合法。
THIRD EDIT: I now believe that this problem is due to a SOAP version mismatch (1.1 request, 1.2 response) masquerading as a namespace problem. Is it illegal to mix versions, or just bad style? Am I completely out of luck if I can't change my SOAP version or the service's?
SECOND EDIT: Clarified error message, and tried to reduce "tl;dr"-ness.
EDIT: [Link deleted, not related]
Using soapUI, I'm sending a request that starts with:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ...
and getting a response that starts with:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" ...
I know the service is getting the info, because processes down the line are working. However, my soapUI teststep fails. It has two active assertions: "SOAP Response" and "Not SOAP Fault." The failure marker is next to "SOAP Response," with the following message:
line -1: Element Envelope@http://www.w3.org/2003/05/soap-envelope is not a valid Envelope@http://schemas.xmlsoap.org/soap/envelope/ document or a valid substitution.
I have tried mixing and matching the namespace prefixes and schema URLs. Changing prefixes seems to have no effect; changing URLs causes a VersionMismatch
error. I have also tried to use a substitution group, but that doesn't seem to be legal.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这两个命名空间都是完全有效的(您甚至可以导航到每个命名空间以查看架构定义)。听起来好像问题出在您的 Soap UI 测试实用程序上,并使用请求中的名称空间处理响应。
服务描述请求和响应有效负载,命名空间有助于定义该定义。虽然在两者之间混合/匹配这些定义似乎很糟糕,但它仍然有效。
尽管请求和响应之间的模式混合在一起,但它们只是解释请求和响应值的帮助者。
Both namespaces are entirely valid (you can even navigate to each one to see the schema definition). It sounds as though the issue is with your Soap UI test utility and treating the response with the namespace from the request.
A service describes the request and response payload, and namespaces help to define that definition. While it seems bad form to mix/match these definitions between the two, it is still valid.
Even though the schemas get mixed between request and response, those are just helpers in interpreting request and response values.
好吧,编辑后的问题似乎确实有一个答案:“这取决于。”
W3C:从 SOAP/1.1 到 SOAP 1.2 的版本转换
Okay, the edited question does seem to have an answer: "It depends."
W3C: Version Transition From SOAP/1.1 to SOAP Version 1.2