如何使 SOAP 错误消息符合 WS-I

发布于 2024-09-11 04:54:48 字数 748 浏览 4 评论 0原文

我有这个消息

 
     
     
        <故障代码>soapenv:服务器
        LOGIN-ERR:密码不正确 - 用户无法登录。
       
     
   

架构验证良好,但 SOAP UI 工具在单击“检查 WS-I 合规性”时,会给出失败状态,并显示 BP1305 断言失败。我找不到 1305 是什么,这是详细消息

<前><代码>结果 失败的 失败详细信息 HTTP/1.1 200 好 传输编码:分块 日期:2010 年 7 月 22 日星期四 20:41:43 GMT 设置 Cookie:JSESSIONID=C9D19FE6AAD89DFCB6BA9FE196E08D40;路径=/ 内容类型:text/xml;charset=utf-8 服务器:Apache-Coyote/1.1
  Element Location:
      lineNumber=26

I have this message

 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
     <soapenv:Body>
     <soapenv:Fault>
        <faultcode>soapenv:Server</faultcode>
        <faultstring>LOGIN-ERR:Incorrect password - user could not be logged in.</faultstring>
       </soapenv:Fault>
     </soapenv:Body>
   </soapenv:Envelope>

Schema validated fine, but the SOAP UI tool, when click on "Check WS-I Compliance", it gives a failed status with BP1305 assertion fail. I can't find what 1305 is and this is the detailed message

Result
  failed
  Failure Detail Message
  HTTP/1.1 200 OK
  Transfer-Encoding: chunked
  Date: Thu, 22 Jul 2010 20:41:43 GMT
  Set-Cookie: JSESSIONID=C9D19FE6AAD89DFCB6BA9FE196E08D40; Path=/
  Content-Type: text/xml;charset=utf-8
  Server: Apache-Coyote/1.1
  Element Location:
      lineNumber=26

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

离去的眼神 2024-09-18 04:54:48

问题似乎是您正在返回 SOAP 错误消息,但 HTTP 状态代码为 200,因此需要使用 HTTP 状态代码 500 发送 SOAP 错误。

The problem seems to be that you are returning a SOAP Fault message, but with a HTTP status code of 200, SOAP Faults are required to be sent with a HTTP status code of 500.

皓月长歌 2024-09-18 04:54:48

您的故障消息中缺少详细信息元素。如果 wsdl 错误是由于请求中 body 元素的内容而产生的,那么它是必需的元素

消息应该是这样的(detail 元素应该包含应用程序特定的信息。但是可以接受为空。不接受失踪):

 <soapenv:Fault>
   <faultcode>soapenv:Server</faultcode>
   <faultstring>LOGIN-ERR:Incorrect password - user could not be logged in.</faultstring>
   <detail></detail>
  </soapenv:Fault>

You are missing the detail element in your fault message. It is a required element if the wsdl fault is produced as a results of the contents of the body element in the request

The message should be like this (detail element should contain application specific info. But it is acceptable to be empty. Not acceptable to be missing):

 <soapenv:Fault>
   <faultcode>soapenv:Server</faultcode>
   <faultstring>LOGIN-ERR:Incorrect password - user could not be logged in.</faultstring>
   <detail></detail>
  </soapenv:Fault>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文