So close now...I'd greatly appreciate how I can express the below code in
Spring context file:
Bus bus = BusFactory.getDefaultBus();
MyTransportTransportFactory MyTransportTransport = new
MyTransportTransportFactory();
DestinationFactoryManager destinationFactoryManager =
bus.getExtension(DestinationFactoryManager.class);
destinationFactoryManager.registerDestinationFactory("http://acme.com/transports/MyTransport",
MyTransportTransport);
ConduitInitiatorManager conduitInitiatorMgr =
bus.getExtension(ConduitInitiatorManager.class);
conduitInitiatorMgr.registerConduitInitiator("http://acme.com/transports/MyTransport",
MyTransportTransport);
I have the following XMLs (modeled after JMS transport) in my jar, but I am
missing something as my transport is not actually registered with CXF.
MyTransport:META-INF/cxf/bus-extensions.xml
<?xml version="1.0" encoding="UTF-8"?>
<extensions xmlns="http://cxf.apache.org/bus/extension">
<extension
class="com.acme.transports.MyTransport.MyTransportTransportFactory"
deferred="true">
<namespace>http://acme.com/transports/MyTransport</namespace>
<namespace>http://acme.com/transports/MyTransport/configuration</namespace>
</extension>
</extensions>
MyTransport:META-INF/cxf/cxf-extension-mytransport.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:foo="http://cxf.apache.org/configuration/foo"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="com.acme.transports.MyTransport"
class="com.acme.transports.MyTransport.MyTransportTransportFactory"
lazy-init="true">
<property name="bus" ref="cxf"/>
<property name="transportIds">
<list>
<value>http://acme.com/transports/MyTransport</value>
<value>http://acme.com/transports/MyTransport/configuration</value>
</list>
</property>
</bean>
</beans>
MyTransport:META-INF/cxf/cxf.extension
META-INF/cxf/cxf-extension-mytransport.xml
----- Original Message ----
From: Coder One <[email protected]>
To: [email protected]
Sent: Wed, January 13, 2010 10:28:46 PM
Subject: Re: CXF & Spring & Custom Transport Setup
Found the needle in the haystack :)
DestinationFactoryManager dfManager =
bus.getExtension(DestinationFactoryManager.class);
// Find a DestinationFactory for the SOAP HTTP transport
DestinationFactory df =
dfManager.getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http");
// TODO: outline building of EndpointInfo
EndpointInfo endpointInfo = ...;
Destination destination = df.getDestination(endpointInfo);
----- Original Message ----
From: Coder One <[email protected]>
To: [email protected]
Sent: Wed, January 13, 2010 8:27:55 PM
Subject: Re: CXF & Spring & Custom Transport Setup
Back to basics...I removed Spring from the equation for now and used the
example below to get my custom transport going. I got the client-end "Conduit"
going with my custom stuff, but not the server-end "Destination". The example
does not show how to get "dfm". All help greatly appreciated....
http://cxf.apache.org/docs/local-transport.html
The below is from the above link...
Bus bus = BusFactory.getDefaultBus();
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);
----- Original Message ----
From: Daniel Kulp <[email protected]>
To: [email protected]
Cc: Coder One <[email protected]>
Sent: Wed, January 13, 2010 12:51:53 PM
Subject: Re: CXF & Spring & Custom Transport Setup
On Wed January 13 2010 2:26:22 pm Coder One wrote:
> Can you help me with a snippet on 1 and 2?
>
> Somethign like the below?
>
> <wsdl:port name="StockQuoteServicePort"
> binding="sqi:MyTransportBinding">
>
> <soap:binding style="document" transport=http://acme.com/myTransport/>
That looks right, yea.
Dan
>
>
> Thanks
>
>
>
> ----- Original Message ----
> From: Daniel Kulp <[email protected]>
> To: [email protected]
> Cc: Coder One <[email protected]>
> Sent: Mon, January 11, 2010 1:21:54 PM
> Subject: Re: CXF & Spring & Custom Transport Setup
>
> On Mon January 11 2010 3:20:10 am Coder One wrote:
> > I went through the links provided and the JMS transport links below, but
> > I am still hazy on how in Spring do I choose to use my custom Conduit and
> > custom Destination. That is, where do I tell CXF to invoke my custom
> > transport factory to grab my custom Conduit and Destination? I probably
> > need to re-read the fine manual :), but would appreciate all pointers...
> >
> > http://cxf.apache.org/docs/jms-transport.html
> > http://cxf.apache.org/docs/using-the-jmsconfigfeature.html
>
> There are a few ways to do it:
>
> 1) wsdl first: the namespace of the first extensor element of the
> soap:port in the service controls the transport. Thus, put an extensor
> using the namespace you registered for your transport.
>
> 2) If the extensor in (1) is the soap:address, then the transport URI on
> the soap:binding element in the binding section should map to your
> transports namespace.
>
> 3) If all that fails, I think it checks the scheme on the url in the
> soap:address. Thus, if you have :
> <soap:address location="foo://blah.blah/"/>
> It iterates over the transport to find the transport that claims to support
> the "foo" protocol.
>
> Dan
>
> > The XSD for included JMS has a reference to JAXB, but I am using AEGIS,
> > would I need to change to AEGIS?
> >
> > http://cxf.apache.org/schemas/configuration/jms.xsd
> >
> > Thanks,
> >
> >
> >
> > ----- Original Message ----
> > From: Daniel Kulp <[email protected]>
> > To: [email protected]
> > Cc: Coder One <[email protected]>
> > Sent: Tue, January 5, 2010 9:10:40 AM
> > Subject: Re: CXF & Spring & Custom Transport Setup
> >
> >
> >
> > The easiest is to just look at one of the existing transports:
> >
> > http://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes/rt/transports/jm
> >s/ src/main/resources/META-INF/cxf/cxf-extension-jms.xml
> >
> > http://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes/rt/transports/lo
> >ca l/src/main/resources/META-INF/cxf/cxf-extension-local.xml
> >
> > Etc....
> >
> >
> > Dan
> >
> > On Mon January 4 2010 6:46:47 pm Coder One wrote:
> > > Hi,
> > >
> > > I am about to test integrate our custom transport (Conduit/Destination)
> > > with CXF 2.2.5 and Spring 2.5.6. I'd appreciate all pointers to
> > > docs/source sample on how to setup a Spring context file to hook inour
> > > custom Conduit and Destination implementation.
> > >
> > > Thanks,
>
--
Daniel Kulp
[email protected]
http://www.dankulp.com/blog