cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Can local:// and http:// addresses coexist on the same server
Date Tue, 17 Jun 2008 18:12:53 GMT

Two thoughts:

1) I don't think you should need to mess with the DestinationFactory  
and conduits and such.    The default setup may be fine depending on  
how you create your services/clients.    If you use two separate  
<jaxws:server> or <jaxws:endpoint> in your config, you can have one  
that specifies the bindingUri="http://cxf.apache.org/transports/local"  
to force that one on the local destination.   Likewise, if you use the  
client factories, you can specify which binding to use.  (make sure  
you use the correct address as well)

2) THAT all said, look at the in_jvm_transport sample in our  
release.   Basically, if you enable a "coloc" feature, it will pretty  
much be automatic.   The runtime will automatically detect if the  
client/server are using the same bus, it will just work.    I think  
the coloc also bypasses all marshalling (pass by reference symantics)  
which makes it faster as well.


Dan



On Jun 17, 2008, at 11:42 AM, Dan Dubinsky wrote:

>
> I have a web app with some services in the same war file that I want  
> to call
> using local://servicename. These same services I would like to be  
> able to
> call remotely using http://server/webapp/services/servicename from  
> external
> applications. This worked out of the box in XFire, but I'm having  
> trouble
> getting it to work is CFX.
>
> If I add the following to my servlet serving up the services then  
> local
> works, but http doesn't. If I take it out http works, but not local.
>
> DestinationFactoryManager dfm =
> bus.getExtension(DestinationFactoryManager.class);
> LocalTransportFactory localTransport = new LocalTransportFactory();
> dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http",
> localTransport);
> dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http 
> ",
> localTransport);
> dfm.registerDestinationFactory("http://cxf.apache.org/bindings/ 
> xformat",
> localTransport);
> dfm.registerDestinationFactory("http://cxf.apache.org/transports/ 
> local",
> localTransport);
>
> ConduitInitiatorManager extension =
> bus.getExtension(ConduitInitiatorManager.class);
> extension.registerConduitInitiator("http://cxf.apache.org/transports/local 
> ",
> localTransport);
> extension.registerConduitInitiator("http://schemas.xmlsoap.org/wsdl/soap/http 
> ",
> localTransport);
> extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/http 
> ",
> localTransport);
> extension.registerConduitInitiator("http://cxf.apache.org/bindings/xformat 
> ",
> localTransport);
>
> The error I get if I take this out and try an http call is:
>
> java.lang.IllegalStateException: Local destination does not have a
> MessageObserver on address http://server/webapp/services/servicename
> -- 
> View this message in context: http://www.nabble.com/Can-local%3A---and-http%3A---addresses-coexist-on-the-same-server-tp17916451p17916451.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog





Mime
View raw message