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.