use of org.apache.cxf.transport.local.LocalTransportFactory in project cxf by apache.
the class PolicyAnnotationTest method testAnnotationImplNoInterface.
@org.junit.Test
public void testAnnotationImplNoInterface() throws Exception {
Bus bus = BusFactory.getDefaultBus();
JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
factory.setBus(bus);
factory.setServiceBean(new TestImplNoInterface());
factory.setStart(false);
List<String> tp = Arrays.asList("http://schemas.xmlsoap.org/soap/http", "http://schemas.xmlsoap.org/wsdl/http/", "http://schemas.xmlsoap.org/wsdl/soap/http", "http://www.w3.org/2003/05/soap/bindings/HTTP/", "http://cxf.apache.org/transports/http/configuration", "http://cxf.apache.org/bindings/xformat");
LocalTransportFactory f = new LocalTransportFactory();
f.getUriPrefixes().add("http");
f.setTransportIds(tp);
Server s = factory.create();
try {
ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus, s.getEndpoint().getService().getServiceInfos());
Definition def = builder.build();
WSDLWriter wsdlWriter = bus.getExtension(WSDLManager.class).getWSDLFactory().newWSDLWriter();
def.setExtensionRegistry(bus.getExtension(WSDLManager.class).getExtensionRegistry());
Element wsdl = wsdlWriter.getDocument(def).getDocumentElement();
Map<String, String> ns = new HashMap<>();
ns.put("wsdl", WSDLConstants.NS_WSDL11);
ns.put("wsu", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
ns.put("wsp", Constants.URI_POLICY_13_NS);
XPathUtils xpu = new XPathUtils(ns);
// org.apache.cxf.helpers.XMLUtils.printDOM(wsdl);
assertEquals(1, xpu.getValueList("/wsdl:definitions/wsdl:binding/" + "wsp:PolicyReference[@URI='#TestImplNoInterfaceServiceSoapBindingBindingPolicy']", wsdl).getLength());
final EndpointPolicy policy = bus.getExtension(PolicyEngine.class).getServerEndpointPolicy(s.getEndpoint().getEndpointInfo(), null, null);
assertNotNull(policy);
} finally {
bus.shutdown(true);
}
}
use of org.apache.cxf.transport.local.LocalTransportFactory in project cxf by apache.
the class ConfiguredEndpointTest method initializeBus.
private void initializeBus() {
Bus bus = BusFactory.getDefaultBus();
SoapBindingFactory bindingFactory = new SoapBindingFactory();
bus.getExtension(BindingFactoryManager.class).registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", bindingFactory);
DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
SoapTransportFactory soapDF = new SoapTransportFactory();
dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);
LocalTransportFactory localTransport = new LocalTransportFactory();
dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
}
use of org.apache.cxf.transport.local.LocalTransportFactory in project cxf by apache.
the class AbstractAegisTest method setUp.
@Before
public void setUp() throws Exception {
super.setUpBus();
SoapBindingFactory bindingFactory = new SoapBindingFactory();
bindingFactory.setBus(bus);
bus.getExtension(BindingFactoryManager.class).registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", bindingFactory);
DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
SoapTransportFactory soapDF = new SoapTransportFactory();
dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
dfm.registerDestinationFactory(SoapBindingConstants.SOAP11_BINDING_ID, soapDF);
dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", soapDF);
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(LocalTransportFactory.TRANSPORT_ID, localTransport);
extension.registerConduitInitiator("http://schemas.xmlsoap.org/wsdl/soap/", localTransport);
extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/http", localTransport);
extension.registerConduitInitiator(SoapBindingConstants.SOAP11_BINDING_ID, localTransport);
bus.setExtension(new WSDLManagerImpl(), WSDLManager.class);
// WoodstoxValidationImpl wstxVal = new WoodstoxValidationImpl();
addNamespace("wsdl", WSDLConstants.NS_WSDL11);
addNamespace("wsdlsoap", WSDLConstants.NS_SOAP11);
addNamespace("xsd", WSDLConstants.NS_SCHEMA_XSD);
}
use of org.apache.cxf.transport.local.LocalTransportFactory in project cxf by apache.
the class AbstractJaxWsTest method setUpBus.
@Before
public void setUpBus() throws Exception {
super.setUpBus();
SoapBindingFactory bindingFactory = new SoapBindingFactory();
bindingFactory.setBus(bus);
bus.getExtension(BindingFactoryManager.class).registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", bindingFactory);
bus.getExtension(BindingFactoryManager.class).registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/http", bindingFactory);
DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
SoapTransportFactory soapDF = new SoapTransportFactory();
dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
dfm.registerDestinationFactory(SoapBindingConstants.SOAP11_BINDING_ID, soapDF);
dfm.registerDestinationFactory(SoapBindingConstants.SOAP12_BINDING_ID, soapDF);
dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", soapDF);
localTransport = new LocalTransportFactory();
localTransport.setUriPrefixes(new HashSet<>(Arrays.asList("http", "local")));
dfm.registerDestinationFactory(LocalTransportFactory.TRANSPORT_ID, localTransport);
dfm.registerDestinationFactory("http://cxf.apache.org/transports/http", localTransport);
dfm.registerDestinationFactory("http://cxf.apache.org/transports/http/configuration", localTransport);
ConduitInitiatorManager extension = bus.getExtension(ConduitInitiatorManager.class);
extension.registerConduitInitiator(LocalTransportFactory.TRANSPORT_ID, localTransport);
extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/http", localTransport);
extension.registerConduitInitiator("http://cxf.apache.org/transports/http", localTransport);
extension.registerConduitInitiator("http://cxf.apache.org/transports/http/configuration", localTransport);
}
use of org.apache.cxf.transport.local.LocalTransportFactory in project tesb-rt-se by Talend.
the class RequestCallbackTest method initialize.
@Before
public void initialize() throws Exception {
if (mep == NO_RUN) {
return;
}
final Bus bus = BusFactory.getDefaultBus();
final LocalTransportFactory localTransport = new LocalTransportFactory();
final DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/jms", 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);
final 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://schemas.xmlsoap.org/soap/jms", localTransport);
extension.registerConduitInitiator("http://cxf.apache.org/bindings/xformat", localTransport);
final WSDLServiceFactory wsdlSvcFactory = new WSDLServiceFactory(CXFBusFactory.getThreadDefaultBus(), wsdlLocation, SERVICE_NAME);
final org.apache.cxf.service.Service cxfService = wsdlSvcFactory.create();
final ServiceInfo si = findServiceByName(cxfService, SERVICE_NAME);
if (si == null) {
throw new RuntimeException("WSDL does not contain service " + SERVICE_NAME);
}
final EndpointInfo ei = findEndpoint(si, PORT_NAME);
if (ei == null) {
throw new RuntimeException("WSDL does not contain port " + PORT_NAME);
}
endpointInfo = ei;
callbackMap.put("seekBookInBasementResponse", new SeekBookInBasementResponseCallback(messageTransfer));
callbackMap.put("seekBookInBasementFault", new SeekBookInBasementFaultCallback(messageTransfer));
}
Aggregations