我使用过滤器公开了一个简单的入站端点。在第一个交换机中尝试但我的有效负载不在响应上。
带故障的第二个开关在响应中发送正确的响应(有效载荷)。
如何根据请求响应发送我的有效负载?
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="authUser" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<property name="senha" scope="default" type="STRING" value="ah"/>
<log level="full">
<property expression="get-property('REQUEST_PAYLOAD')" name="Request Payload"/>
<property name="Text" value="Recebi o request"/>
<property expression="get-property('senha')" name="senha"/>
<property expression="/soapenv:Envelope/soapenv:Body/MT_OrdemServico_Dealer_v2/ORDEMSERVICO/ID_CHASSI" name="ID_CHASSI" xmlns:ser="http://teste.com.br/h3s/4W/servico/" xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"/>
<property expression="/soapenv:Envelope/soapenv:Header/ser:User/Senha" name="RequestSenha" xmlns:ser="http://teste.com.br/h3s/4W/servico/" xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"/>
</log>
<filter description="CheckIfPasswordIsCorrect" xmlns:ser="http://teste.com.br/h3s/4W/servico/" xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xpath="get-property('senha') = string(/soapenv:Envelope/soapenv:Header/ser:User/Senha)">
<then>
<log description="Log Flow" level="full">
<property name="senha" value="correta"/>
</log>
<property name="messageType" scope="axis2" type="STRING" value="text/plain"/>
<enrich>
<source clone="true" type="inline">
<soapenv:Envelope>
<soapenv:Header/>
<soapenv:Body>
<text xmlns="http://ws.apache.org/commons/ns/payload"/>
</soapenv:Body>
</soapenv:Envelope>
</source>
<target type="envelope"/>
</enrich>
<property name="messageType" scope="axis2" type="STRING" value="text/xml"/>
<property action="remove" name="NO_ENTITY_BODY" scope="axis2"/>
<header action="remove" name="To" scope="default"/>
<property name="RESPONSE" scope="default" type="STRING" value="true"/>
</then>
<else>
<log level="custom">
<property name="senha" value="errada"/>
</log>
<payloadFactory media-type="xml">
<format>
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
<SOAP:Header/>
<SOAP:Body/>
</SOAP:Envelope>
</format>
<args/>
</payloadFactory>
<makefault version="soap11">
<code value="soap11Env:Client" xmlns:soap11Env="http://schemas.xmlsoap.org/soap/envelope/"/>
<reason value="Usuário não encontrado"/>
</makefault>
</else>
</filter>
<respond/>
</sequence>