Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: LocalTransportFactory need to register to the bus with the default soap transportURI

...

Or with XML:

Code Block
xml
xml
<beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:simple="http://cxf.apache.org/simple"
      xmlns:soap="http://cxf.apache.org/bindings/soap"
      xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd
http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd">

  <import resource="classpath:META-INF/cxf/cxf.xml"/>
  <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
    
  <bean class="org.apache.cxf.transport.local.LocalTransportFactory" lazy-init="false">
      <property name="transportIds">
          <list>
              <value>http://cxf.apache.org/transports/local</value>
              <value>http://schemas.xmlsoap.org/soap/http</value>
              <value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
          </list>
      </property>
  </bean>
  
  <jaxws:endpoint name="helloWorld" address="local://hello" implementor="org.example.HelloServiceImpl"/>

</beans>

Simple Frontend

Before you use the local transport , you need to register the default soap transportURI with the local transport factory in the bus

Code Block
java
java

Bus bus = BusFactory.getDefaultBus();
DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
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/transports/local", localTransport);

You can also pass in a local:// address to the server and client factory beans:

...