Search code examples
wso2wso2-esb

Converting json to soap+xml to send to endpoint


I converted this json file to XML { "firstNumber": 25, "secondNumber": 23 }

but it converts it to this instead; <Add xmlns="http://tempuri.org/"> <a>25</a> <b>23</b> </Add>

Now, without headers for soap and the envelop, the endpoint does not recognize this so i use an enrich mediator to make it the right format.

the issue i have is that when i use the enrich mediator, it replaces the entire soap body including the variables.

is there a way i can change only the envelop of the xml message

this is my endpoint ecs.syr.edu/faculty/fawcett/Handouts/cse775/code/calcWebService/Calc.asmx the documentation is there too

This is my code enter image description here

enter image description here`


Solution

  • What your enrich mediator is doing is replacing the Entire message with the Inline payload you have given. Inorder to resolve the issue, remove your Enrich Mediator and add the following property before sending the request out.

    <property name="messageType" value="application/soap+xml" scope="axis2"/>