版本:1.8.0
如果出现故障,例如"身份验证失败" WSO2AM生成soap Fault,但响应不包括soap Envelop。
请求:
POST /myapi/1.0 HTTP/1.1
Host: localhost
Content-Type: text/xml
SOAPAction: ""
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:test="http://test.com/">
<soapenv:Header/>
<soapenv:Body>
<test:search>
<searchString>1234</searchString>
</test:search>
</soapenv:Body>
</soapenv:Envelope>
响应:
HTTP/1.1 403 Forbidden
Content-Type: application/xml; charset=UTF-8
<soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode xmlns:axis2ns36="http://schemas.xmlsoap.org/soap/envelope/">axis2ns36:Client</faultcode>
<faultstring>Authentication Failure</faultstring>
<detail>Access failure for API: /rest/bfo/mycase, version: 1.0 with key: null</detail>
</soapenv:Fault>
如果没有Envelop,客户端将无法读取故障消息。看起来问题是在1.8.0中引入的,早期版本使用有效的肥皂Envelop进行响应。
答案 0 :(得分:0)
在故障序列中(/repository/deployment/server/synapse-configs/default/sequences/fault.xml)内容类型的输出故障消息设置为application / xml
<property name="messageType" value="application/xml" scope="axis2"/>
如果您想获取soap消息,请将其设置为 text / xml
<property name="messageType" value="text/xml" scope="axis2"/>