WSO2 rampart回调处理程序未提供密码

时间:2018-10-18 19:59:02

标签: wso2 wso2esb

我对WSO2代理(ESB v5.0.0)有问题,该代理受基本身份验证策略保护。我创建了一个简化的测试用例来显示问题。 具有安全策略的代理服务将调用不安全的后端服务。当该调用超时时,诊断响应将通过“ onError”序列返回给调用者。 当从迭代器内部调用后端服务时,出站响应将失败,并显示以下信息:

  

org.apache.axis2.AxisFault:回调未提供密码   用户的处理程序:“ wso2carbon”           在org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:76)           在org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)           在org.apache.axis2.engine.Phase.invoke(Phase.java:313)           在org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)           在org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:426)           在org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:222)           在org.apache.synapse.mediators.builtin.RespondMediator.mediate(RespondMediator.java:35)中           在org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)           在org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)           在org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)           在org.apache.synapse.mediators.MediatorFaultHandler.onFault(MediatorFaultHandler.java:93)           在org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:53)           在org.apache.synapse.endpoints.AbstractEndpoint.invokeNextFaultHandler(AbstractEndpoint.java:698)           在org.apache.synapse.endpoints.AbstractEndpoint.onFault(AbstractEndpoint.java:530)           在org.apache.synapse.endpoints.WSDLEndpoint.onFault(WSDLEndpoint.java:58)           在org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:53)           在org.apache.synapse.core.axis2.TimeoutHandler.processCallbacks(TimeoutHandler.java:178)           在org.apache.synapse.core.axis2.TimeoutHandler.run(TimeoutHandler.java:89)           在java.util.TimerThread.mainLoop处(未知源)           在java.util.TimerThread.run(未知来源)       由以下原因引起:org.apache.rampart.RampartException:回调处理程序没有为用户提供密码:“ wso2carbon”           在org.apache.rampart.builder.BindingBuilder.addUsernameToken(BindingBuilder.java:207)           在org.apache.rampart.builder.TransportBindingBuilder.build(TransportBindingBuilder.java:95)           在org.apache.rampart.MessageBuilder.build(MessageBuilder.java:140)           在org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:65)

删除迭代器后,代理正确完成,当后端服务超时时返回我的错误消息。

如果我删除了安全策略,那么无论有没有迭代器,它都可以正常工作。

有人有任何建议可能是什么问题吗?我已将代理简化到最小程度以显示错误:

<proxy name="Tester" startOnLoad="true" transports="https http" xmlns="http://ws.apache.org/ns/synapse">
    <target>
        <inSequence>
            <enrich>
                <source clone="true" type="body"/>
                <target property="storeBody" type="property"/>
            </enrich>
            <payloadFactory media-type="xml">
                <format>
                    <Root xmlns="">
                        <Child/>
                    </Root>
                </format>
                <args/>
            </payloadFactory>
            <iterate expression="//Root/Child">
                <target>
                    <sequence>
                        <enrich>
                            <source clone="true" property="storeBody" type="property"/>
                            <target type="body"/>
                        </enrich>
                        <send>
                            <endpoint key="WSRTE_reg"/>
                        </send>
                    </sequence>
                </target>
            </iterate>
        </inSequence>
        <outSequence/>
        <faultSequence>
            <payloadFactory media-type="xml">
                <format>
                    <Error xmlns="">Error</Error>
                </format>
                <args/>
            </payloadFactory>
            <header action="remove" name="wsse:Security" scope="default" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity- 
 secext-1.0.xsd"/>
            <respond/>
        </faultSequence>
    </target>
    <policy key="gov:ihp360/AA/AA_security_policy.xml"/>
    <enableSec/>
</proxy>

更糟糕的是,一旦发生了一次错误,即使后端没有超时并且需要重新启动才能重新工作,ESB也会抛出相同的错误。

有什么建议吗?

0 个答案:

没有答案