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;
}
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());
// }
}
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;
}
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");
}
}
Aggregations