我试图创建一个自定义代理,当请求有效负载是非法的xml时,它会响应SoapFault,但无论我尝试什么,faultSequence都不会被调用。
使用PassThroughProxy时,不会发生此问题,只有CustomProxy。
有人遇到过这个问题吗?
以下是我的示例自定义代理:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="FileService" transports="http https" startOnLoad="true" trace="disable">
<target>
<inSequence>
<property name="file.md5.path" expression="//*[local-name() = 'filePath']" scope="default" type="STRING"/>
<class name="testowe.mediators.file.md5"/>
<payloadFactory media-type="xml">
<format>
<exam:OutputType xmlns:exam="http://example.com/">
<exam:result>$1</exam:result>
</exam:OutputType>
</format>
<args>
<arg evaluator="xml" expression="$ctx:file.md5.result"/>
</args>
</payloadFactory>
<respond/>
</inSequence>
<outSequence/>
<faultSequence>
<log level="full" description="Blad w faulcie"/>
<makefault version="soap11">
<code xmlns:soap11Env="http://schemas.xmlsoap.org/soap/envelope/" value="soap11Env:Client"/>
<reason expression="$ctx:ERROR_MESSAGE"/>
<role/>
</makefault>
<send/>
</faultSequence>
</target>
<publishWSDL key="conf:testowe/schemas/FileService.wsdl">
<resource location="FileService.Messages.xsd" key="conf:testowe/schemas/FileService.Messages.xsd"/>
</publishWSDL>
</proxy>