Examples of EchoServicePortProxy


Examples of org.apache.axis2.jaxws.samples.client.echo.EchoServicePortProxy

     * @return String from the service
     */
    public String buildEcho(String endpointURL, URL wsdlURL, String input) {
        String response = "ERROR!:";
        try {
            EchoServicePortProxy echo = new EchoServicePortProxy(wsdlURL);
            echo._getDescriptor().setEndpoint(endpointURL);

            // Configure SOAPAction properties
            BindingProvider bp = (BindingProvider) (echo._getDescriptor()
                    .getProxy());
            bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                    endpointURL);
            bp.getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY,
                    Boolean.TRUE);
            bp.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY,
                    "echoOperation");

            // Build the input object
            EchoStringInput echoParm =
                    new org.apache.axis2.jaxws.samples.echo.ObjectFactory().createEchoStringInput();
            echoParm.setEchoInput(input);
            System.out.println(">> CLIENT: SEI Echo to " + endpointURL);

            // Call the service
            response = echo.echoOperation(echoParm).getEchoResponse();
            System.out.println(">> CLIENT: SEI Echo invocation complete.");
            System.out.println(">> CLIENT: SEI Echo response is: " + response);
        } catch (Exception e) {
            System.out.println(">> CLIENT: ERROR: SEI Echo EXCEPTION.");
            e.printStackTrace();
View Full Code Here

Examples of org.apache.axis2.jaxws.samples.client.echo.EchoServicePortProxy

     * @return String from the service
     */
    public String buildAsync(String endpointURL, URL wsdlURL, String input, int waiting, Boolean wireasync) {
        String response = "ERROR!:";
        try {
            EchoServicePortProxy echo = new EchoServicePortProxy(wsdlURL);
            echo._getDescriptor().setEndpoint(endpointURL);

            // Configure SOAPAction properties
            BindingProvider bp = (BindingProvider) (echo._getDescriptor()
                    .getProxy());
            bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                    endpointURL);
            bp.getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY,
                    Boolean.TRUE);
            bp.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY,
                    "echoOperation");
            if (wireasync) {
                bp.getRequestContext().put(org.apache.axis2.jaxws.util.Constants.USE_ASYNC_MEP,
                        Boolean.TRUE);
            }

            // Set up the callback handler and create the input object
            EchoServiceCallbackHandler callbackHandler = new EchoServiceCallbackHandler();
            EchoStringInput echoParm =
                    new org.apache.axis2.jaxws.samples.echo.ObjectFactory().createEchoStringInput();
            echoParm.setEchoInput(input);
            System.out.println(">> CLIENT: SEI Async to " + endpointURL);

            // Call the service
            Future<?> resp = echo.echoOperationAsync(echoParm, callbackHandler);
            Thread.sleep(1000);
            while (!resp.isDone()) {
                // Check for timeout
                if (waiting <= 0) {
                    System.out
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.