I'm using a proxy service in WSO2 ESB in between a REST api and a WCF Service. The WCF service that I am calling accepts and returns an XElement object. When the response of the WCF service enters the out sequence of the proxy the result is in binary.
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<axis2ns43:binary xmlns:axis2ns43="http://ws.apache.org/commons/ns/payload"></axis2ns43:binary>
</soapenv:Body>
</soapenv:Envelope>
The message in the soap body should look something like
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<Location><Result>Success</Result></Location>
</soapenv:Body>
</soapenv:Envelope>
How can I transform the binary message into the actual XML that it is supposed to be? I'm guessing I need to use either a formatted or builder mediator to accomplish this, I'm just not sure how.