java - Chain of webservices using camel -


i've got 2 webservices. 1 take input string, , return xml document. second take xml first , return xml document. i'm interested in second document.

the catch can't modify in anyway how these webservices work, , input parameter has send inside url (it doesn't work inside body of request)

so basically, want call web service input=body (that's work). want call second webservice input=body returned first one.

here camel config:

<route>     <from uri="direct:language-identifier" />     <tod uri="http://opener.olery.com/language-identifier?input=${body}&amp;bridgeendpoint=true"/> </route>  <route>     <from uri="direct:tokenizer" />     <setheader headername="input"><simple>${in.body}</simple></setheader>     <tod uri="http://opener.olery.com/tokenizer?bridgeendpoint=true"/> </route>  <route>     <from uri="servlet:opener-preparse"/>     <pipeline>         <to uri="direct:language-identifier"/>         <to uri="direct:tokenizer"/>     </pipeline> </route> 

my problem is:

  • when use tod in second webservice pass input parameter, invalid character (probably because data contains new lines)

  • when use setheader in previous config, input of second service set initial data (not data returned first webservice)

how can fix it?

to replace initial route body return value webservice call, make sure empty route body before calling web service:

<camel:setbody>     <camel:simple>${bodyas(null)}</camel:simple> </camel:setbody> <tod uri="http://your-web-service"/> 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -