I'm trying to consume web service using setHeader component. *My main goal
here is not to write any java code and directly call the method with
arguments.* As well I'm very much new to camel tools. So I would really
expect your suggestion more. Please help me out in understanding and
executing my task. I'll share all the sample works which I've done.


camel-context.xml
<cxf:cxfEndpoint id="callCXF" address="http://localhost:1101/CustomDetails"; 
        serviceClass="com.webservice.CustomerMethod"
        serviceName="s:getHelloWorldMessage" xmlns:s="http://webservice.com";>
                <cxf:properties>
                        <entry key="dataFormat" value="POJO" />
                </cxf:properties>
        </cxf:cxfEndpoint>


        <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring";
trace="true">
                <route>
                        <from uri="timer://foo?period=6000" />
                        <setHeader headerName="getHelloWorldMessage">
                                <simple>Hi</simple>
                        </setHeader>
                        <to uri="cxf:bean:callCXF" />
                        <log message=">>> data is : ${body}" />
                </route>
        </camelContext>

WSDL file:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:tns="http://www.springframework.org/schema/beans";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:ns2="http://schemas.xmlsoap.org/soap/http";
xmlns:ns1="http://webservice.com/"; name="CustomerMethod"
targetNamespace="http://www.springframework.org/schema/beans";>
  <wsdl:import
location="http://localhost:1101/CustomDetails?wsdl=CustomerMethod.wsdl";
namespace="http://webservice.com/";>
    </wsdl:import>
  <wsdl:binding name="CustomerMethodSoapBinding" type="ns1:CustomerMethod">
    <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getHelloWorldMessage">
      <soap:operation soapAction="" style="rpc"/>
      <wsdl:input name="getHelloWorldMessage">
        <soap:body namespace="http://webservice.com/"; use="literal"/>
      </wsdl:input>
      <wsdl:output name="getHelloWorldMessageResponse">
        <soap:body namespace="http://webservice.com/"; use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="getNameAddPhnNo">
      <soap:operation soapAction="" style="rpc"/>
      <wsdl:input name="getNameAddPhnNo">
        <soap:body namespace="http://webservice.com/"; use="literal"/>
      </wsdl:input>
      <wsdl:output name="getNameAddPhnNoResponse">
        <soap:body namespace="http://webservice.com/"; use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="getCustomerID">
      <soap:operation soapAction="" style="rpc"/>
      <wsdl:input name="getCustomerID">
        <soap:body namespace="http://webservice.com/"; use="literal"/>
      </wsdl:input>
      <wsdl:output name="getCustomerIDResponse">
        <soap:body namespace="http://webservice.com/"; use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="CustomerMethod">
    <wsdl:port binding="tns:CustomerMethodSoapBinding" name="SOAPOverHTTP">
      <soap:address location="http://localhost:1101/CustomDetails"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>





--
View this message in context: 
http://camel.465427.n5.nabble.com/Consume-CXF-Web-service-using-setHeader-or-anyway-without-using-JAVA-code-Error-tp5752533.html
Sent from the Camel Development mailing list archive at Nabble.com.

Reply via email to