Search in sources :

Example 66 with Endpoint

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

the class EndpointEPRTester method testProviderEndpointMSCEPR.

public void testProviderEndpointMSCEPR() {
    int port = Util.getFreePort();
    String address = "http://127.0.0.1:" + port + "/";
    Endpoint e = Endpoint.create(HTTPBinding.HTTP_BINDING, new MyProvider());
    e.publish(address);
    MemberSubmissionEndpointReference epr = e.getEndpointReference(MemberSubmissionEndpointReference.class);
    e.stop();
    EprUtil.validateEPR(epr, address, null, null, null, Boolean.FALSE);
    printEPR(epr);
}
Also used : Endpoint(jakarta.xml.ws.Endpoint) MemberSubmissionEndpointReference(com.sun.xml.ws.developer.MemberSubmissionEndpointReference) Endpoint(jakarta.xml.ws.Endpoint)

Example 67 with Endpoint

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

the class EndpointWsdlLocationTester method testHtmlPage.

public void testHtmlPage() throws Exception {
    int port = Util.getFreePort();
    String address = "http://localhost:" + port + "/hello";
    Endpoint endpoint = Endpoint.create(new RpcLitEndpointWsdlLocation());
    endpoint.publish(address);
    URL pubUrl = new URL(address);
    URLConnection con = pubUrl.openConnection();
    InputStream is = con.getInputStream();
    int ch;
    while ((ch = is.read()) != -1) ;
    assertTrue(con.getContentType().contains("text/html"));
    endpoint.stop();
}
Also used : Endpoint(jakarta.xml.ws.Endpoint) Endpoint(jakarta.xml.ws.Endpoint) URL(java.net.URL) URLConnection(java.net.URLConnection)

Example 68 with Endpoint

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

the class EndpointWsdlLocationTester method testWsdlLocation1.

// The published WSDL is wrong as we are not setting metadata
public void testWsdlLocation1() throws Exception {
    int port = Util.getFreePort();
    String address = "http://localhost:" + port + "/hello";
    Endpoint endpoint = Endpoint.create(new RpcLitEndpointWsdlLocation());
    endpoint.publish(address);
    URL pubUrl = new URL(address + "?wsdl");
    boolean gen = isGenerated(pubUrl.openStream());
    assertFalse(gen);
    invoke(address);
    endpoint.stop();
}
Also used : Endpoint(jakarta.xml.ws.Endpoint) Endpoint(jakarta.xml.ws.Endpoint) URL(java.net.URL)

Example 69 with Endpoint

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

the class EndpointStopper method deploy.

static Endpoint deploy() throws Exception {
    List<Source> metadata = new ArrayList<Source>();
    metadata.add(new StreamSource(Deploy3.class.getResourceAsStream("/WEB-INF/wsdl/EchoInnerService_schema1.xsd"), "file://WEB-INF/wsdl/EchoInnerService_schema1.xsd"));
    metadata.add(new StreamSource(Deploy3.class.getResourceAsStream("/WEB-INF/wsdl/EchoInnerService.wsdl"), "file://WEB-INF/wsdl/EchoInnerService.wsdl"));
    // properties = {
    // }
    Map properties = new HashMap();
    // testEndpoint.className = fromjava.innerclass.EchoImpl.EchoInner
    Object endpointImpl = fromjava.innerclass.EchoImpl.EchoInner.class.newInstance();
    Endpoint endpoint = Endpoint.create(endpointImpl);
    endpoint.setMetadata(metadata);
    endpoint.setProperties(properties);
    String address = "http://localhost:" + DEPLOY_PORT + "/fromjava.innerclass/EchoImpl.EchoInner";
    System.out.println("Deploying endpoint to [" + address + "]");
    endpoint.publish(address);
    return endpoint;
}
Also used : Endpoint(jakarta.xml.ws.Endpoint)

Example 70 with Endpoint

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

the class DynamicPublishTest method testDeployFail.

// Publish a webservice when data-binding files are generated dynamically.
public void testDeployFail() throws Exception {
    Endpoint endpoint = Endpoint.create(new GenericWithEnums());
    endpoint.publish("http://localhost:" + PortAllocator.getFreePort() + "/GenericWithEnumsservice.org/GenericWithEnums");
    endpoint.stop();
}
Also used : 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