i see, in fact this approach need write your codes to send operation and
params to call the webservice that was defined in cxf:cxfEndpoint. it cant
be completed work only through config file. the cxfEndpoint don't work until
receive a message-driven that is a request SOAP msg. 
i think, it is the best and simplest approach to call the webservice only
through HTTP endpoint.  



willem.jiang wrote:
> 
> The parameters are put into the message body, you can find the example 
> here[1]
> 
> [1] 
> http://camel.apache.org/cxf.html#CXF-HowtopreparethemessageforthecamelcxfendpointinPOJOdataformat
> 
> Willem
> 
> StonePeng wrote:
>> but where can i set the params of the operation
>> 
>> 
>> willem.jiang wrote:
>>> Hey,
>>>
>>> You just need to change the <constant> part which your operation name.
>>>
>>> Willem
>>> StonePeng wrote:
>>>> thanks, usha Kanteti:
>>>> in my use case ,i want to config the operation name and its param in
>>>> xml
>>>> instead of writing soap msg by hand,how can i do it in cxfEndpoint xml
>>>> or
>>>> camelContext xml?  
>>>> where can i set these contents? 
>>>> <setHeader headerName="operationName">  
>>>> <constant>myOperation</constant>  
>>>> </setHeader> 
>>>> in the above xml, is the content of "headerName" operation name? and is
>>>> the
>>>> content of "constant" params? 
>>>>  
>>>>  
>>>>
>>>>
>>>> usha Kanteti wrote:
>>>>> I use camel 2.2 and I read it somewhere that it can be done in the
>>>>> following way
>>>>>
>>>>> <cxf:cxfEndpoint id="myWSEndpoint"
>>>>>   wsdlURL="META-INF/wsdl/your.wsdl"
>>>>>   address="${my.domain.service.url}"
>>>>>   endpointName=""
>>>>>   serviceName=""
>>>>>   xmlns:s="urn:...:wsdl" >        
>>>>>   
>>>>>   <cxf:properties> 
>>>>>           <entry key="dataFormat" value="MESSAGE"/> 
>>>>>   </cxf:properties>
>>>>> </cxf:cxfEndpoint>
>>>>>
>>>>>
>>>>> <camelContext id="MyCamelContext"
>>>>>         xmlns="http://activemq.apache.org/camel/schema/spring";>
>>>>>         <route>
>>>>>                 <from uri="activemq:queue/my/Queue" />
>>>>>                
>>>>>               <setHeader headerName="operationName">
>>>>>                         <constant>myOperation</constant>
>>>>>                 </setHeader>
>>>>>                 <to uri="cxf:bean:myWSEndpoint" />
>>>>>         </route>
>>>>> </camelContext>
>>>>>
>>>>>
>>>>> But the way I am doing is 
>>>>>
>>>>> 1) created a mockservice against the WSDL in soapUI 
>>>>> 2) then we will see all the operations supported by that web-service
>>>>> in
>>>>> soapUI with request object for each operation.
>>>>> 3)when you are calling webservice, construct the request object in a
>>>>> similar way (done in soapUI), then we don't need to specify operation
>>>>> name
>>>>> etc. ( we can ignore the <setHeader> tags )
>>>>>
>>>>>
>>>>>
>>>>> willem.jiang wrote:
>>>>>> Hi,
>>>>>>
>>>>>> CAMEL-2780 addressed this issue by introducing a defaultOperationName 
>>>>>> option for you.
>>>>>> It's a new to camel 2.4.0, please feel free to try out the latest
>>>>>> camel 
>>>>>> 2.4-SNAPSHOT for it.
>>>>>>
>>>>>> [1]https://issues.apache.org/activemq/browse/CAMEL-2780
>>>>>>
>>>>>> Willem
>>>>>>
>>>>>> StonePeng wrote:
>>>>>>> what is the answer about this question. i want to ask the same
>>>>>>> question,
>>>>>>> help
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> usha Kanteti wrote:
>>>>>>>> Hi Ashwin,
>>>>>>>>   Is there anywhere to specify ( to call specific method of
>>>>>>>> web-service)  
>>>>>>>> like operationName="sayHello" in the following <cxf:Endpoint tag.
>>>>>>>>
>>>>>>>> That's what my question is. 
>>>>>>>>
>>>>>>>> <cxf:Endpoint id="myEndpoint" 
>>>>>>>> address="http://localhost:8080/someService/";
>>>>>>>> wsdlURL="../sr-binding/src/main/resources/META-INF/wsdl/someservice.wsdl"
>>>>>>>>  
>>>>>>>> endpointName="s:myEndpointName"
>>>>>>>> serviceName="s:myService"
>>>>>>>> operationName="s:sayHello"
>>>>>>>> xmlns:s="urn:some:company:some:service:wsdl" >
>>>>>>>> <cxfroperties>
>>>>>>>> <entry key="dataFormat" value="MESSAGE"/>
>>>>>>>> </cxfroperties>
>>>>>>>> </cxf:cxfEndpoint>
>>>>>>>>
>>>>>>>> if we can't it that way, can we specify the method name at routing
>>>>>>>> time
>>>>>>>> before we send the request message to the "myEndpoint" in the
>>>>>>>> following
>>>>>>>> code 
>>>>>>>>
>>>>>>>> <route>
>>>>>>>>     <from uri="jms:queue:..." />
>>>>>>>>      <to   uri="cxf:bean:myEndpoint" /> 
>>>>>>>> </route>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Ashwin Karpe wrote:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> You do need to create a client to invoke on the CXF endpoint and
>>>>>>>>> send
>>>>>>>>> a
>>>>>>>>> SOAP payload that can be used to call your method described in
>>>>>>>>> WSDL.
>>>>>>>>>
>>>>>>>>> If you do not want to write a client you could use a tool like
>>>>>>>>> SoapUI
>>>>>>>>> to
>>>>>>>>> do this for you (since you already have the WSDL).
>>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>>
>>>>>>>>> Ashwin...
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> usha K. wrote:
>>>>>>>>>>  I have the following cxfEndpoint configuration in the
>>>>>>>>>> camel-context.xml
>>>>>>>>>> which is a webservice end point, pointing to a 3rd party web
>>>>>>>>>> service.
>>>>>>>>>>
>>>>>>>>>>  I am wondering how I can specify (in this configuration) an
>>>>>>>>>> operation
>>>>>>>>>> with parameters to be passed to the webservice? As an example, I
>>>>>>>>>> need
>>>>>>>>>> to
>>>>>>>>>> invoke the operation sayHello() in that webservice, passing two
>>>>>>>>>> parameters (firstName, lastName).
>>>>>>>>>>
>>>>>>>>>>  Can I do that in the cxfEndPoint itself? If so, how? Also, how
>>>>>>>>>> can
>>>>>>>>>> I
>>>>>>>>>> pass the values itself?
>>>>>>>>>>
>>>>>>>>>> <cxf:cxfEndpoint id="myEndpoint" 
>>>>>>>>>> address="http://localhost:8080/someService/";
>>>>>>>>>> wsdlURL="../sr-binding/src/main/resources/META-INF/wsdl/someservice.wsdl"
>>>>>>>>>>  
>>>>>>>>>> endpointName="s:myEndpointName"
>>>>>>>>>> serviceName="s:myService"
>>>>>>>>>> xmlns:s="urn:some:company:some:service:wsdl" >
>>>>>>>>>> <cxfroperties>
>>>>>>>>>> <entry key="dataFormat" value="MESSAGE"/>
>>>>>>>>>> </cxfroperties>
>>>>>>>>>> </cxf:cxfEndpoint>
>>>>>>>>>>
>>>>>>>>>> OR do I have to write a client code on my side (where this end
>>>>>>>>>> point
>>>>>>>>>> points to)?
>>>>>>>>>>
>>>>>>
>>>
>>>
>> 
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/How-to-invoke-specific-operation-with-params-for-cxf-webservice-endpoint-through-configuration-tp28023138p28840157.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to