Sunday 15 July 2012

esb - adding post request in my WSO2 proxy service -


I created a proxy service that transforms a message using XSLT intermediator and then changes to JSON, I want to post now how can I directly send my JSON message to the web service in my proxy service? This is my proxy service:

  & lt; Proxy xmlns = "http://ws.apache.org/ns/synapse" name = "CategoryProxy" transport = "https, http" stats = "disable" trace = "disable" startOnLoad = "true" & gt; & Lt; Goal & gt; & Lt; InSequence & gt; & Lt; Property name = "authorization" expression = "fn: concat ('basic', base64Encode ('admin: admin'))" scope = "transport" type = "STRING" / & gt; & Lt; Send & gt; & Lt; Endpoint & gt; & Lt; Address uri = "http: // localhost: 8068 / database / library. Author / 301" /> & Lt; / Endpoint & gt; & Lt; / Send & gt; & Lt; / InSequence & gt; & Lt; OutSequence & gt; & Lt; Xslt key = "conf: /ressources/catxsl.xsl" /> & Lt; Property name = "message type" value = "application / jason" scope = "axis" "type =" STRING "/> & lt; send /> & lt; / outSequence & gt; & lt; faultSequence / & Gt; & lt; / target & gt; & lt; description & gt; & lt; / description & gt; & lt; / proxy & gt;   

send me this proxy Want to post the message in the rest of the web resource, how can I do it in my proxy?

It seems that you have the level of service chaining You can do it in two ways:

1) Use of the obtained sequence

  & lt; inequality & gt; & lt; property name = "Authorization" expression = "fn: concat ('basic', base64Encode ('admin: admin'))" scope = "transport" type = "STRING" /> & gt; Get Receive = "Getting SqForChaining "& Gt; & lt; endpoint & gt; & lt; address uri =" http: // localhost: 8068 / database / library. Author / 301 "/>       

You can define the order of that sequence You can do whatever you want in the received sequence, from which you will be handed over to get the output sequence. If you do not want to take any specific action for this matter, you can add only one to it.

2) Using success to trigger other service calls

You can also do this Please note that http call is being ejected directly:

  & quot; outequence & gt; & lt; send & gt; & lt; endpoint & gt; & lt; http method = "Get" uri-template = "https://www.abc.com/resource/foo" /> & lt; / endpoint & gt; & lt; / send & gt; & lt; / outSequence & gt;   

Hope this helps.

No comments:

Post a Comment