Re: [Dev] Converting JSON to SOAP and vise versa in ESB

2015-02-08 Thread Uvindra Dias Jayasinha
Thanks Harsha, that worked! The issue was caused by sending the following value in the payloadFactory of the insequence, payloadFactory media-type=xml format * soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/ http://schemas.xmlsoap.org/soap/envelope/

Re: [Dev] Converting JSON to SOAP and vise versa in ESB

2015-02-07 Thread Dushan Abeyruwan
Guys it worked for me with my config I mean how Uvindra can't ? *xxx-MacBook-Pro:bin dushan$ curl -i -POST -H 'Accept: application/json' -H 'Content-Type:application/json' -d '{celsius:12}' http://192.168.56.1:8281/temp http://192.168.56.1:8281/temp* *HTTP/1.1 200 OK* *X-AspNet-Version:

Re: [Dev] Converting JSON to SOAP and vise versa in ESB

2015-02-07 Thread Malaka Silva
Can you share the wire logs? On Sat, Feb 7, 2015 at 12:50 PM, Uvindra Dias Jayasinha uvin...@wso2.com wrote: The Premature end of file exception is still happening even when I add those two properties in, this is a parser error happening on our end in the insequence itself. I still cant

Re: [Dev] Converting JSON to SOAP and vise versa in ESB

2015-02-07 Thread Uvindra Dias Jayasinha
With wire logs on the issue becomes a bit more clear, 21:34:56,129 POST /temp HTTP/1.1[\r][\n] 21:34:56,130 User-Agent: curl/7.35.0[\r][\n] 21:34:56,130 Host: 10.0.3.1:8281[\r][\n] 21:34:56,130 Accept: application/json[\r][\n] 21:34:56,130 Content-Type:application/json[\r][\n]

Re: [Dev] Converting JSON to SOAP and vise versa in ESB

2015-02-07 Thread Harsha Kumara
Hi Uvindra, I checked with this with esb 4.8.1 fresh pack. It worked fine with below config. Please find my api config and response. api name=tempAPI context=/temp resource methods=POST GET inSequence log level=custom property name=IN_MESSAGE

Re: [Dev] Converting JSON to SOAP and vise versa in ESB

2015-02-06 Thread Uvindra Dias Jayasinha
The Premature end of file exception is still happening even when I add those two properties in, this is a parser error happening on our end in the insequence itself. I still cant understand why this isnt working. On 7 February 2015 at 12:15, Chanaka Fernando chana...@wso2.com wrote: Hi Uvindra,

Re: [Dev] Converting JSON to SOAP and vise versa in ESB

2015-02-06 Thread Chanaka Fernando
Hi Uvindra, According to the website, they expect content-length header in the request. You can use the below two property mediators to send the content-length always. property name=FORCE_HTTP_CONTENT_LENGTH value=true scope=axis2/property property name=COPY_CONTENT_LENGTH_FROM_INCOMING

Re: [Dev] Converting JSON to SOAP and vise versa in ESB

2015-02-06 Thread Dushan Abeyruwan
Your API should be as. api xmlns=http://ws.apache.org/ns/synapse; name=tempAPI context=/temp resource methods=POST GET inSequence log level=custom property name=IN_MESSAGE

Re: [Dev] Converting JSON to SOAP and vise versa in ESB

2015-02-06 Thread Uvindra Dias Jayasinha
Ok tried that Dushan, but now I get a different exception when I hit the insequence 23:24:38,849 LogMediator IN_MESSAGE = IN_MESSAGE RelayUtils Error while building Passthrough stream

Re: [Dev] Converting JSON to SOAP and vise versa in ESB

2015-02-04 Thread Uvindra Dias Jayasinha
Thanks Sampath and Asanka, Tried both your suggestions and now Im getting different exception RelayUtils Error while building Passthrough stream org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[3,68] Message: DOCTYPE is not allowed at

[Dev] Converting JSON to SOAP and vise versa in ESB

2015-02-04 Thread Uvindra Dias Jayasinha
Im trying out Payload and Script mediator functionality to call this SOAP service, http://www.w3schools.com/webservices/tempconvert.asmx?op=CelsiusToFahrenheit by simulating a REST API using ESB 4.8.1, here is the synapse configuration I have defined api xmlns=http://ws.apache.org/ns/synapse;

Re: [Dev] Converting JSON to SOAP and vise versa in ESB

2015-02-04 Thread Indika Sampath
Hi Uvindra, Try like below. payloadFactory media-type=xml format web:CelsiusToFahrenheit xmlns:web= http://www.w3schools.com/webservices/; web:Celsius$1/web:Celsius /web:CelsiusToFahrenheit /format

Re: [Dev] Converting JSON to SOAP and vise versa in ESB

2015-02-04 Thread Asanka Dissanayake
Hi Uvindra, Seems message failing during the building. And it picks the wrong formatter it seems. Set the content header in the curl as follows. curl -i -POST -H 'Accept: application/json' -H 'Content-Type:application/json' -d '{celsius:12}' http://IP Address:8280/api context Thanks, Asanka D