Sergey,

Thank you for taking the time to respond.

I'm not sure I understand your response.   

Again, my goal is to put together a series of camel routes that wire up a
complete RESTful interaction with a remote web service, without writing any
additional camel application code.

The web service is out of my control, but I have been able to successfully
generate a request using JSON, authenticate and submit  the request via
rsClient, and apparently receive the reply all within my standalone client
application.

I say apparently because I when I set the rsClient
loggingFeatureEnabled="true", and the endpoint as "inOut", I can see the
expected reply printed out in my client console.

My expectation was that I submit a message with a JSON body (request), and
the reply is also a message with a JSON body.

Again, the following routes seem to generate a full and correct
request/response with the remote service .......

---------------------------------------------------------------------------------------------------------------------------------------------------

        <cxf:rsClient id="rsClient"
address="http://xxx.xxx.xxx:8080/Regatta/rest/autoGate/verify";
                serviceClass="Tideworks.GateVision.VanguardTest"
                loggingFeatureEnabled="true" username="xxxxx"
password="xxxxx">
        </cxf:rsClient>

        <camelContext id="integrationTesting"
xmlns="http://camel.apache.org/schema/spring";>

                <jmxAgent id="agent" disabled="false"  registryPort="1098"
createConnector="true"/>

                <dataFormats>
                        <json id="gson" library="Gson"
unmarshalTypeName="Tideworks.GateVision.VanguardTest"/>
                        <json id="gsonResponse" library="Gson"
unmarshalTypeName="Tideworks.GateVision.VanguardTestReply"/>
                </dataFormats>

                <route>
                        <from   uri="direct:httpAPI"/>
                        <inOut  uri="cxfrs://bean://rsClient"/>
                </route>

        <route>
           <from
uri="timer://gsonUsingHttpAPI?fixedRate=true&amp;period=10000"/>
           <transform>
               <simple>{"ocrPrefillGkey" : 29,"gatePrefillGkey" :
13,"laneId" : "02","truckRfidNbr" : "1234"}</simple>
           </transform>
           <setHeader headerName="CamelHttpMethod">
             <constant>PUT</constant>
           </setHeader>
           <setHeader headerName="Content-Type">
             <constant>application/json</constant>
           </setHeader>
           <to   uri="direct:httpAPI"/>
        </route>

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

CONSOLE OUTPUT ..........................   note the payload in the response
.... that is what I was expecting .....

May 01, 2014 1:06:01 PM org.apache.cxf.interceptor.LoggingOutInterceptor
INFO: Outbound Message
---------------------------
ID: 1
Address: http://xxx.xxx.xxx:8080/Regatta/rest/autoGate/verify
Http-Method: PUT
Content-Type: application/json
Headers: {org.apache.cxf.request.method=[PUT],
breadcrumbId=[ID-lyons-ubuntu-53976-1398974759338-0-1],
Content-Type=[application/json], firedTime=[Thu May 01 13:06:01 PDT 2014],
Authorization=[Basic xxxxxxxxxxxx], Accept=[*/*]}
Payload: {"ocrPrefillGkey" : 29,"gatePrefillGkey" : 13,"laneId" :
"02","truckRfidNbr" : "1234"}
--------------------------------------
May 01, 2014 1:06:02 PM org.apache.cxf.interceptor.LoggingInInterceptor
INFO: Inbound Message
----------------------------
ID: 1
Response-Code: 200
Encoding: ISO-8859-1
Content-Type: application/json
Headers: {content-type=[application/json], Date=[Thu, 01 May 2014 20:05:20
GMT], Server=[Apache-Coyote/1.1],
Set-Cookie=[JSESSIONID=81EC7C975A0E8CE4306602758A7A30F3; Path=/Regatta/;
HttpOnly], transfer-encoding=[chunked]}
Payload:
{"returnCode":1,"beforeData":null,"afterData":null,"messageStack":[],"tooManyRowsChoices":null,"returnMessage":null,"messageStackSize":0}

--------------------------------------


So, I simply want to be able to get that payload, run it through a camel
<unmarshall> into its' native Object , and hand that back to the requestor.

I was hoping my final route would look something like .....

                <route>
                        <from   uri="direct:httpAPI"/>
                        <inOut  uri="cxfrs://bean://rsClient"/>
                        <unmarshall ref="gsonResponse" />
                </route>

Again, thanks for taking a look at this.





--
View this message in context: 
http://camel.465427.n5.nabble.com/rsClient-successfully-invoking-REST-service-but-where-is-the-response-tp5750734p5750757.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to