-
1. Re: xml post to external webservice
scottdawson Apr 15, 2009 5:24 PM (in response to mudgalc)Chhaya,
If you can create the SOAP message yourself, then you might try using the HttpRouter instead of SOAPClient. There's a sample HttpRouter configuration in the https_2way_ssl quickstart.
Regards,
Scott -
2. Re: xml post to external webservice
mudgalc Apr 16, 2009 3:43 PM (in response to mudgalc)Thanks Scott for your response.
I tried posting request using http router but it looks like the xml it is sending is invalid. I am getting response from the server saying "xml invalid, content not allowed in prolog"
Also i was wondering if we could use http router for invoking web service? Can you share some sample for that?
thanks
Chhaya -
3. Re: xml post to external webservice
scottdawson Apr 16, 2009 4:09 PM (in response to mudgalc)Chhaya,
I have used the HttpRouter to invoke a web service. The pre-condition is that you already have a valid SOAP message. So, in my case, I use the HttpRouter as a "pass-through". A valid SOAP message is sent in to the ESB and the HttpRouter routes it on to the external target web service.
The HttpRouter is configured with the web service endpoint, as shown below. If you need to add configuration for SSL, you can see an example of that in the https_2way_ssl quickstart.<action name="httprouter" class="org.jboss.soa.esb.actions.routing.http.HttpRouter"> <property name="endpointUrl" value="http://localhost:9000/Hello"/> <property name="method" value="POST" /> <property name="responseType" value="STRING" /> </action>
You can find some documentation here: http://www.jboss.org/community/docs/DOC-9973
Regards,
Scott -
4. Re: xml post to external webservice
mudgalc Apr 17, 2009 11:13 AM (in response to mudgalc)Scott,
thanks for your response. When i use httpRouter to invoke webservice where do i set the operation or soapaction. When i send my soap request using myrequestaction i am getting soap fault for soapaction not found.
--------------------------------------------------------------
-----------------------------------------------------------------------
any hep will be highly appreciated.
thanks
Chhaya -
5. Re: xml post to external webservice
scottdawson Apr 17, 2009 1:09 PM (in response to mudgalc)Chhaya,
You can specify any HTTP headers, including SOAPAction, using the headers property, like this:<action name="httprouter" class="org.jboss.soa.esb.actions.routing.http.HttpRouter"> <property name="endpointUrl" value="http://localhost:9000/Hello"/> <property name="method" value="POST" /> <property name="responseType" value="STRING" /> <property name="headers"> <header name="SOAPAction" value="whatever" /> </property> </action>
Regards,
Scott