[
https://issues.apache.org/activemq/browse/CAMEL-1254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=48786#action_48786
]
William Tam commented on CAMEL-1254:
------------------------------------
I made serviceClass=#bean to work in 2.0. (2.0 camel-cxf code is quite
different now) Basically, I added a setter in CxfEndpoint that takes object
type of "Object" and read the class out of it.
{code}
public void setServiceClass(Object instance) {
serviceClass = instance.getClass().getName();
}
{code}
I haven't done a lot of testing but I did update the test.
{code}
public void testGetServiceClass() throws Exception {
CxfEndpoint endpoint =
createEndpoint("cxf:bean:helloServiceEndpoint?serviceClass=#helloServiceImpl");
assertEquals("org.apache.camel.component.cxf.HelloServiceImpl",
endpoint.getServiceClass());
}
{code}
There is one thing worth pointing out. The producer endpoint requires service
class to be an interface (due to proxy client factory bean) so I don't know if
being able to set service class instance is very useful. I guess we can
revisit using proxy client factory bean.
I didn't port the serviceClassRef option to the 2.0 camel-cxf refactoring since
we can do it with # notation.
> camel-cxf: URI option for serviceClass does not support lookup in registry
> --------------------------------------------------------------------------
>
> Key: CAMEL-1254
> URL: https://issues.apache.org/activemq/browse/CAMEL-1254
> Project: Apache Camel
> Issue Type: Improvement
> Components: camel-cxf
> Affects Versions: 1.5.0
> Reporter: Claus Ibsen
> Assignee: William Tam
> Priority: Minor
>
> Having an endpoint such as:
> {code}
> String cxfEndpoint =
> "cxf://http://localhost:8080/part-five/webservices/incident"
> +
> "?serviceClass=org.apache.camel.example.reportincident.ReportIncidentEndpoint"
> + "&wsdlURL=report_incident.wsdl";
> {code}
> The serviceClass option currently only supports defining a FQN for the class.
> I think we need to support Registry lookup as well using the # notation. So
> you can do:
> {code}
> String cxfEndpoint =
> "cxf://http://localhost:8080/part-five/webservices/incident"
> + "?serviceClass=#reportService"
> + "&wsdlURL=report_incident.wsdl";
> {code}
> And then have it defined in Spring XML:
> {code}
> <bean id="reportService" class="...">
> {code}
> The # notation is already supported if you use the cxf Spring XML
> configuration. We need this in the Java DSL as well.
> Sorry if it already exists. But I got a hint from a Camel end user that it
> didn't
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.