Search in sources :

Example 41 with Endpoint

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

the class OnewayTester method testOneway.

public void testOneway() throws Exception {
    int port = Util.getFreePort();
    String address = "http://localhost:" + port + "/oneway";
    Endpoint endpoint = Endpoint.create(new OnewayEndpoint());
    endpoint.publish(address);
    int status = getHttpStatus(address);
    assertEquals(202, status);
    assertTrue(verify(address).contains("12345"));
    endpoint.stop();
}
Also used : Endpoint(jakarta.xml.ws.Endpoint) Endpoint(jakarta.xml.ws.Endpoint)

Example 42 with Endpoint

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

the class JaxwsHttpServer method createEndpoint.

private void createEndpoint(Adapter adapter, File warDirFile) throws Exception {
    /*
        String url = "http://localhost:8080/"+warDir+endpointInfo.getUrlPattern();
        EndpointFactory.newInstance ().publish (url, endpointInfo.getImplementor());
         */
    String urlPattern = adapter.urlPattern;
    if (urlPattern.endsWith("/*")) {
        urlPattern = urlPattern.substring(0, urlPattern.length() - 2);
    }
    String warDirName = warDirFile.getName();
    String contextRoot = "/" + warDirName + urlPattern;
    System.out.println("Context Root=" + contextRoot);
    HttpContext context = appServer.createContext(contextRoot);
    // Creating endpoint from backdoor (and this publishes it, too)
    Endpoint endpoint = new EndpointImpl(adapter.getEndpoint(), context);
// // set MTOM
// if (binding instanceof SOAPBinding) {
// ((SOAPBinding)endpoint.getBinding()).setMTOMEnabled(((SOAPBinding)binding).isMTOMEnabled());
// ((SOAPBinding)endpoint.getBinding()).setRoles(((SOAPBinding)binding).getRoles());
// }
}
Also used : Endpoint(jakarta.xml.ws.Endpoint) WSEndpoint(com.sun.xml.ws.api.server.WSEndpoint) EndpointImpl(com.sun.xml.ws.transport.http.server.EndpointImpl) HttpContext(com.sun.net.httpserver.HttpContext)

Example 43 with Endpoint

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

the class DocBareTest method testBare.

public void testBare() throws Exception {
    int port = PortAllocator.getFreePort();
    String address = "http://localhost:" + port + "/bare";
    Endpoint endpoint = Endpoint.create(new BareService());
    endpoint.publish(address);
    endpoint.stop();
}
Also used : Endpoint(jakarta.xml.ws.Endpoint) Endpoint(jakarta.xml.ws.Endpoint)

Example 44 with Endpoint

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

the class EndpointAPITest method testHttpsAddress.

public void testHttpsAddress() {
    int port = PortAllocator.getFreePort();
    String address = "https://localhost:" + port + "/hello";
    // Doesn't support https scheme, so expect IllegalArgumentException
    try {
        Endpoint endpoint = Endpoint.publish(address, new RpcLitEndpoint());
        assertTrue(false);
    } catch (IllegalArgumentException e) {
    }
}
Also used : Endpoint(jakarta.xml.ws.Endpoint) Endpoint(jakarta.xml.ws.Endpoint)

Example 45 with Endpoint

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

the class EndpointAPITest method testEndpoint.

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

Aggregations

Endpoint (jakarta.xml.ws.Endpoint)95 URL (java.net.URL)25 Source (javax.xml.transform.Source)22 StreamSource (javax.xml.transform.stream.StreamSource)22 ArrayList (java.util.ArrayList)16 QName (javax.xml.namespace.QName)12 MemberSubmissionEndpointReference (com.sun.xml.ws.developer.MemberSubmissionEndpointReference)10 W3CEndpointReference (jakarta.xml.ws.wsaddressing.W3CEndpointReference)10 HttpContext (com.sun.net.httpserver.HttpContext)6 HttpServer (com.sun.net.httpserver.HttpServer)5 JAXBException (jakarta.xml.bind.JAXBException)5 SOAPException (jakarta.xml.soap.SOAPException)5 IOException (java.io.IOException)5 InetSocketAddress (java.net.InetSocketAddress)5 SQLException (java.sql.SQLException)5 Statement (java.sql.Statement)5 HashMap (java.util.HashMap)5 ExecutorService (java.util.concurrent.ExecutorService)5 WSDLException (javax.wsdl.WSDLException)5 TransformerException (javax.xml.transform.TransformerException)5