Package javax.xml.ws

Examples of javax.xml.ws.Endpoint


        }
    }

    @Override
    public Endpoint createAndPublishEndpoint(String url, Object implementor) {
        Endpoint ep = createEndpoint(null, implementor);
        ep.publish(url);
        return ep;
    }
View Full Code Here


        return ep;
    }
    //new in 2.2
    public Endpoint createAndPublishEndpoint(String address,
                                             Object implementor, WebServiceFeature ... features) {
        Endpoint ep = createEndpoint(null, implementor, features);
        ep.publish(address);
        return ep;
    }
View Full Code Here

    }
   
   
    @Test
    public void testGetBinding() throws Exception {
        Endpoint ep = Endpoint.create("http://schemas.xmlsoap.org/wsdl/soap/http", new HelloImpl());
        System.out.println(ep.getBinding().getClass());
    }
View Full Code Here

            e.printStackTrace();
        }
    }

    private void doPublish(String url, Object obj) {
        Endpoint ep = Endpoint.create(obj);
        ep.getProperties().put(SecurityConstants.CALLBACK_HANDLER + ".sct", new KeystorePasswordCallback());
        ep.getProperties().put(SecurityConstants.ENCRYPT_PROPERTIES + ".sct",
                "org/apache/cxf/systest/ws/wssec11/server/bob.properties");
       
        if (url.contains("X10_I")) {
            ep.getProperties().put(SecurityConstants.SIGNATURE_PROPERTIES + ".sct",
                    "org/apache/cxf/systest/ws/wssec11/server/bob.properties");
            ep.getProperties().put(SecurityConstants.ENCRYPT_PROPERTIES + ".sct",
                    "org/apache/cxf/systest/ws/wssec11/server/alice.properties");
        } else if (url.contains("MutualCert")) {
            ep.getProperties().put(SecurityConstants.ENCRYPT_PROPERTIES + ".sct",
                "org/apache/cxf/systest/ws/wssec11/server/bob.properties");
            ep.getProperties().put(SecurityConstants.SIGNATURE_PROPERTIES + ".sct",
                "org/apache/cxf/systest/ws/wssec11/server/alice.properties");
            ep.getProperties().put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
        }
        ep.publish(url);
    }
View Full Code Here

        String path = "/echo";
        String address = "http://localhost:" + currentPort + contextPath + path;

        HttpContext context = GrizzlyHttpContextFactory.createHttpContext(server, contextPath, path);

        Endpoint endpoint = Endpoint.create(new EndpointBean());
        endpoint.publish(context); // Use grizzly HTTP context for publishing
       
        server.start();

        invokeEndpoint(address);
       
        endpoint.stop();
    }
View Full Code Here

        //need to use the same HttpContext, otherwise Grizzly get confused
        HttpContext ctx = GrizzlyHttpContextFactory.createHttpContext(server, contextPath, path);
        for (int i = 0; i < 3; i++) {
            String address = "http://localhost:" + currentPort + contextPath + path;

            Endpoint endpoint = Endpoint.create(new EndpointBean());
            endpoint.publish(ctx); // Use grizzly HTTP context for publishing

            invokeEndpoint(address);

            endpoint.stop();
        }
    }
View Full Code Here

    protected void run()  {
        System.setProperty("org.apache.cxf.bus.factory", "org.apache.cxf.bus.CXFBusFactory")
        Object implementor = new PutLastTradedPriceImpl();
        String address = "http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPort";     
        Endpoint ep = Endpoint.create(implementor);
        Map<String, Object> props = new HashMap<String, Object>(2);
        props.put(Endpoint.WSDL_SERVICE, new QName("http://apache.org/hello_world_doc_lit_bare",
                                                   "SOAPService"));
        props.put(Endpoint.WSDL_PORT, new QName("http://apache.org/hello_world_doc_lit_bare", "SoapPort"));
        ep.setProperties(props);
        ep.publish(address);
    }
View Full Code Here

public class WSDLAddressRewriteTest extends AbstractBusClientServerTestBase {
    public static final String PORT = allocatePort(WSDLAddressRewriteTest.class);
    @Test
    public void testWithSameAddress() throws Exception {
        Endpoint endpoint = null;
        try {
            endpoint = publishEndpoint(false);
            String soapAddressLine = getSoapAddressLine("localhost");
            assertTrue(soapAddressLine.contains("address location=\"http://localhost"));
        } finally {
            if (endpoint != null) {
                endpoint.stop();
            }
        }
        try {
            endpoint = publishEndpoint(true);
            String soapAddressLine = getSoapAddressLine("localhost");
            assertTrue(soapAddressLine.contains("address location=\"http://localhost"));
        } finally {
            if (endpoint != null) {
                endpoint.stop();
            }
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testWithEquivalentAddress() throws Exception {
        Endpoint endpoint = null;
        try {
            endpoint = publishEndpoint(false);
            String soapAddressLine = getSoapAddressLine("127.0.0.1");
            assertTrue(soapAddressLine.contains("address location=\"http://localhost"));
        } finally {
            if (endpoint != null) {
                endpoint.stop();
            }
        }
        //now test enabling the autoRewrite; this should be used when having multiple
        //addresses (belonging to different networks) for a single server instance
        try {
            endpoint = publishEndpoint(true);
            String soapAddressLine = getSoapAddressLine("127.0.0.1");
            assertTrue(soapAddressLine.contains("address location=\"http://127.0.0.1"));
        } finally {
            if (endpoint != null) {
                endpoint.stop();
            }
        }
    }
View Full Code Here

        s.close();
        return line;
    }

    private Endpoint publishEndpoint(boolean autoRewriteSoapAddress) {
        Endpoint endpoint = Endpoint.publish("http://localhost:" + PORT + "/SoapContext/GreeterPort",
                                             new GreeterImpl());
        EndpointInfo ei = ((EndpointImpl)endpoint).getServer().getEndpoint().getEndpointInfo();
        ei.setProperty("autoRewriteSoapAddress", autoRewriteSoapAddress);
        return endpoint;
    }
View Full Code Here

TOP

Related Classes of javax.xml.ws.Endpoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.