use of org.apache.cxf.transport.DestinationFactoryManager in project cxf by apache.
the class SpringBusFactoryTest method testKnownExtensions.
@Test
public void testKnownExtensions() throws BusException {
Bus bus = new SpringBusFactory().createBus();
assertNotNull(bus);
checkBindingExtensions(bus);
DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
assertNotNull("No destination factory manager", dfm);
ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
assertNotNull("No conduit initiator manager", cim);
checkTransportFactories(bus);
checkOtherCoreExtensions(bus);
// you should include instumentation extenstion to get the instrumentation manager
assertNotNull("No instrumentation manager", bus.getExtension(InstrumentationManager.class));
bus.shutdown(true);
}
use of org.apache.cxf.transport.DestinationFactoryManager in project cxf by apache.
the class SpringBusFactoryTest method checkHTTPTransportFactories.
private void checkHTTPTransportFactories(Bus bus) throws BusException {
ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
assertNotNull("No conduit initiator manager", cim);
assertNotNull("conduit initiator not available", cim.getConduitInitiator("http://schemas.xmlsoap.org/wsdl/soap/http"));
assertNotNull("conduit initiator not available", cim.getConduitInitiator("http://schemas.xmlsoap.org/wsdl/http/"));
assertNotNull("conduit initiator not available", cim.getConduitInitiator("http://cxf.apache.org/transports/http/configuration"));
DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
assertNotNull("No destination factory manager", dfm);
assertNotNull("destination factory not available", dfm.getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/"));
assertNotNull("destination factory not available", dfm.getDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http"));
assertNotNull("destination factory not available", dfm.getDestinationFactory("http://schemas.xmlsoap.org/wsdl/http/"));
assertNotNull("destination factory not available", dfm.getDestinationFactory("http://cxf.apache.org/transports/http/configuration"));
}
use of org.apache.cxf.transport.DestinationFactoryManager in project cxf by apache.
the class MtomServerTest method servStatic.
/**
* Serve static file
*/
private void servStatic(final URL resource, final String add) throws Exception {
Bus bus = getStaticBus();
DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
DestinationFactory df = dfm.getDestinationFactory("http://cxf.apache.org/transports/http/configuration");
EndpointInfo ei = new EndpointInfo();
ei.setAddress(add);
Destination d = df.getDestination(ei, bus);
d.setMessageObserver(new MessageObserver() {
public void onMessage(Message message) {
try {
// HTTP seems to need this right now...
ExchangeImpl ex = new ExchangeImpl();
ex.setInMessage(message);
Conduit backChannel = message.getDestination().getBackChannel(message);
MessageImpl res = new MessageImpl();
ex.setOutMessage(res);
res.put(Message.CONTENT_TYPE, "text/xml");
backChannel.prepare(res);
OutputStream out = res.getContent(OutputStream.class);
InputStream is = resource.openStream();
IOUtils.copy(is, out, 2048);
out.flush();
out.close();
is.close();
backChannel.close(res);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
use of org.apache.cxf.transport.DestinationFactoryManager in project cxf by apache.
the class MtomServerTest method unregisterServStatic.
private void unregisterServStatic(String add) throws Exception {
Bus bus = getStaticBus();
DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
DestinationFactory df = dfm.getDestinationFactory("http://cxf.apache.org/transports/http/configuration");
EndpointInfo ei = new EndpointInfo();
ei.setAddress(add);
Destination d = df.getDestination(ei, bus);
d.setMessageObserver(null);
}
use of org.apache.cxf.transport.DestinationFactoryManager in project cxf by apache.
the class AbstractSimpleFrontendTest method setUp.
@Before
public void setUp() throws Exception {
super.setUpBus();
Bus bus = getBus();
SoapBindingFactory bindingFactory = new SoapBindingFactory();
bus.getExtension(BindingFactoryManager.class).registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", bindingFactory);
DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
SoapTransportFactory soapTF = new SoapTransportFactory();
dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapTF);
dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapTF);
LocalTransportFactory localTransport = new LocalTransportFactory();
localTransport.getUriPrefixes().add("http");
dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
ConduitInitiatorManager extension = bus.getExtension(ConduitInitiatorManager.class);
extension.registerConduitInitiator(LocalTransportFactory.TRANSPORT_ID, localTransport);
extension.registerConduitInitiator("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/http", localTransport);
extension.registerConduitInitiator("http://schemas.xmlsoap.org/wsdl/soap/", soapTF);
}
Aggregations