Hi Himasha,

ESB sends application/x-www-form-urlencoded as the Content-Type to the
backend which is the reason for this failure. When I do comment out the
following parameter in the passthru-http.properties.

http.headers.preserve=Content-Type.

Also When i configured  args as <arg evaluator="xml"
expression="get-property('uri.var.patientId')"/> I could able to receive
the json response.

Thank you

On Mon, Nov 13, 2017 at 9:53 AM, Thivya Mahenthirarasa <[email protected]>
wrote:

> Hi Himasha
>
> As you said having xml in the media type also ended up with the same
> response. What could be the root cause that the request couldn' t reach the
> backend?
>
>
> Thank you
>
> On Mon, Nov 13, 2017 at 8:21 AM, Himasha Guruge <[email protected]> wrote:
>
>> Hi Thivya,
>>
>>  Could you verify the media type you have used in payload 
>> mediator?(<payloadFactory
>> media-type="soap+xml">)  AFAIK, you can only use xml/json there [1] .
>> According to the wire logs the request that is been sent is an empty soap
>> envelope which means your request content has not been set through payload
>> mediator.
>>
>> "Direction: request, Envelope: <?xml version='1.0'
>> encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.
>> xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope>"
>>
>> [1] https://docs.wso2.com/display/ESB500/PayloadFactory+Medi
>> ator#PayloadFactoryMediator-Syntax
>>
>> Thanks,
>> Himasha
>>
>> On Mon, Nov 13, 2017 at 12:33 AM, Thivya Mahenthirarasa <[email protected]>
>> wrote:
>>
>>> Hi ,
>>> Thank you for the response.
>>>
>>> I wonder that no request is sent to the back-end service. Just ESB is
>>> sending a response to the rest client that it accepts the requests. What
>>> might be the root cause?. This behavior occurs in all other resources
>>> too(DELETE, PUT, POST).
>>>
>>> What might be the root cause for this? Find the wire logs attached.
>>>
>>>
>>> [2017-11-13 00:27:48,651] DEBUG - wire HTTP-Listener I/O dispatcher-2 >>
>>> "GET /services/CentralPatientService/readCMedi HTTP/1.1[\r][\n]"
>>> [2017-11-13 00:27:48,652] DEBUG - wire HTTP-Listener I/O dispatcher-2 >>
>>> "cache-control: no-cache[\r][\n]"
>>> [2017-11-13 00:27:48,652] DEBUG - wire HTTP-Listener I/O dispatcher-2 >>
>>> "Postman-Token: bfba4351-46c4-4fed-90f5-745566dbfdf7[\r][\n]"
>>> [2017-11-13 00:27:48,652] DEBUG - wire HTTP-Listener I/O dispatcher-2 >>
>>> "patientId: 15[\r][\n]"
>>> [2017-11-13 00:27:48,652] DEBUG - wire HTTP-Listener I/O dispatcher-2 >>
>>> "Accept: application/json[\r][\n]"
>>> [2017-11-13 00:27:48,652] DEBUG - wire HTTP-Listener I/O dispatcher-2 >>
>>> "Content-Type: application/json[\r][\n]"
>>> [2017-11-13 00:27:48,652] DEBUG - wire HTTP-Listener I/O dispatcher-2 >>
>>> "User-Agent: PostmanRuntime/6.1.6[\r][\n]"
>>> [2017-11-13 00:27:48,652] DEBUG - wire HTTP-Listener I/O dispatcher-2 >>
>>> "Host: 172.16.2.73:8285[\r][\n]"
>>> [2017-11-13 00:27:48,652] DEBUG - wire HTTP-Listener I/O dispatcher-2 >>
>>> "accept-encoding: gzip, deflate[\r][\n]"
>>> [2017-11-13 00:27:48,652] DEBUG - wire HTTP-Listener I/O dispatcher-2 >>
>>> "Connection: keep-alive[\r][\n]"
>>> [2017-11-13 00:27:48,652] DEBUG - wire HTTP-Listener I/O dispatcher-2 >>
>>> "[\r][\n]"
>>> [2017-11-13 00:27:48,652] DEBUG - headers http-incoming-7 >> GET
>>> /services/CentralPatientService/readCMedi HTTP/1.1
>>> [2017-11-13 00:27:48,652] DEBUG - headers http-incoming-7 >>
>>> cache-control: no-cache
>>> [2017-11-13 00:27:48,652] DEBUG - headers http-incoming-7 >>
>>> Postman-Token: bfba4351-46c4-4fed-90f5-745566dbfdf7
>>> [2017-11-13 00:27:48,652] DEBUG - headers http-incoming-7 >> patientId:
>>> 15
>>> [2017-11-13 00:27:48,652] DEBUG - headers http-incoming-7 >> Accept:
>>> application/json
>>> [2017-11-13 00:27:48,652] DEBUG - headers http-incoming-7 >>
>>> Content-Type: application/json
>>> [2017-11-13 00:27:48,652] DEBUG - headers http-incoming-7 >> User-Agent:
>>> PostmanRuntime/6.1.6
>>> [2017-11-13 00:27:48,652] DEBUG - headers http-incoming-7 >> Host:
>>> 172.16.2.73:8285
>>> [2017-11-13 00:27:48,652] DEBUG - headers http-incoming-7 >>
>>> accept-encoding: gzip, deflate
>>> [2017-11-13 00:27:48,652] DEBUG - headers http-incoming-7 >> Connection:
>>> keep-alive
>>> [2017-11-13 00:27:48,653]  INFO - LogMediator To:
>>> /services/CentralPatientService/readCMedi, MessageID:
>>> urn:uuid:db12eb62-ec97-45ff-8956-488d8b366d75, Direction: request,
>>> Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";><s
>>> oapenv:Body/></soapenv:Envelope>
>>> [2017-11-13 00:27:48,654] DEBUG - headers http-incoming-7 << HTTP/1.1
>>> 202 Accepted
>>> [2017-11-13 00:27:48,654] DEBUG - headers http-incoming-7 << Date: Sun,
>>> 12 Nov 2017 18:57:48 GMT
>>> [2017-11-13 00:27:48,654] DEBUG - headers http-incoming-7 <<
>>> Transfer-Encoding: chunked
>>> [2017-11-13 00:27:48,654] DEBUG - headers http-incoming-7 << Connection:
>>> keep-alive
>>> [2017-11-13 00:27:48,655] DEBUG - wire HTTP-Listener I/O dispatcher-2 <<
>>> "HTTP/1.1 202 Accepted[\r][\n]"
>>> [2017-11-13 00:27:48,655] DEBUG - wire HTTP-Listener I/O dispatcher-2 <<
>>> "Date: Sun, 12 Nov 2017 18:57:48 GMT[\r][\n]"
>>> [2017-11-13 00:27:48,655] DEBUG - wire HTTP-Listener I/O dispatcher-2 <<
>>> "Transfer-Encoding: chunked[\r][\n]"
>>> [2017-11-13 00:27:48,655] DEBUG - wire HTTP-Listener I/O dispatcher-2 <<
>>> "Connection: keep-alive[\r][\n]"
>>> [2017-11-13 00:27:48,655] DEBUG - wire HTTP-Listener I/O dispatcher-2 <<
>>> "[\r][\n]"
>>> [2017-11-13 00:27:48,655] DEBUG - wire HTTP-Listener I/O dispatcher-2 <<
>>> "0[\r][\n]"
>>> [2017-11-13 00:27:48,655] DEBUG - wire HTTP-Listener I/O dispatcher-2 <<
>>> "[\r][\n]"
>>>
>>> Cheers,
>>> Thivya
>>>
>>> On Sun, Nov 12, 2017 at 11:44 PM, Bhathiya Jayasekara <[email protected]
>>> > wrote:
>>>
>>>> You can enable wire logs and see where the issue is. (i.e. the API
>>>> itself or backend).
>>>>
>>>> Thanks,
>>>> Bhathiya
>>>>
>>>> On Sun, Nov 12, 2017 at 11:22 PM, Thivya Mahenthirarasa <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I created an API for CRUD operation in ESB 5.0.0 and tried to access a
>>>>> soap backend. And where
>>>>> the responses I get from all CRUD operations are 202 accepted. But no
>>>>> of the operations are performed. Also, I'm not observing any error logs.
>>>>>
>>>>> I have attached here the GET operation resource of my API as a sample.
>>>>>
>>>>>
>>>>>
>>>>>  <resource methods="GET" url-mapping="/readCMedi">
>>>>>       <inSequence>
>>>>>          <payloadFactory media-type="soap+xml">
>>>>>             <format>
>>>>>                <soap:Envelope xmlns:soap="http://www.w3.org/
>>>>> 2003/05/soap-envelope">
>>>>>                   <soap:Body>
>>>>>                      <ser:readCMedi xmlns:ser="http://service.samp
>>>>> le.central.com">
>>>>>                         <ser:patientId>$1</ser:patientId>
>>>>>                      </ser:readCMedi>
>>>>>                   </soap:Body>
>>>>>                </soap:Envelope>
>>>>>             </format>
>>>>>             <args>
>>>>>                <arg xmlns:m0="http://dto.service.s
>>>>> ample.central.com/xsd" evaluator="xml" expression="//m0:patientId"/>
>>>>>             </args>
>>>>>          </payloadFactory>
>>>>>          <header name="Authorization" scope="transport" value="Basic
>>>>> dGhpdnlhOnRoaXZ5YTEyMw=="/>
>>>>>          <log level="full"/>
>>>>>          <send>
>>>>>             <endpoint>
>>>>>                <address uri="https://192.168.55.160:94
>>>>> 43/services/CentralPatientService" format="soap11"/>
>>>>>             </endpoint>
>>>>>          </send>
>>>>>          <log/>
>>>>>       </inSequence>
>>>>>       <outSequence>
>>>>>          <log level="full"/>
>>>>>          <property name="messageType" value="application/json"
>>>>> scope="axis2" type="STRING"/>
>>>>>          <send/>
>>>>>       </outSequence>
>>>>>    </resource>
>>>>>
>>>>>
>>>>> WSDL location http://192.168.55.160:9763/ser
>>>>> vices/CentralPatientService?wsdl
>>>>>
>>>>> Could you please advice on this?
>>>>>
>>>>>
>>>>> Cheers,
>>>>> Thivya
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> *Thivya Mahenthirarasa*
>>>>>
>>>>> *Software Engineer -Support Team | WSO2*
>>>>>
>>>>>
>>>>> *Email: [email protected] <[email protected]>*
>>>>>
>>>>> *Mobile: +94766461966 <076%20646%201966> <http://wso2.com/signature>*
>>>>> *Web: http://wso2.com <http://wso2.com>*
>>>>>
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> [email protected]
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> *Bhathiya Jayasekara*
>>>> *Associate Technical Lead,*
>>>> *WSO2 inc., http://wso2.com <http://wso2.com>*
>>>>
>>>> *Phone: +94715478185 <+94%2071%20547%208185>*
>>>> *LinkedIn: http://www.linkedin.com/in/bhathiyaj
>>>> <http://www.linkedin.com/in/bhathiyaj>*
>>>> *Twitter: https://twitter.com/bhathiyax <https://twitter.com/bhathiyax>*
>>>> *Blog: http://movingaheadblog.blogspot.com
>>>> <http://movingaheadblog.blogspot.com/>*
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> *Thivya Mahenthirarasa*
>>>
>>> *Software Engineer -Support Team | WSO2*
>>>
>>>
>>> *Email: [email protected] <[email protected]>*
>>>
>>> *Mobile: +94766461966 <+94%2076%20646%201966>
>>> <http://wso2.com/signature>*
>>> *Web: http://wso2.com <http://wso2.com>*
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Himasha Guruge
>> Senior Software Engineer
>> WS*O2* *Inc.*
>> Mobile: +94 777459299 <+94%2077%20745%209299>
>> [email protected]
>>
>
>
>
> --
>
> *Thivya Mahenthirarasa*
>
> *Software Engineer -Support Team | WSO2*
>
>
> *Email: [email protected] <[email protected]>*
>
> *Mobile: +94766461966 <+94%2076%20646%201966> <http://wso2.com/signature>*
> *Web: http://wso2.com <http://wso2.com>*
>



-- 

*Thivya Mahenthirarasa*

*Software Engineer -Support Team | WSO2*


*Email: [email protected] <[email protected]>*

*Mobile: +94766461966 <http://wso2.com/signature>*
*Web: http://wso2.com <http://wso2.com>*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to