Package org.apache.cxf.jaxws.spi

Examples of org.apache.cxf.jaxws.spi.ProviderImpl


        endpoint.stop();       
    }
   
    @Test
    public void testProviderReadEndpointReference() throws Exception {
        ProviderImpl provider = new ProviderImpl();

        InputStream is = getClass().getResourceAsStream("resources/hello_world_soap_http_infoset.xml");
        Document doc = XMLUtils.parse(is);
        DOMSource erXML = new DOMSource(doc);
        EndpointReference endpointReference = provider.readEndpointReference(erXML);
        assertNotNull(endpointReference);

        assertTrue(endpointReference instanceof W3CEndpointReference);       
    }
View Full Code Here


        assertTrue(endpointReference instanceof W3CEndpointReference);       
    }
   
    @Test
    public void testProviderCreateW3CEndpointReference() throws Exception {
        ProviderImpl provider = new ProviderImpl();

        InputStream is = getClass().getResourceAsStream("resources/hello_world_soap_http_infoset.xml");
        Document doc = XMLUtils.parse(is);
        Element referenceParameter = XMLUtils.fetchElementByNameAttribute(doc.getDocumentElement(),
                                                                          "wsa:ReferenceParameters",
                                                                          "");
        List<Element> referenceParameters = new ArrayList<Element>();
        if (referenceParameter != null) {
            referenceParameters.add(referenceParameter);
        }

        Element metadata = XMLUtils.fetchElementByNameAttribute(doc.getDocumentElement(), "wsa:metadata", "");
        List<Element> metadataList = new ArrayList<Element>();
        if (metadata != null) {
            metadataList.add(metadata);
        }

        W3CEndpointReference endpointReference = provider
            .createW3CEndpointReference("http://localhost:8080/test", serviceName, portName, metadataList,
                                        "wsdlDocumentLocation", referenceParameters);
        assertNotNull(endpointReference);
    }
View Full Code Here

        BusFactory.setDefaultBus(getBus());
        GreeterImpl greeter1 = new GreeterImpl();
        EndpointImpl endpoint = new EndpointImpl(getBus(), greeter1, (String)null);
        endpoint.publish("http://localhost:8080/test");
       
        ProviderImpl provider = new ProviderImpl();
       
        InputStream is = getClass().getResourceAsStream("resources/hello_world_soap_http_infoset.xml");
        Document doc = XMLUtils.parse(is);
        DOMSource erXML = new DOMSource(doc);
        EndpointReference endpointReference = EndpointReference.readFrom(erXML);       

        WebServiceFeature[] wfs = new WebServiceFeature[] {};
       
        Greeter greeter = provider.getPort(endpointReference, Greeter.class, wfs);       

        String response = greeter.greetMe("John");
        assertEquals("Hello John", response);
    }
View Full Code Here

        endpoint.stop();       
    }
   
    @Test
    public void testProviderReadEndpointReference() throws Exception {
        ProviderImpl provider = new ProviderImpl();

        InputStream is = getClass().getResourceAsStream("resources/hello_world_soap_http_infoset.xml");
        Document doc = StaxUtils.read(is);
        DOMSource erXML = new DOMSource(doc);
        EndpointReference endpointReference = provider.readEndpointReference(erXML);
        assertNotNull(endpointReference);

        assertTrue(endpointReference instanceof W3CEndpointReference);       
    }
View Full Code Here

        assertTrue(endpointReference instanceof W3CEndpointReference);       
    }
   
    @Test
    public void testProviderCreateW3CEndpointReference() throws Exception {
        ProviderImpl provider = new ProviderImpl();

        InputStream is = getClass().getResourceAsStream("resources/hello_world_soap_http_infoset.xml");
        Document doc = StaxUtils.read(is);
        Element referenceParameter = fetchElementByNameAttribute(doc.getDocumentElement(),
                                                                 "wsa:ReferenceParameters",
                                                                 "");
        List<Element> referenceParameters = new ArrayList<Element>();
        if (referenceParameter != null) {
            referenceParameters.add(referenceParameter);
        }

        Element metadata = fetchElementByNameAttribute(doc.getDocumentElement(), "wsa:metadata", "");
        List<Element> metadataList = new ArrayList<Element>();
        if (metadata != null) {
            metadataList.add(metadata);
        }

        W3CEndpointReference endpointReference = provider
            .createW3CEndpointReference("http://localhost:8080/test", serviceName, portName, metadataList,
                                        "wsdlDocumentLocation", referenceParameters);
        assertNotNull(endpointReference);
    }
View Full Code Here

        BusFactory.setDefaultBus(getBus());
        GreeterImpl greeter1 = new GreeterImpl();
        EndpointImpl endpoint = new EndpointImpl(getBus(), greeter1, (String)null);
        endpoint.publish("http://localhost:8080/test");
       
        ProviderImpl provider = new ProviderImpl();
       
        InputStream is = getClass().getResourceAsStream("resources/hello_world_soap_http_infoset.xml");
        Document doc = StaxUtils.read(is);
        DOMSource erXML = new DOMSource(doc);
        EndpointReference endpointReference = EndpointReference.readFrom(erXML);       

        WebServiceFeature[] wfs = new WebServiceFeature[] {};
       
        Greeter greeter = provider.getPort(endpointReference, Greeter.class, wfs);       

        String response = greeter.greetMe("John");
        assertEquals("Hello John", response);
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxws.spi.ProviderImpl

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.