Hi Charles,

I got your point. I just want suggest to wrap the configurations or the
application relates staffs to a bundle. You can share the camel and cxf
bundles with different applications. Let me answer the questions now :).

First camel-cxf endpoint will not instantiate the serviceClass,since it
has its own camel invoker to delegate the request to a Camel processor
chain. camel-cxf endpoint just uses the serviceClass to build up the
service model. But for CXF, if you just specify a serviceClass, cxf will
try to instantiate it by a bean invoker if the implementor is not set.

Second you can set the implementor with a bean reference to the
jaxws:endpoint, in this case, CXF will set the serviceClass as the type
class of implementor. So the serviceClass should always be a Class, it
can't be a bean's reference.
Here is a problem that people always use the Spring AOP to wrap the an
implementor. In this case, CXF can't get the right type class from the
implementor instance, so we add a implementorClass attribute in
jaxws:endpoint to get around this issue.

Willem

cmoulliard wrote:
> Hi Willem,
> 
> This is an interesting question regarding the fact that when we use
> webservice technology like Apache CXF, Spring Web Services or Glassfish
> Metro the implementation of the service is closely related to the framework
> used to generate it and how the service will be exposed as webservice
> (cxf:cxfendpoint, jaws:endpoint, ...).
> 
> In consequence, as you mention, this service should be packaged in the same
> bundle/jar as the framework exposing it as a webservice. From this point of
> view, you are right. But, imagine, that the implementation is different from
> client to client and that Camel cxf:cxfendpoint never changes. In this case,
> you will be oblige to repackage your camel jar/bundle in order to deploy it
> at the client side. 
> 
> Question : 
> - Is it the cxf endpoint who will instantiate the serviceClass
> (org.apache.camel.example.reportincident.ReportIncidentImpl) ?
> - Why can't we use a bean reference for the serviceClass ?
> 
> KR,
> 
> Charles 
> 
> 
> willem.jiang wrote:
>> Hi Charles,
>>
>> Could you treat the route rule as a part of service layer ?
>> In this way , the xml configuration is in the same layer of service.
>> So you will not get into the trouble of reference the service class in
>> the route file.
>>
>> Willem
>>
>> cmoulliard wrote:
>>> Hi Willem,
>>>
>>> What I would like to do is to separate in a different OSGI bundle the
>>> service layer from the Camel layer. In my head, the service layer covers
>>> the
>>> implementation of the Webservice. So, in Camel, I would like to inject
>>> the
>>> implementation of the service through a interface that I retrieve from
>>> the
>>> service OSGI bundle deployed on a Spring DM server.
>>>
>>> KR,
>>>
>>> Charles
>>>
>>>
>>>
>>> willem.jiang wrote:
>>>> Hi
>>>>
>>>> For the camel-cxf endpoint, we don't want to invoke the implementor
>>>> instance, we delegate the implementor invocation to a camel process
>>>> chain. I don't know why you want to inject an OSGI bundle service into
>>>> the camel-cxf endpoint.
>>>> Since cxf uses the ServiceClass to build the service model, you can set
>>>> the serviceClass with a hardcoded interface name.
>>>>
>>>> Willem
>>>>
>>>>
>>>> cmoulliard wrote:
>>>>> Hi,
>>>>>
>>>>> Is there a way to inject from an OSGI reference the service to be used
>>>>> to
>>>>> process the webservice in cxf:cxfendpoint of Camel ?
>>>>>
>>>>> ex :
>>>>>
>>>>> Using the following syntax, it is possible to inject the OSGI bundle
>>>>> service
>>>>> to the jaws:endpoint of cxf
>>>>>
>>>>>  <osgi:reference id="reportIncidentEndpoint"
>>>>> interface="org.apache.camel.example.reportincident.ReportIncidentService"/>
>>>>>
>>>>> <!-- export the webservice using jaxws -->
>>>>> <jaxws:endpoint id="reportIncident"
>>>>> implementor="#reportIncidentEndpoint"
>>>>> address="/incident"
>>>>> wsdlLocation="/WEB-INF/wsdl/report_incident.xml"
>>>>> endpointName="s:ReportIncidentPort"
>>>>> serviceName="s:ReportIncidentService"
>>>>> xmlns:s="http://reportincident.example.camel.apache.org"/>
>>>>>
>>>>> but with cxf:cxfendpoint, I don't think so ?
>>>>>
>>>>>     <cxf:cxfEndpoint id="reportIncident" address="/incident"
>>>>> wsdlURL="/WEB-INF/wsdl/report_incident.xml"
>>>>>                     
>>>>> serviceClass="org.apache.camel.example.reportincident.ReportIncidentImpl"
>>>>>                      endpointName="s:ReportIncidentPort"
>>>>>                      serviceName="s:ReportIncidentService" 
>>>>>                     
>>>>> xmlns:s="http://reportincident.example.camel.apache.org";
>>>>>         />
>>>>>
>>>>> With cxf:cxfendpoint, the serviceClass is hardcoded and it is not
>>>>> possible
>>>>> to provide a bean reference.
>>>>>
>>>>> KR,
>>>>>
>>>>> Charles Moulliard
>>>>>
>>>>>
>>>>>
>>>>> -----
>>>>> Enterprise Architect
>>>>>
>>>>> Xpectis
>>>>> 12, route d'Esch
>>>>> L-1470 Luxembourg
>>>>>
>>>>> Phone +352 25 10 70 470
>>>>> Mobile +352 621 45 36 22
>>>>>
>>>>> e-mail : [EMAIL PROTECTED]
>>>>> web site :  www.xpectis.com www.xpectis.com 
>>>>> My Blog :  http://cmoulliard.blogspot.com/
>>>>> http://cmoulliard.blogspot.com/  
>>>>
>>>
>>> -----
>>> Enterprise Architect
>>>
>>> Xpectis
>>> 12, route d'Esch
>>> L-1470 Luxembourg
>>>
>>> Phone +352 25 10 70 470
>>> Mobile +352 621 45 36 22
>>>
>>> e-mail : [EMAIL PROTECTED]
>>> web site :  www.xpectis.com www.xpectis.com 
>>> My Blog :  http://cmoulliard.blogspot.com/
>>> http://cmoulliard.blogspot.com/  
>>
>>
> 
> 
> -----
> Charles Moulliard
> SOA Architect
> 
> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  

Reply via email to