Package org.objectweb.celtix.bindings

Examples of org.objectweb.celtix.bindings.BindingFactory


    private  ClientBinding createClientBinding() {
        // TODO: Get bindingId from wsdl via the ref
        String bindingId = "http://schemas.xmlsoap.org/wsdl/soap/";
        ClientBinding binding = null;
        try {
            BindingFactory factory = bus.getBindingManager().getBindingFactory(bindingId);
            assert factory != null : "unable to find binding factory for " + bindingId;
            binding = factory.createClientBinding(ref);
        } catch (Exception ex) {
            throw new WebServiceException(ex);
        }
        return binding;
    }
View Full Code Here


        ClientBinding binding = null;
        try {
           
            String bindingId = c.getString("bindingId");
            BindingFactory factory = bus.getBindingManager().getBindingFactory(bindingId);
            assert factory != null : "unable to find binding factory for " + bindingId;
            binding = factory.createClientBinding(ref);
        } catch (Exception ex) {
            throw new WebServiceException(ex);
        }
       
        binding.configureSystemHandlers(c);
View Full Code Here

        junit.textui.TestRunner.run(SoapBindingFactoryTest.class);
    }
   
    public void testCreateClientBinding() throws Exception {
        Bus bus = Bus.init(new String[0]);
        BindingFactory factory =
            bus.getBindingManager().getBindingFactory(
                "http://schemas.xmlsoap.org/wsdl/soap/");
        assertNotNull(factory);
       
        URL url = getClass().getClassLoader().getResource(".");
        URL wsdlUrl = new URL(url, "../classes-tests/wsdl/hello_world.wsdl");
        assertNotNull(wsdlUrl);
        QName serviceName = new QName("http://objectweb.org/hello_world_soap_http", "SOAPService");
        EndpointReferenceType address = EndpointReferenceUtils
            .getEndpointReference(wsdlUrl, serviceName, "SoapPort");
       
        ClientBinding clientBinding = factory.createClientBinding(address);
        assertNotNull(clientBinding);
        assertTrue(SOAPClientBinding.class.isInstance(clientBinding));
       
        SOAPClientBinding soapClientBinding = (SOAPClientBinding)clientBinding;
        Binding b = soapClientBinding.getBinding();
View Full Code Here

    private void loadBindingFactory(String className, String ...namespaceURIs) throws BusException {
        try {
            Class<? extends BindingFactory> clazz =
                    Class.forName(className).asSubclass(BindingFactory.class);

            BindingFactory factory = clazz.newInstance();
            factory.init(bus);

            for (String namespace : namespaceURIs) {
                registerBinding(namespace, factory);
            }
        } catch (ClassNotFoundException cnfe) {
View Full Code Here

        if (null == bindingId) {
            // Use SOAP1.1/HTTP Binding as default. JAX-WS Spec 5.2.1
            bindingId = SOAPBinding.SOAP11HTTP_BINDING;
        }
       
        BindingFactory factory = bus.getBindingManager().getBindingFactory(bindingId);
        if (null == factory) {
            throw new BusException(new Message("BINDING_FACTORY_MISSING_EXC", LOG, bindingId));
        }
        ServerBinding bindingImpl = factory.createServerBinding(reference, this);
        assert null != bindingImpl;
        return bindingImpl;

    }
View Full Code Here

   
    public void testInvoke() throws Exception {

        // setup test fixture
        //
        BindingFactory bindingFact = mockBusFactory.getMock(BindingFactory.class);
        assertNotNull("could not get binding factory", bindingFact);
        transport.invoke(req, resp);       
        EasyMock.replay(transport);
       
       
        ServerBinding mockServerBinding = EasyMock.createMock(ServerBinding.class);
       
        bindingFact.createServerBinding((EndpointReferenceType)EasyMock.notNull(),
                                        (ServerBindingEndpointCallback)EasyMock.notNull());
        EasyMock.expectLastCall().andReturn(mockServerBinding);
        mockServerBinding.activate();
       
       
View Full Code Here

        assertNotNull(bus);

        BindingManager bindingManager = bus.getBindingManager();
        assertNotNull(bindingManager);
       
        BindingFactory factory = bindingManager.getBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/");
        assertNotNull(factory);
        //Last Created bus should always be returned.
        Thread.sleep(100);
        bus.shutdown(true);
    }   
View Full Code Here

        testUtils = new TestUtils();
    }
   
    public void testCreateClientBinding() throws Exception {
        Bus bus = Bus.init(new String[0]);
        BindingFactory factory =
            bus.getBindingManager().getBindingFactory(
                "http://celtix.objectweb.org/bindings/xmlformat");
        assertNotNull(factory);
       
        EndpointReferenceType address = testUtils.getEndpointReference();
       
        ClientBinding clientBinding = factory.createClientBinding(address);
        assertNotNull(clientBinding);
        assertTrue(XMLClientBinding.class.isInstance(clientBinding));
       
        XMLClientBinding xmlClientBinding = (XMLClientBinding)clientBinding;
        Binding b = xmlClientBinding.getBinding();
View Full Code Here

        BindingManager manager = bus.getBindingManager();
        CorbaBindingFactory corbaBF = new CorbaBindingFactory();
        corbaBF.init(bus);
        manager.registerBinding(CorbaConstants.NU_WSDL_CORBA, corbaBF);
       
        BindingFactory factory =
            bus.getBindingManager().getBindingFactory("http://schemas.apache.org/yoko/bindings/corba");
       
        EndpointReferenceType address = testUtils.getSimpleTestEndpointReference();
       
        ClientBinding cb = factory.createClientBinding(address);
        assertNotNull(cb);
        assertTrue(CorbaClientBinding.class.isInstance(cb));
       
        CorbaClientBinding clientBinding = (CorbaClientBinding)cb;
        Binding binding = clientBinding.getBinding();
View Full Code Here

        BindingManager manager = bus.getBindingManager();
        CorbaBindingFactory corbaBF = new CorbaBindingFactory();
        corbaBF.init(bus);
        manager.registerBinding(CorbaConstants.NU_WSDL_CORBA, corbaBF);
       
        BindingFactory factory =
            bus.getBindingManager().getBindingFactory("http://schemas.apache.org/yoko/bindings/corba");
       
        EndpointReferenceType address = testUtils.getSimpleTestEndpointReference();
       
        ServerBinding sb = factory.createServerBinding(address, null);
        assertNotNull(sb);
        assertTrue(CorbaServerBinding.class.isInstance(sb));
       
        CorbaServerBinding serverBinding = (CorbaServerBinding)sb;
        Binding binding = serverBinding.getBinding();
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.bindings.BindingFactory

Copyright © 2018 www.massapicom. 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.