我在 wso2ESB 中引发了一个错误,以便在客户端控制一些错误,而 esb 控制台显示:
ERROR {org.wso2.carbon.identity.entitlement.mediator.EntitlementMediator} - Error occurred while evaluating the policy {org.wso2.carbon.identity.entitlement.mediator.EntitlementMediator}
org.apache.axis2.AxisFault: Access Denied. Authentication failed - Invalid credentials provided.
...
...
客户端控制台显示:
org.apache.axiom.soap.SOAPProcessingException: Transport level information does not match with SOAP Message namespace URI
我在控制台中看到不同的错误,我需要获取 esb 错误消息,以便客户端代码可以捕获相同的错误 esb
此刻,我的序列“故障”配置如下:
<sequence xmlns="http://ws.apache.org/ns/synapse" name="fault" trace="enable">
<makefault version="soap12">
<code xmlns:soap12Env="http://www.w3.org/2003/05/soap-envelope" value="soap12Env:Receiver"/>
<reason xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('ERROR_MESSAGE')"/>
</makefault>
<send/>
</sequence>
和我的代理服务的顺序配置如下:
<sequence xmlns="http://ws.apache.org/ns/synapse" name="InSequence" trace="enable">
<entitlementService remoteServiceUrl="https://localhost:9443/services/" remoteServiceUserName="srxxx" remoteServicePassword="kiytr">
<onReject/>
<onAccept/>
<advice/>
<obligations/>
</entitlementService>
<header xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" name="wsse:Security" action="remove"/>
<send/>
<drop/>
</sequence>
如果有人可以帮助我,我已经尝试了几种方法来让我的客户出现错误但没有成功,我将非常感激