Search in sources :

Example 86 with Endpoint

use of jakarta.xml.ws.Endpoint 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)

Example 87 with Endpoint

use of jakarta.xml.ws.Endpoint in project metro-jax-ws by eclipse-ee4j.

the class EndpointFeaturesTest method testCreateImplFeatures.

// Tests Endpoint.create(impl, features)
public void testCreateImplFeatures() throws Exception {
    int port = PortAllocator.getFreePort();
    String address = "http://localhost:" + port + "/hello";
    Endpoint endpoint = Endpoint.create(new FeaturesEndpoint(), new AddressingFeature(true, true, AddressingFeature.Responses.ANONYMOUS));
    publishVerifyStop(address, endpoint);
}
Also used : AddressingFeature(jakarta.xml.ws.soap.AddressingFeature) Endpoint(jakarta.xml.ws.Endpoint) Endpoint(jakarta.xml.ws.Endpoint)

Example 88 with Endpoint

use of jakarta.xml.ws.Endpoint in project metro-jax-ws by eclipse-ee4j.

the class EndpointFeaturesTest method testCreateBindingImplFeatures.

// Tests Endpoint.create(bindingId, impl, features)
public void testCreateBindingImplFeatures() throws Exception {
    int port = PortAllocator.getFreePort();
    String address = "http://localhost:" + port + "/hello";
    Endpoint endpoint = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, new FeaturesEndpoint(), new AddressingFeature(true, true, AddressingFeature.Responses.ANONYMOUS));
    publishVerifyStop(address, endpoint);
}
Also used : AddressingFeature(jakarta.xml.ws.soap.AddressingFeature) Endpoint(jakarta.xml.ws.Endpoint) Endpoint(jakarta.xml.ws.Endpoint)

Example 89 with Endpoint

use of jakarta.xml.ws.Endpoint in project metro-jax-ws by eclipse-ee4j.

the class EndpointAPIWithZeroIpTest method testEndpointWithZeroIp.

public void testEndpointWithZeroIp() {
    int port = PortAllocator.getFreePort();
    String address = "http://0.0.0.0:" + port + "/hello";
    Endpoint endpoint = Endpoint.publish(address, new RpcLitEndpoint());
    doAPItesting(endpoint);
}
Also used : Endpoint(jakarta.xml.ws.Endpoint) Endpoint(jakarta.xml.ws.Endpoint)

Example 90 with Endpoint

use of jakarta.xml.ws.Endpoint in project metro-jax-ws by eclipse-ee4j.

the class FaultToEndpointTest method testFaultToEndpoint.

public void testFaultToEndpoint() throws Exception {
    int port = PortAllocator.getFreePort();
    String address = "http://localhost:" + port + "/hello";
    Endpoint e = Endpoint.create(new MyProvider());
    e.publish(address);
    String message = "<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>sending fault to endpoint</faultstring></s:Fault></s:Body></s:Envelope>";
    HTTPResponseInfo rInfo = ClientServerTestUtil.sendPOSTRequest(address, message, "text/xml");
    assertEquals(200, rInfo.getResponseCode());
    e.stop();
}
Also used : Endpoint(jakarta.xml.ws.Endpoint) HTTPResponseInfo(testutil.HTTPResponseInfo) Endpoint(jakarta.xml.ws.Endpoint)

Aggregations

Endpoint (jakarta.xml.ws.Endpoint)90 URL (java.net.URL)25 Source (javax.xml.transform.Source)22 StreamSource (javax.xml.transform.stream.StreamSource)22 ArrayList (java.util.ArrayList)16 MemberSubmissionEndpointReference (com.sun.xml.ws.developer.MemberSubmissionEndpointReference)10 W3CEndpointReference (jakarta.xml.ws.wsaddressing.W3CEndpointReference)10 QName (javax.xml.namespace.QName)7 HttpContext (com.sun.net.httpserver.HttpContext)6 HttpServer (com.sun.net.httpserver.HttpServer)5 InetSocketAddress (java.net.InetSocketAddress)5 HashMap (java.util.HashMap)5 ExecutorService (java.util.concurrent.ExecutorService)5 HTTPResponseInfo (testutil.HTTPResponseInfo)5 EndpointImpl (com.sun.xml.ws.transport.http.server.EndpointImpl)4 EndpointReference (jakarta.xml.ws.EndpointReference)4 Transformer (javax.xml.transform.Transformer)4 TransformerFactory (javax.xml.transform.TransformerFactory)4 StreamResult (javax.xml.transform.stream.StreamResult)4 WSEndpoint (com.sun.xml.ws.api.server.WSEndpoint)3