You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by David Jencks <da...@yahoo.com> on 2006/10/19 10:00:39 UTC

Where do all the protocols come from in the DestinationFactoryManager?

Working on the cxf-geronimo integration I finally convinced cxf to  
stop trying to create a jetty5 server by replacing all the registered  
destination factories in the DestinationFactoryManager:

         DestinationFactoryManager destinationFactoryManager =  
bus.getExtension(DestinationFactoryManager.class);
         DestinationFactory factory = new GeronimoDestinationFactory 
(bus);
         destinationFactoryManager.registerDestinationFactory("http:// 
cxf.apache.org/transports/http/configuration", factory);
         destinationFactoryManager.registerDestinationFactory("http:// 
www.w3.org/2003/05/soap/bindings/HTTP/", factory);
         destinationFactoryManager.registerDestinationFactory("http:// 
schemas.xmlsoap.org/soap/http", factory);
         destinationFactoryManager.registerDestinationFactory("http:// 
schemas.xmlsoap.org/wsdl/http/", factory);
         destinationFactoryManager.registerDestinationFactory("http:// 
schemas.xmlsoap.org/wsdl/soap/", factory);
         destinationFactoryManager.registerDestinationFactory("http:// 
schemas.xmlsoap.org/wsdl/soap/http", factory);
         destinationFactoryManager.registerDestinationFactory 
(XMLConstants.NS_XML_FORMAT, factory);
         EndpointImpl publishedEndpoint = publishEndpoint(target);
         destination = (GeronimoDestination)  
publishedEndpoint.getServer().getDestination();


(there were actually a couple others that don't seem to cause  
immediate problems)

geronimo is listening for http requests and feeding them into cxf,  
which seems to take over the function of the HTTPFactory that was  
previously registered, I have to wonder what the function of  
registering these protocols is, whether they all need to be  
registered, and if not how to prevent the jetty5 destination factory  
from being registered.

thanks
david jencks


Re: Where do all the protocols come from in the DestinationFactoryManager?

Posted by Dan Diephouse <da...@envoisolutions.com>.
Hi David,
These uris come from extension in the WSDL. You shouldn't have to 
register the "http://schemas.xmlsoap.org/wsdl/soap/" one as that is for 
the SoapDestinationFactory and also I don't think you should have to use 
XMLConstants.NS_XML_FORMAT.

The best way to prevent the jetty destination factory from being 
registered in your case is to override its registered namespaces as you 
have done.  You can see the namespaces that a transport is registered 
for in the cxf-extension.xml file in the module.

Hope that helps,
- Dan

David Jencks wrote:
> Working on the cxf-geronimo integration I finally convinced cxf to 
> stop trying to create a jetty5 server by replacing all the registered 
> destination factories in the DestinationFactoryManager:
>
>         DestinationFactoryManager destinationFactoryManager = 
> bus.getExtension(DestinationFactoryManager.class);
>         DestinationFactory factory = new GeronimoDestinationFactory(bus);
>         
> destinationFactoryManager.registerDestinationFactory("http://cxf.apache.org/transports/http/configuration", 
> factory);
>         
> destinationFactoryManager.registerDestinationFactory("http://www.w3.org/2003/05/soap/bindings/HTTP/", 
> factory);
>         
> destinationFactoryManager.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", 
> factory);
>         
> destinationFactoryManager.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/http/", 
> factory);
>         
> destinationFactoryManager.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", 
> factory);
>         
> destinationFactoryManager.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", 
> factory);
>         
> destinationFactoryManager.registerDestinationFactory(XMLConstants.NS_XML_FORMAT, 
> factory);
>         EndpointImpl publishedEndpoint = publishEndpoint(target);
>         destination = (GeronimoDestination) 
> publishedEndpoint.getServer().getDestination();
>
>
> (there were actually a couple others that don't seem to cause 
> immediate problems)
>
> geronimo is listening for http requests and feeding them into cxf, 
> which seems to take over the function of the HTTPFactory that was 
> previously registered, I have to wonder what the function of 
> registering these protocols is, whether they all need to be 
> registered, and if not how to prevent the jetty5 destination factory 
> from being registered.
>
> thanks
> david jencks
>


-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com
http://netzooid.com/blog


Re: Where do all the protocols come from in the DestinationFactoryManager?

Posted by Jiang Ning <ni...@iona.com>.
Hi David,

It is easy to stop jetty by remove the cxf-rt-transports-http jar from 
the class path.
Because CXF bus can load the extension module by look for the 
cxf-extension.xml in class path. The rt-core is using cxf-extension.xml 
which in the cxf-rt-transports-http jar to initiate the 
HTTPTransportFactory and register these namespace to 
DestinationFactoryManager as ActivationNamespaces.
These namespaces work as the transportId for HTTPTransportFactory to 
create related destination.

public Destination getDestination(EndpointInfo endpointInfo)
throws IOException {
JettyHTTPDestination destination = new JettyHTTPDestination(bus, this, 
endpointInfo);
Configurer configurer = bus.getExtension(Configurer.class);
if (null != configurer) {
configurer.configureBean(destination);
}
return destination;
}

public EndpointInfo(ServiceInfo serv, String ns) {
transportId = ns;
service = serv;
}

Chrees,

Willem.

David Jencks wrote:

> Working on the cxf-geronimo integration I finally convinced cxf to 
> stop trying to create a jetty5 server by replacing all the registered 
> destination factories in the DestinationFactoryManager:
>
> DestinationFactoryManager destinationFactoryManager = 
> bus.getExtension(DestinationFactoryManager.class);
> DestinationFactory factory = new GeronimoDestinationFactory (bus);
> destinationFactoryManager.registerDestinationFactory("http:// 
> cxf.apache.org/transports/http/configuration", factory);
> destinationFactoryManager.registerDestinationFactory("http:// 
> www.w3.org/2003/05/soap/bindings/HTTP/", factory);
> destinationFactoryManager.registerDestinationFactory("http:// 
> schemas.xmlsoap.org/soap/http", factory);
> destinationFactoryManager.registerDestinationFactory("http:// 
> schemas.xmlsoap.org/wsdl/http/", factory);
> destinationFactoryManager.registerDestinationFactory("http:// 
> schemas.xmlsoap.org/wsdl/soap/", factory);
> destinationFactoryManager.registerDestinationFactory("http:// 
> schemas.xmlsoap.org/wsdl/soap/http", factory);
> destinationFactoryManager.registerDestinationFactory 
> (XMLConstants.NS_XML_FORMAT, factory);
> EndpointImpl publishedEndpoint = publishEndpoint(target);
> destination = (GeronimoDestination) 
> publishedEndpoint.getServer().getDestination();
>
>
> (there were actually a couple others that don't seem to cause 
> immediate problems)
>
> geronimo is listening for http requests and feeding them into cxf, 
> which seems to take over the function of the HTTPFactory that was 
> previously registered, I have to wonder what the function of 
> registering these protocols is, whether they all need to be 
> registered, and if not how to prevent the jetty5 destination factory 
> from being registered.
>
> thanks
> david jencks
>
>


-- 
Willem Jiang
Software Engineer

IONA Asia Pacific Software Development Center
2/F, Unit A, Information Center
Zhongguancun Software Park Haidian District,
Beijing, P.R.China (100094)

Tel: +86-10-82825151 - 523
Fax: +86-10-82825210
Email: ning.jiang@iona.com