wso2esb - WSO2 ESB How to deliver the message of the Custom Mediator in EndPoint -
good day!
i began study esb bus. need convert incoming soap message in http request content-type: application/x-www-form-urlencoded.
i have created proxy service, custom mediator 1 in java, transformed message, how pass endpoint , reply in custom mediator 2?
in image have drawn illustration of how transform message.
you don't need write custom mediators, can transform soap rest calls, sample rest service waiting 2 parameters
param1=value1¶m2=value2
<!-- prepare info org.apache.axis2.transport.http.xformurlencodedformatter message formatter --> <payloadfactory media-type="xml"> <format> <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:body> <root> <param1>$1</param1> <param2>$2</param2> </root> </soapenv:body> </soapenv:envelope> </format> <args> <arg evaluator="xml" expression="$body/node1/node11/text()"/> <arg evaluator="xml" expression="$body/node1/node12/text()"/> </args> </payloadfactory> <!-- set output format --> <property name="messagetype" value="application/x-www-form-urlencoded" scope="axis2" type="string"/> <property name="disable_chunking" value="true" scope="axis2" type="string"/> <!-- phone call rest endpoint synch phone call : response received in sequence --> <call> <endpoint key="conf:endpoints/myserviceendpoint.xml"/> </call> <!-- response here, transform has needed --> <xslt key="myxsl"/> <!-- send response client --> <property name="messagetype" value="application/soap+xml" scope="axis2" type="string"/> <!-- or test/xml , in case, don't forget specify soap action, below, sample specify blank soapaction : --> <header name="action" value=""""/> <send/>
sample endpoint conf (with sample, need define property uri.var.serviceurl in sequence) :
<endpoint> <http method="post" uri-template="{uri.var.serviceurl}/path/2011-10-01"/> </endpoint>
but if need custom mediators, replace payloadfactory , xslt mediators them
wso2 wso2esb mediator synapse
No comments:
Post a Comment