Search in sources :

Example 1 with EndpointImpl

use of com.sun.xml.ws.transport.http.server.EndpointImpl in project metro-jax-ws by eclipse-ee4j.

the class ProviderImpl method createAndPublishEndpoint.

public Endpoint createAndPublishEndpoint(String address, Object implementor, WebServiceFeature... features) {
    Endpoint endpoint = new EndpointImpl(BindingID.parse(implementor.getClass()), implementor, features);
    endpoint.publish(address);
    return endpoint;
}
Also used : Endpoint(jakarta.xml.ws.Endpoint) WSEndpoint(com.sun.xml.ws.api.server.WSEndpoint) BoundEndpoint(com.sun.xml.ws.api.server.BoundEndpoint) EndpointImpl(com.sun.xml.ws.transport.http.server.EndpointImpl)

Example 2 with EndpointImpl

use of com.sun.xml.ws.transport.http.server.EndpointImpl 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 3 with EndpointImpl

use of com.sun.xml.ws.transport.http.server.EndpointImpl in project metro-jax-ws by eclipse-ee4j.

the class ProviderImpl method createAndPublishEndpoint.

@Override
public Endpoint createAndPublishEndpoint(String address, Object implementor) {
    Endpoint endpoint = new EndpointImpl(BindingID.parse(implementor.getClass()), implementor);
    endpoint.publish(address);
    return endpoint;
}
Also used : Endpoint(jakarta.xml.ws.Endpoint) WSEndpoint(com.sun.xml.ws.api.server.WSEndpoint) BoundEndpoint(com.sun.xml.ws.api.server.BoundEndpoint) EndpointImpl(com.sun.xml.ws.transport.http.server.EndpointImpl)

Example 4 with EndpointImpl

use of com.sun.xml.ws.transport.http.server.EndpointImpl in project metro-jax-ws by eclipse-ee4j.

the class PublishWSDLTest method testPublishWSDL.

public void testPublishWSDL() {
    PublishWSDLTestWs service = new PublishWSDLTestWs();
    String address = "http://localhost:9999/hello";
    Endpoint endpoint = new EndpointImpl(BindingID.parse(service.getClass()), service);
    endpoint.publish(address);
    Properties props = System.getProperties();
    props.setProperty("com.sun.xml.ws.wsdl.externalSchemaLocationURL", "true");
    try {
        URL wsdlUrl = new URL(address + "?wsdl");
        InputStream in = wsdlUrl.openStream();
        Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(in);
        NodeList importNodes = doc.getElementsByTagName("xsd:import");
        Assert.assertEquals("PublishWSDLTestWsService_schema1.xsd", importNodes.item(0).getAttributes().getNamedItem("schemaLocation").getNodeValue());
        endpoint.stop();
    } catch (Exception ex) {
        ex.printStackTrace();
        fail(ex.getMessage());
    } finally {
        System.clearProperty("com.sun.xml.ws.wsdl.externalSchemaLocationURL");
    }
}
Also used : Endpoint(jakarta.xml.ws.Endpoint) EndpointImpl(com.sun.xml.ws.transport.http.server.EndpointImpl) NodeList(org.w3c.dom.NodeList) Properties(java.util.Properties) Document(org.w3c.dom.Document) URL(java.net.URL)

Aggregations

EndpointImpl (com.sun.xml.ws.transport.http.server.EndpointImpl)4 Endpoint (jakarta.xml.ws.Endpoint)4 WSEndpoint (com.sun.xml.ws.api.server.WSEndpoint)3 BoundEndpoint (com.sun.xml.ws.api.server.BoundEndpoint)2 HttpContext (com.sun.net.httpserver.HttpContext)1 URL (java.net.URL)1 Properties (java.util.Properties)1 Document (org.w3c.dom.Document)1 NodeList (org.w3c.dom.NodeList)1