Hi Camel Experts,
I need to invoke a SOAP based web service using Camel. Or in other words my requirements that my application would push data on JMS queue. This data would further be handed over to a third party that has exposed a web service this purpose. The web service would also send back a reply.
For sake of simplicity I am using the Web Service available at: http://www.webservicex.net/length.asmx
REQUEST:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET/">
<soapenv:Header/>
<soapenv:Body>
<web:ChangeLengthUnit>
<web:LengthValue>100</web:LengthValue>
<web:fromLengthUnit>Inches</web:fromLengthUnit>
<web:toLengthUnit>Feet</web:toLengthUnit>
</web:ChangeLengthUnit>
</soapenv:Body>
</soapenv:Envelope>
RESPONSE:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ChangeLengthUnitResponse xmlns="http://www.webserviceX.NET/">
<ChangeLengthUnitResult>8.3333333333333339</ChangeLengthUnitResult>
</ChangeLengthUnitResponse>
</soap:Body>
</soap:Envelope>
From documentation, it seems that I can use CXF component for this purpose. However, I am not able to get clarity about the same. I am trying to build the route on the following lines:
from("cxf:http://www.webservicex.net/length.asmx?wsdlURL=http://www.webservicex.net/length.asmx?WSDL&dataFormat=MESSAGE")
.to("log:SOAPWSConsume?showAll=true&multiline=true&level=ERROR");
I have tried other options like serviceName, portName but have not been successful in invoking the same. An example of a error:
java.lang.AbstractMethodError: org.apache.crimson.tree.XmlDocument.setDocumentURI(Ljava/lang/String;)V
at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1125)
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:248)
So, my confusions (and hence queries) are:
# Do i need to generate client side stubs using the utilities like wsdl2java
# How can i provide the input parameters (like length, convert from, convert to)
# If I need to provide authentication information, how can i provide the username password.
A pointer to a working example would be of great help.
___________________
Thks & brgds
P Manchanda
Mobile: +91-9811210374
I need to invoke a SOAP based web service using Camel. Or in other words my requirements that my application would push data on JMS queue. This data would further be handed over to a third party that has exposed a web service this purpose. The web service would also send back a reply.
For sake of simplicity I am using the Web Service available at: http://www.webservicex.net/length.asmx
REQUEST:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET/">
<soapenv:Header/>
<soapenv:Body>
<web:ChangeLengthUnit>
<web:LengthValue>100</web:LengthValue>
<web:fromLengthUnit>Inches</web:fromLengthUnit>
<web:toLengthUnit>Feet</web:toLengthUnit>
</web:ChangeLengthUnit>
</soapenv:Body>
</soapenv:Envelope>
RESPONSE:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ChangeLengthUnitResponse xmlns="http://www.webserviceX.NET/">
<ChangeLengthUnitResult>8.3333333333333339</ChangeLengthUnitResult>
</ChangeLengthUnitResponse>
</soap:Body>
</soap:Envelope>
From documentation, it seems that I can use CXF component for this purpose. However, I am not able to get clarity about the same. I am trying to build the route on the following lines:
from("cxf:http://www.webservicex.net/length.asmx?wsdlURL=http://www.webservicex.net/length.asmx?WSDL&dataFormat=MESSAGE")
.to("log:SOAPWSConsume?showAll=true&multiline=true&level=ERROR");
I have tried other options like serviceName, portName but have not been successful in invoking the same. An example of a error:
java.lang.AbstractMethodError: org.apache.crimson.tree.XmlDocument.setDocumentURI(Ljava/lang/String;)V
at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1125)
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:248)
So, my confusions (and hence queries) are:
# Do i need to generate client side stubs using the utilities like wsdl2java
# How can i provide the input parameters (like length, convert from, convert to)
# If I need to provide authentication information, how can i provide the username password.
A pointer to a working example would be of great help.
___________________
Thks & brgds
P Manchanda
Mobile: +91-9811210374