Example usage for javax.xml.ws Endpoint publish

List of usage examples for javax.xml.ws Endpoint publish

Introduction

In this page you can find the example usage for javax.xml.ws Endpoint publish.

Prototype

public static Endpoint publish(String address, Object implementor) 

Source Link

Document

Creates and publishes an endpoint for the specified implementor object at the given address.

Usage

From source file:com.mycompany.gdp_service.Main.java

public static void main(String[] args) throws URISyntaxException {

    Integer port = Integer.valueOf(System.getenv("PORT"));

    URIBuilder builder = new URIBuilder();
    URI address = builder.setScheme("http").setPath("0.0.0.0").setPort(port).build();

    Endpoint.publish("http://0.0.0.0:" + port + "/gdp", new GDPImpl());
    Endpoint.publish("address", new GDPImpl());
}

From source file:Result.java

public static void main(String[] args) {
    Endpoint.publish("http://localhost:8084/service", new Main());
}

From source file:WebLauncher.java

public static void main(String[] args) {
    DirectJNI.init();//  w ww. ja  v  a2s.  co m
    for (String className : DirectJNI._rPackageInterfacesHash.keySet()) {
        String shortClassName = className.substring(className.lastIndexOf('.') + 1);
        try {
            Class packageWebClass = DirectJNI._mappingClassLoader.loadClass(className + "Web");
            if (packageWebClass.getDeclaredMethods().length > 0) {
                try {
                    String url = "http://localhost:8080/" + "ws/" + shortClassName;
                    Endpoint.publish(url, packageWebClass.newInstance());
                    System.out.println(shortClassName + "Web" + " has been successfully published to " + url);
                } catch (Exception ie) {
                    ie.printStackTrace();
                }
            }
        } catch (ClassNotFoundException e) {
        }
    }
}

From source file:org.apache.servicemix.camel.nmr.CxfMessageTest.java

protected void startService() {
    Object implementor = new PersonImpl();
    String address = "http://localhost:19000/PersonService/";
    Endpoint.publish(address, implementor);
}

From source file:nz.co.senanque.workflow.WorkflowWithRules2Test.java

@BeforeClass
public static void start() {
    s_endpoint = Endpoint.publish("http://localhost:8080/WS/MyService", new MyServiceImpl());
}

From source file:org.kuali.student.enrollment.courseoffering.service.DequeuerCallbackListener.java

public void initSubscription() {
    Endpoint.publish("http://localhost:9000/SoapContext/SoapPort", this);
    log.info("DequeuerCallbackListener published itself as a subscription endpoint");
}

From source file:com.github.mavenplugins.doctest.ShowcaseDoctest.java

@Before
public void startServer() throws Exception {
    SimpleService service = new SimpleService();
    endpoint = Endpoint.publish("http://localhost:8080/someService", service);
}

From source file:de.intevation.test.irixservice.UploadReportTest.java

/**
 * Test that the webservice can be created and accepts a valid report.
 *//*from   www .j  a v a 2 s  .  c o  m*/
@Test
public void testServiceCreated() throws MalformedURLException, IOException, UploadReportException {
    Endpoint endpoint = Endpoint.publish("http://localhost:18913/upload-report", testObj);
    Assert.assertTrue(endpoint.isPublished());
    Assert.assertEquals("http://schemas.xmlsoap.org/wsdl/soap/http", endpoint.getBinding().getBindingID());

    URL wsdlDocumentLocation = new URL("http://localhost:18913/upload-report?wsdl");
    String namespaceURI = "http://irixservice.intevation.de/";
    String servicePart = "UploadReportService";
    String portName = "UploadReportPort";
    QName serviceQN = new QName(namespaceURI, servicePart);
    QName portQN = new QName(namespaceURI, portName);

    Service serv = Service.create(wsdlDocumentLocation, serviceQN);
    UploadReportInterface service = serv.getPort(portQN, UploadReportInterface.class);
    ReportType report = getReportFromFile(VALID_REPORT);
    service.uploadReport(report);
    String uuid = report.getIdentification().getReportUUID();
    String expectedPath = testObj.outputDir + "/" + uuid + ".xml";
    Assert.assertTrue(new File(expectedPath).exists());
}

From source file:com.netsteadfast.greenstep.sys.PublishingCXFServlet.java

private int publishDefault(Bus bus, List<TbSysWsConfig> configs) {
    int c = 0;//from  w w  w. ja  va2  s  . co  m
    for (TbSysWsConfig config : configs) {
        if (!WSConfig.TYPE_SOAP.equals(config.getType()) || StringUtils.isBlank(config.getPublishAddress())) {
            continue;
        }
        try {
            Endpoint.publish(config.getPublishAddress(), AppContext.getBean(config.getBeanId()));
            c++;
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    return c;
}

From source file:se.vgregion.delegation.server.Server.java

static private void startService(Object serviceImpl, String address) {
    Endpoint endpoint = Endpoint.publish(address, serviceImpl);
    Server.getEndpoints().add(endpoint);
    LOGGER.info("Service available at: " + address + "?wsdl");
}