Examples of SOAPBindingModel


Examples of org.switchyard.component.soap.config.model.SOAPBindingModel

        _soapInbound = new InboundHandler(_config, _domain);
        _soapInbound.start();

        URL serviceURL = new URL("http://" + host + ":" + port + "/HelloWebService");

        SOAPBindingModel config = new V1SOAPBindingModel(SOAPNamespace.DEFAULT.uri()) {
            @Override
            public CompositeReferenceModel getReference() {
                return new V1CompositeReferenceModel();
            }
        };
        config.setWsdl(serviceURL.toExternalForm() + "?wsdl");
        config.setServiceName(_authConsumerService1.getServiceName());
        config.setName("auth-test");
        config.setEndpointAddress("http://192.168.169.4/index.htm");

        // Service consumer or Reference binding
        OutboundHandler soapProxyOutbound1 = new OutboundHandler(config);
        soapProxyOutbound1.start();
        _domain.registerService(_authConsumerService1.getServiceName(), new HelloWebServiceInterface(), soapProxyOutbound1);

        NtlmAuthModel auth = new V1NtlmAuthModel(SOAPNamespace.DEFAULT.uri());
        auth.setUser("SwitchYard");
        auth.setPassword("JBoss123!");
        auth.setDomain("JBOSS");
        config.setNtlmAuthConfig(auth);
        config.setServiceName(_authConsumerService2.getServiceName());

        // Service consumer or Reference binding
        OutboundHandler soapProxyOutbound2 = new OutboundHandler(config);
        soapProxyOutbound2.start();
        _domain.registerService(_authConsumerService2.getServiceName(), new HelloWebServiceInterface(), soapProxyOutbound2);
View Full Code Here

Examples of org.switchyard.component.soap.config.model.SOAPBindingModel

        super(SOAP_TYPE);
    }

    @Override
    public ServiceHandler activateBinding(QName name, BindingModel config) {
        SOAPBindingModel binding = (SOAPBindingModel)config;
        binding.setEnvironment(_environment);
       
        if (binding.isServiceBinding()) {
            return new InboundHandler(binding, getServiceDomain());
        } else {
            return new OutboundHandler(binding);
        }
    }
View Full Code Here

Examples of org.switchyard.component.soap.config.model.SOAPBindingModel

        _soapInbound11.start();

        _serviceURL = new URL("http://" + host + ":" + port + "/HelloWebService");

        // A WS Consumer as Service
        SOAPBindingModel config2 = new V1SOAPBindingModel(SOAPNamespace.DEFAULT.uri()) {
            @Override
            public CompositeReferenceModel getReference() {
                return new V1CompositeReferenceModel();
            }
        };
        config2.setWsdl(_serviceURL.toExternalForm() + "?wsdl");
        config2.setServiceName(_consumerService11.getServiceName());
        config2.setName("testGateway");
        _soapOutbound11_1 = new OutboundHandler(config2);
        _soapOutbound11_1.start();
        // Hack for Test Runner. Register a service to test outbound.
        _domain.registerService(_consumerService11.getServiceName(), new HelloWebServiceInterface(), _soapOutbound11_1);

        SOAPBindingModel config3 = new V1SOAPBindingModel(SOAPNamespace.DEFAULT.uri()) {
            @Override
            public CompositeReferenceModel getReference() {
                return new V1CompositeReferenceModel();
            }
        };
        config3.setWsdl(_config.getWsdl());
        config3.setServiceName(_consumerCPWsdl.getServiceName());
        config3.setName("testGateway");
        _soapOutbound11_2 = new OutboundHandler(config3);
        _soapOutbound11_2.start();
        // Hack for Test Runner. Register a service to test outbound.
        _domain.registerService(_consumerCPWsdl.getServiceName(), new HelloWebServiceInterface(), _soapOutbound11_2);

        composite = _puller.pull("/HelloSwitchYard1.2.xml", getClass());
        composite.assertModelValid();

        compositeService = composite.getServices().get(0);
        SOAPBindingModel _config12 = (SOAPBindingModel)compositeService.getBindings().get(0);
        _config12.setSocketAddr(new SocketAddr(host, Integer.parseInt(port)));

        // Massive hack for Test Runner. Register both a service and a reference binding.
        _domain.registerService(_config12.getServiceName(), new HelloWebServiceInterface(), provider);
        _domain.registerServiceReference(_config12.getServiceName(), new HelloWebServiceInterface());

        // Service exposed as WS
        _soapInbound12 = new InboundHandler(_config12, _domain);
        _soapInbound12.start();

        // We cannot use HelloWebServiceXXX, because the context path suffix XXX is ignored by JAXWS
        URL serviceURL = new URL("http://" + host + ":" + port + "/HelloSOAP12Service");

        SOAPBindingModel config4 = new V1SOAPBindingModel(SOAPNamespace.DEFAULT.uri()) {
            @Override
            public CompositeReferenceModel getReference() {
                return new V1CompositeReferenceModel();
            }
        };
        config4.setWsdl(serviceURL.toExternalForm() + "?wsdl");
        config4.setServiceName(_consumerService12.getServiceName());
        config4.setName("testGateway");
        _soapOutbound12_1 = new OutboundHandler(config4);
        _soapOutbound12_1.start();
        // Hack for Test Runner. Register a service to test outbound.
        _domain.registerService(_consumerService12.getServiceName(), new HelloWebServiceInterface(), _soapOutbound12_1);

        config4.setServiceName(_consumerService3.getServiceName());
        config4.setEndpointAddress("http://localhost:8090/forever");
        config4.setTimeout(1300);
        _soapOutbound3 = new OutboundHandler(config4);
        _soapOutbound3.start();
        _domain.registerService(_consumerService3.getServiceName(), new HelloWebServiceInterface(), _soapOutbound3);

        XMLUnit.setIgnoreWhitespace(true);
View Full Code Here

Examples of org.switchyard.component.soap.config.model.SOAPBindingModel

        _soapInbound.start();

        _serviceURL = new URL("http://" + host + ":" + port + "/OrderServiceRPC");

        // A WS Consumer as Service
        SOAPBindingModel config2 = new V1SOAPBindingModel(SOAPNamespace.DEFAULT.uri()) {
            @Override
            public CompositeReferenceModel getReference() {
                return new V1CompositeReferenceModel();
            }
        };
        config2.setWsdl(_serviceURL.toExternalForm() + "?wsdl");
        config2.setServiceName(consumerService.getServiceName());
        config2.setName("testGateway");
        _soapOutbound = new OutboundHandler(config2);
        _soapOutbound.start();
        _domain.registerService(consumerService.getServiceName(), new OrderServiceInterface(), _soapOutbound);
       
        XMLUnit.setIgnoreWhitespace(true);
View Full Code Here

Examples of org.switchyard.component.soap.config.model.SOAPBindingModel

        _soapInbound = new InboundHandler(_config, _domain);
        _soapInbound.start();

        URL serviceURL = new URL("http://" + host + ":" + port + "/HelloWebService");

        SOAPBindingModel config = new V1SOAPBindingModel(SOAPNamespace.DEFAULT.uri()) {
            @Override
            public CompositeReferenceModel getReference() {
                return new V1CompositeReferenceModel();
            }
        };
        config.setWsdl(serviceURL.toExternalForm() + "?wsdl");
        config.setServiceName(_proxyConsumerService1.getServiceName());
        config.setName("proxy-test");
        config.setEndpointAddress("http://unreachablehost/HelloWebService");

        // Service consumer or Reference binding
        OutboundHandler soapProxyOutbound1 = new OutboundHandler(config);
        soapProxyOutbound1.start();
        _domain.registerService(_proxyConsumerService1.getServiceName(), new HelloWebServiceInterface(), soapProxyOutbound1);

        ProxyModel proxy = new V1ProxyModel(SOAPNamespace.DEFAULT.uri());
        proxy.setHost(host);
        proxy.setPort("" + PROXYPORT);
        config.setProxyConfig(proxy);
        config.setEndpointAddress(serviceURL.toExternalForm());
        config.setServiceName(_proxyConsumerService2.getServiceName());

        // Service consumer or Reference binding
        OutboundHandler soapProxyOutbound2 = new OutboundHandler(config);
        soapProxyOutbound2.start();
        _domain.registerService(_proxyConsumerService2.getServiceName(), new HelloWebServiceInterface(), soapProxyOutbound2);

        proxy.setUser(PROXY_USER);
        proxy.setPassword(PROXY_PWD);
        config.setProxyConfig(proxy);
        config.setServiceName(_proxyConsumerService3.getServiceName());

        // Service consumer or Reference binding
        OutboundHandler soapProxyOutbound3 = new OutboundHandler(config);
        soapProxyOutbound3.start();
        _domain.registerService(_proxyConsumerService3.getServiceName(), new HelloWebServiceInterface(), soapProxyOutbound3);
View Full Code Here

Examples of org.switchyard.component.soap.config.model.SOAPBindingModel

    }
   
    @Test
    public void testReadConfigBinding() throws Exception {
        ModelPuller<SOAPBindingModel> puller = new ModelPuller<SOAPBindingModel>();
        SOAPBindingModel model = puller.pull(SOAP_BINDING, getClass());
        Assert.assertTrue(model.isModelValid());
        Assert.assertTrue("Unwrap should be true", model.getSOAPMessageComposer().isUnwrapped());
    }
View Full Code Here

Examples of org.switchyard.component.soap.config.model.SOAPBindingModel

        _soapInbound.start();

        _serviceURL = new URL("http://" + host + ":" + port + "/OrderService");

        // A WS Consumer as Service
        SOAPBindingModel config2 = new V1SOAPBindingModel(SOAPNamespace.DEFAULT.uri()) {
            @Override
            public CompositeReferenceModel getReference() {
                return new V1CompositeReferenceModel();
            }
        };
        config2.setWsdl(_serviceURL.toExternalForm() + "?wsdl");
        config2.setServiceName(consumerService.getServiceName());
        config2.setName("testGateway");
        _soapOutbound = new OutboundHandler(config2);
        _soapOutbound.start();
        _domain.registerService(consumerService.getServiceName(), new OrderServiceInterface(), _soapOutbound);
       
        XMLUnit.setIgnoreWhitespace(true);
View Full Code Here

Examples of org.switchyard.config.model.composite.test.soap.SOAPBindingModel

    public void testReadComplete() throws Exception {
        SwitchYardModel switchyard = _puller.pull(COMPLETE_XML, getClass());
        CompositeModel composite = switchyard.getComposite();
        CompositeServiceModel service = composite.getServices().get(0);
        // Verify composite service binding
        SOAPBindingModel binding = (SOAPBindingModel)service.getBindings().get(0);
        PortModel port = binding.getPort();
        Assert.assertEquals("MyWebService/SOAPPort", port.getPort());
        Assert.assertEquals("service.wsdl", binding.getWSDL().getLocation());
        ComponentModel component = port.getBinding().getService().getComposite().getComponents().get(0);
        ComponentServiceModel componentService = component.getServices().get(0);
        Assert.assertEquals("SimpleService", componentService.getName());
        Assert.assertTrue(componentService.hasPolicyRequirement(new QName("clientAuthentication")));
        Assert.assertEquals("theSecurityName", componentService.getSecurity());
View Full Code Here

Examples of org.switchyard.config.model.composite.test.soap.SOAPBindingModel

    public void testReadCustomViaModel() throws Exception {
        CompositeModel composite = _puller.pull(COMPLETE_XML, getClass());
        CompositeServiceModel compositeService = composite.getServices().get(0);
        BindingModel binding = (BindingModel)compositeService.getBindings().get(0);
        assertTrue(binding instanceof SOAPBindingModel);
        SOAPBindingModel soap_binding = (SOAPBindingModel)compositeService.getBindings().get(0);
        assertEquals("soap", binding.getType());
        PortModel port = soap_binding.getPort();
        assertEquals("MyWebService/SOAPPort", port.getPort());
        assertEquals(true, port.isSecure());
        WSDLModel wsdl = soap_binding.getWSDL();
        assertEquals("service.wsdl", wsdl.getLocation());
        assertEquals("foobar", wsdl.getDescription());
    }
View Full Code Here

Examples of org.switchyard.config.model.composite.test.soap.SOAPBindingModel

        assertEquals(SCANamespace.DEFAULT.uri(), composite.getModelConfiguration().getQName().getNamespaceURI());
        assertEquals("m1app", composite.getName());
        CompositeServiceModel compositeService = composite.getServices().get(0);
        assertEquals("M1AppService", compositeService.getName());
        assertEquals("SimpleService", compositeService.getPromote());
        SOAPBindingModel binding1 = (SOAPBindingModel)compositeService.getBindings().get(0);
        assertEquals("soap", binding1.getType());
        PortModel port = binding1.getPort();
        assertEquals("MyWebService/SOAPPort", port.getPort());
        assertEquals(true, port.isSecure());
        WSDLModel wsdl1 = binding1.getWSDL();
        assertEquals("service.wsdl", wsdl1.getLocation());
        assertEquals("foobar", wsdl1.getDescription());
        CompositeReferenceModel compositeReference = composite.getReferences().get(0);
        assertEquals("SomeOtherService", compositeReference.getName());
        assertEquals("SimpleService/AnotherService", compositeReference.getPromote());
        SOAPBindingModel binding2 = (SOAPBindingModel)compositeReference.getBindings().get(0);
        assertEquals("soap", binding2.getType());
        WSDLModel wsdl = binding2.getWSDL();
        assertEquals("http://exmample.org:8080/services/SomeOtherService?wsdl", wsdl.getLocation());
        ComponentModel component1 = composite.getComponents().get(0);
        assertEquals("SimpleService", component1.getName());
        ComponentImplementationModel implementation1 = component1.getImplementation();
        assertEquals("bean", implementation1.getType());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.