You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Ryan Moquin <fr...@gmail.com> on 2008/01/08 06:11:25 UTC

Is there a way to create a cxf service proxy without referencing cxfse?

Basically I created a servicemix-bean SU to create some services that will
be invoked using a quartz timer and send messages to a service with a cxf
front end.  I know you can create a proxy to a cxf service from another
service using the cxfse:proxy tag, but this won't work unless the service
using the proxy is also a cxf service. Is I want to communication from a
servicemix-bean component to a cxf service, can I just use the servicemix
client and send xml content that represents one of my cxf request objects?
I guess I'm not sure what the cxf proxy does that would be different than
what using a servicemixclient would do?  Is it just that the proxy
automatically knows how to serialize the requests to send?

Re: Is there a way to create a cxf service proxy without referencing cxfse?

Posted by Ryan Moquin <fr...@gmail.com>.
So is just doing this enough:

QName port = new QName(namespace, portName);
        QName service = new QName(namespace, serviceName);
        JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
        cf.setServiceName(service);
        cf.setServiceClass(serviceClass);
        cf.setAddress("jbi://" + new IdGenerator().generateSanitizedId());
        cf.setBindingId(
org.apache.cxf.binding.jbi.JBIConstants.NS_JBI_BINDING);
        Bus bus = BusFactory.getDefaultBus();
        JBITransportFactory jbiTransportFactory = (JBITransportFactory)
          bus.getExtension(ConduitInitiatorManager.class
).getConduitInitiator(
          CxfSeComponent.JBI_TRANSPORT_ID);
        jbiTransportFactory.setDeliveryChannel(getChannel());

        JaxWsClientProxy proxy = (JaxWsClientProxy) cf.create();

There is so much other stuff that the cxf service is doing that I'm not
completely sure that this is enough?  I just wish I could inject a
servicemix cxf proxy into a servicemix-bean component.  I guess there is no
way to communicate with the cxf service itself without using the proxy and
moving the associated servicemix code inyo my servicemix-bean beans?   I
didn't seem to have much luck trying to use the dispatch client to do it.

Makes me wonder why anyone would want to bother using the cxf component if
it's difficult to talk to it in any way other than using the external
binding and cxf generated classes or by using a cxf service with an injected
proxy.  I'm not sure why non-cxf services would have difficulty talking to
it?

Ryan

On Jan 8, 2008 12:31 AM, Freeman Fang <fr...@iona.com> wrote:

> Hi Ryan,
> Yes, there should be a way to do it,
> If you want to use cxf proxy without referencing cxfse, just refer to
> how we create cxf proxy in CxfSeProxyFactoryBean.java[1], especially the
> createProxy method.
> If you want to send xml content directly, maybe you need use jaxws
> dispatch client, [2] for more details
>
>
> [1]http://svn.apache.org/repos/asf/servicemix/smx3/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeProxyFactoryBean.java
> [2]http://cwiki.apache.org/CXF20DOC/dispatch-clients.html
>
> Best Regards
>
> Freeman
> Ryan Moquin wrote:
> > Basically I created a servicemix-bean SU to create some services that
> will
> > be invoked using a quartz timer and send messages to a service with a
> cxf
> > front end.  I know you can create a proxy to a cxf service from another
> > service using the cxfse:proxy tag, but this won't work unless the
> service
> > using the proxy is also a cxf service. Is I want to communication from a
> > servicemix-bean component to a cxf service, can I just use the
> servicemix
> > client and send xml content that represents one of my cxf request
> objects?
> > I guess I'm not sure what the cxf proxy does that would be different
> than
> > what using a servicemixclient would do?  Is it just that the proxy
> > automatically knows how to serialize the requests to send?
> >
> >
>

Re: Is there a way to create a cxf service proxy without referencing cxfse?

Posted by Freeman Fang <fr...@iona.com>.
Hi Ryan,
Yes, there should be a way to do it,
If you want to use cxf proxy without referencing cxfse, just refer to 
how we create cxf proxy in CxfSeProxyFactoryBean.java[1], especially the 
createProxy method.
If you want to send xml content directly, maybe you need use jaxws 
dispatch client, [2] for more details

[1]http://svn.apache.org/repos/asf/servicemix/smx3/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeProxyFactoryBean.java
[2]http://cwiki.apache.org/CXF20DOC/dispatch-clients.html

Best Regards

Freeman
Ryan Moquin wrote:
> Basically I created a servicemix-bean SU to create some services that will
> be invoked using a quartz timer and send messages to a service with a cxf
> front end.  I know you can create a proxy to a cxf service from another
> service using the cxfse:proxy tag, but this won't work unless the service
> using the proxy is also a cxf service. Is I want to communication from a
> servicemix-bean component to a cxf service, can I just use the servicemix
> client and send xml content that represents one of my cxf request objects?
> I guess I'm not sure what the cxf proxy does that would be different than
> what using a servicemixclient would do?  Is it just that the proxy
> automatically knows how to serialize the requests to send?
>
>