java - WSO2 ESB - Payload not return on response -
i'm exposed simple inbound endpoint filter. in first switch try payload not on response.
second switch fault correct response (payload) send in response.
how payload can send on request response ?
<?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>
Comments
Post a Comment