【问题标题】:How to get a SOAP fault message to be WS-I compliance如何让 SOAP 错误消息符合 WS-I
【发布时间】:2010-07-22 20:50:29
【问题描述】:

我有这个消息

 <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 验证正常,但是 SOAP UI 工具,当单击“检查 WS-I 合规性”时,它会给出失败状态,BP1305 断言失败。我找不到 1305 是什么,这是详细信息

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

【问题讨论】:

    标签: soap soapui


    【解决方案1】:

    问题似乎是您正在返回一个 SOAP Fault 消息,但 HTTP 状态代码为 200,因此需要发送 SOAP Faults 时 HTTP 状态代码为 500。

    【讨论】:

    • 你说得对,我已经解决了,但忘记发布答案了,原来是这样。
    【解决方案2】:

    您的故障消息中缺少详细信息元素。如果 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>
    

    【讨论】:

    • 不,仍然说它不符合 WS-I。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多