Search in sources :

Example 31 with MemberSubmissionEndpointReference

use of com.sun.xml.ws.developer.MemberSubmissionEndpointReference in project metro-jax-ws by eclipse-ee4j.

the class EndpointEPRTest method testProviderEndpointMSCEPR_WSDL.

public void testProviderEndpointMSCEPR_WSDL() throws Exception {
    int port = PortAllocator.getFreePort();
    String address = "http://127.0.0.1:" + port + "/";
    Endpoint e = Endpoint.create(HTTPBinding.HTTP_BINDING, new MyProvider());
    List<Source> metadata = new ArrayList<Source>();
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    String[] docs = { "RpcLitEndpoint.wsdl", "RpcLitAbstract.wsdl", "RpcLitEndpoint.xsd" };
    for (String doc : docs) {
        URL url = cl.getResource(doc);
        metadata.add(new StreamSource(url.openStream(), url.toExternalForm()));
    }
    e.setMetadata(metadata);
    Map<String, Object> endpointProps = new HashMap<String, Object>();
    endpointProps.put(Endpoint.WSDL_SERVICE, new QName("http://echo.org/", "RpcLitEndpoint"));
    endpointProps.put(Endpoint.WSDL_PORT, new QName("http://echo.org/", "RpcLitPort"));
    e.setProperties(endpointProps);
    e.publish(address);
    MemberSubmissionEndpointReference epr = e.getEndpointReference(MemberSubmissionEndpointReference.class);
    e.stop();
    EprUtil.validateEPR(epr, address, serviceName, portName, portTypeName, Boolean.TRUE);
    printEPR(epr);
}
Also used : HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) StreamSource(javax.xml.transform.stream.StreamSource) ArrayList(java.util.ArrayList) Endpoint(jakarta.xml.ws.Endpoint) StreamSource(javax.xml.transform.stream.StreamSource) Source(javax.xml.transform.Source) URL(java.net.URL) Endpoint(jakarta.xml.ws.Endpoint) MemberSubmissionEndpointReference(com.sun.xml.ws.developer.MemberSubmissionEndpointReference)

Aggregations

MemberSubmissionEndpointReference (com.sun.xml.ws.developer.MemberSubmissionEndpointReference)31 W3CEndpointReference (jakarta.xml.ws.wsaddressing.W3CEndpointReference)13 WSEndpointReference (com.sun.xml.ws.api.addressing.WSEndpointReference)8 Element (org.w3c.dom.Element)7 Endpoint (jakarta.xml.ws.Endpoint)6 EndpointReference (jakarta.xml.ws.EndpointReference)6 W3CEndpointReferenceBuilder (jakarta.xml.ws.wsaddressing.W3CEndpointReferenceBuilder)6 URL (java.net.URL)6 ArrayList (java.util.ArrayList)6 DocumentBuilder (javax.xml.parsers.DocumentBuilder)6 DocumentBuilderFactory (javax.xml.parsers.DocumentBuilderFactory)6 Source (javax.xml.transform.Source)6 Document (org.w3c.dom.Document)6 StreamSource (javax.xml.transform.stream.StreamSource)5 JAXBElement (jakarta.xml.bind.JAXBElement)4 HashMap (java.util.HashMap)3 QName (javax.xml.namespace.QName)3 DOMResult (javax.xml.transform.dom.DOMResult)3 MemberSubmissionAddressingFeature (com.sun.xml.ws.developer.MemberSubmissionAddressingFeature)2 JAXBContext (jakarta.xml.bind.JAXBContext)2