<target>
<inSequence>
<log level="full">
<property name="text" value="** User Ticket Request Process **"/>
</log>
<property xmlns:heal="http://ticketreservationRequest.wso2" name="customerID" expression="//heal:getUserRequest/heal:customerID/text()" scope="default" type="STRING"/>
<property xmlns:heal="http://ticketreservationRequest.wso2" name="requestID" expression="//heal:getUserRequest/heal:requestID/text()" scope="default" type="STRING"/>
<property xmlns:heal="http://ticketreservationRequest.wso2" name="movieName" expression="//heal:getUserRequest/heal:movieName/text()" scope="default" type="STRING"/>
<property xmlns:heal="http://ticketreservationRequest.wso2" name="noOfSeats" expression="//heal:getUserRequest/heal:noOfSeats/text()" scope="default" type="STRING"/>
<log level="custom" separator=",">
<property name="movieName" expression="$ctx:movieName"/>
<property name="noOfSeats" expression="$ctx:noOfSeats"/>
</log>
<log level="custom" separator=",">
<property name="MessageFlow" value="======================= Before Sending User Request to RequestService : ======================="/>
</log>
<enrich>
<source type="inline" clone="true">
<p:createrequest xmlns:p="http://axis.com">
<xs:customerID xmlns:xs="http://axis.com">x</xs:customerID>
<xs:requestID xmlns:xs="http://axis.com">y</xs:requestID>
<xs:movieName xmlns:xs="http://axis.com">z</xs:movieName>
<xs:noOfSeats xmlns:xs="http://axis.com">0</xs:noOfSeats>
</p:createrequest>
</source>
<target type="body"/>
</enrich>
<enrich>
<source type="property" clone="true" property="customerID"/>
<target xmlns:p="http://axis.com" xpath="//p:createrequest/p:customerID/text()"/>
</enrich>
<enrich>
<source type="property" clone="true" property="requestID"/>
<target xmlns:p="http://axis.com" xpath="//p:createrequest/p:requestID/text()"/>
</enrich>
<enrich>
<source type="property" clone="true" property="movieName"/>
<target xmlns:p="http://axis.com" xpath="//p:createrequest/p:movieName/text()"/>
</enrich>
<enrich>
<source type="property" clone="true" property="noOfSeats"/>
<target xmlns:p="http://axis.com" xpath="//p:createrequest/p:noOfSeats/text()"/>
</enrich>
<log level="custom" separator=",">
<property name="MessageFlow" value="======================= Sending Request To RequestService======================="/>
</log>
<log level="full" separator=","/>
<send receive="loginRequest">
<endpoint key="SendRequest"/>
</send>
</inSequence>
<outSequence>
<log level="full" separator=","/>
<send/>
</outSequence>
<faultSequence/>
</target>
<publishWSDL uri="http://192.168.1.2:9765/services/CreateRequest?wsdl"/>
</proxy>
- The design of the proxy is as follows
Deploy the artifacts
- Go to Developer Studio dashboard and select Composite Application Project and the give the name as 'CustomerCApp' and dependencies as stated below
- ticketRequestProxy
- CustomerAxis2ServiceProject
- Then Right click on the CustomerCApp and select 'Export Composite Application Project' then give a name and destination. Now you have the .car file
- Then start the WSO2 AS by navigate to $CARBON_HOME/bin and type the command wso2server.sh (Linux) or wso2server.bat (Windows)
- Then deploy the created .car file on the server.
- Then start WSO2 ESB and deploy the .car file
- Send the below soap request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:heal="http://ticketreservationRequest.wso2">
<soapenv:Body>
<heal:getUserRequest>
<heal:customerID>123</heal:customerID>
<heal:requestID>100</heal:requestID>
<heal:movieName>Harry Potter</heal:movieName>
<heal:noOfSeats>3</heal:noOfSeats>
</heal:getUserRequest>
</soapenv:Body>
</soapenv:Envelope>
- See the logs in ESB console