Package org.apache.axis2.clientapi

Examples of org.apache.axis2.clientapi.Call


                    fac.createText(value,
                            "Isaac Assimov, the foundation Sega"));
            method.addChild(value);
//            reqEnv.getBody().addChild(method);

            Call call = new Call("target/test-resources/intregrationRepo");
            EndpointReference targetEPR =
                    new EndpointReference("http://127.0.0.1:"
                    + (UtilServer.TESTING_PORT)
                    + "/axis/services/EchoXMLService1");
            call.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    false);
            call.setTo(targetEPR);
            SOAPEnvelope resEnv =
                    (SOAPEnvelope) call.invokeBlocking(
                            operationName.getLocalPart(), method);

            SOAPBody sb = resEnv.getBody();
            if (sb.hasFault()) {
                throw new AxisFault(
View Full Code Here


    public void testCorrectSOAPEnvelope() throws Exception {

        OMElement payload = TestingUtils.createDummyOMElement();

        Call call =
                new Call("target/test-resources/intregrationRepo");

        call.setTo(targetEPR);
        call.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP,
                false);

        OMElement result = call.invokeBlocking(
                operationName.getLocalPart(), payload);
        TestingUtils.campareWithCreatedOMElement(result);
        call.close();
    }
View Full Code Here

           
            //parse the omEnvelope element and stuff it with the attachment
            //specific omText nodes
            insertAttachmentNodes(envelope, request);

            Call call = new Call();
            URL url = new URL(endpoint.toString());
            call.set(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
            call.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    false);
            call.setTo(
                    new EndpointReference(url.toString()));
            String axisOp = request.getSOAPBody().getFirstChild().getNodeName();
            NodeImpl bodyContentNode = (NodeImpl)request.getSOAPBody().getFirstChild();
            OMElement bodyContent = (OMElement)bodyContentNode.getOMNode();
            OMElement result = call.invokeBlocking(axisOp, bodyContent);
            org.apache.axis2.soap.SOAPEnvelope responseEnv = (org.apache.axis2.soap.SOAPEnvelope) ((OMElement)result.getParent()).getParent();
            SOAPEnvelopeImpl response = new SOAPEnvelopeImpl(responseEnv);
           
            SOAPMessageImpl sMsg = new SOAPMessageImpl(response);
            extractAttachmentNodes(responseEnv, sMsg);
View Full Code Here

     * @throws AxisFault
     */
    public static void sendMsg() throws AxisFault {
        search.trim();
        prevSearch = search;
        Call call = new Call();
        URL url = null;
        try {
            url =
                    new URL("http",
                            "soap.amazon.com",
                            "/onca/soap?Service=AlexaWebInfoService");

            /** Uncomment the folowing to use TCP Monitor, and comment the above */

            //url = new URL("http", "localhost",8080, "/onca/soap?Service=AlexaWebInfoService");

        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        call.setTo(
                new EndpointReference(url.toString()));
        MessageContext requestContext = ClientUtil.getMessageContext();
        try {
            call.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    false);

//            System.out.println("Sending the Async message ....");
            requestContext.getEnvelope().serialize(
                    XMLOutputFactory.newInstance()
                            .createXMLStreamWriter
                            (System.out));
            QName opName = new QName("urn:GoogleSearch", "doGoogleSearch");
            OperationDescription opdesc = new OperationDescription(opName);
            call.invokeNonBlocking(opdesc,
                    requestContext,
                    new ClientCallbackHandler());
        } catch (AxisFault e1) {
            e1.printStackTrace();
        } catch (XMLStreamException e) {
View Full Code Here

     * @throws AxisFault
     */
    public static void sendMsg() throws AxisFault {
        search.trim();
        prevSearch = search;
        Call call = new Call();
        URL url = null;
        try {
            url = new URL("http", "soap.amazon.com", "/onca/soap?Service=AlexaWebInfoService");

            /** Uncomment the folowing to use TCP Monitor, and comment the above */

            //url = new URL("http", "localhost",8080, "/onca/soap?Service=AlexaWebInfoService");

        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        call.setTo(new EndpointReference(AddressingConstants.WSA_TO, url.toString()));
        MessageContext requestContext = ClientUtil.getMessageContext();
        try {
            call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);

            System.out.println("Sending the Async message ....");

           OMOutput omOutput = new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter
                    (System.out));
            requestContext.getEnvelope().serialize(omOutput);
            omOutput.flush();

            System.out.println();
            QName opName = new QName("urn:GoogleSearch", "doGoogleSearch");
            OperationDescription opdesc = new OperationDescription(opName);
            call.invokeNonBlocking(opdesc, requestContext, new ClientCallbackHandler());
        } catch (AxisFault e1) {
            e1.printStackTrace();
        } catch (XMLStreamException e) {
            e.printStackTrace();
        }
View Full Code Here

  public SOAPMessage call(SOAPMessage request, Object endpoint)
      throws SOAPException {
    try{
      org.apache.axis2.soap.SOAPEnvelope envelope = ((SOAPEnvelopeImpl)request.getSOAPPart().getEnvelope()).getOMEnvelope();
     
      Call call = new Call();
      URL url = new URL(endpoint.toString());
      call.setTransportInfo(Constants.TRANSPORT_HTTP,Constants.TRANSPORT_HTTP, true);
      call.setTo(new EndpointReference(AddressingConstants.WSA_TO, url.toString()));
      org.apache.axis2.soap.SOAPEnvelope responseEnv = (org.apache.axis2.soap.SOAPEnvelope)call.invokeBlocking("echo", envelope);
      SOAPEnvelopeImpl response = new SOAPEnvelopeImpl(responseEnv);
      return new SOAPMessageImpl(response);
     
      }catch (MalformedURLException mue) {
        throw new SOAPException(mue);
View Full Code Here

            OMElement value = fac.createOMElement("myValue", omNs);
            value.addChild(fac.createText(value, "Isaac Assimov, the foundation Sega"));
            method.addChild(value);
            reqEnv.getBody().addChild(method);

            Call call = new Call();
            EndpointReference targetEPR =
                new EndpointReference(
                    AddressingConstants.WSA_TO,
                    "http://127.0.0.1:"
                        + (UtilServer.TESTING_PORT)
                        + "/axis/services/EchoXMLService1");
            call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
            call.setTo(targetEPR);
            SOAPEnvelope resEnv =
                (SOAPEnvelope) call.invokeBlocking(operationName.getLocalPart(), reqEnv);

            SOAPBody sb = resEnv.getBody();
            if (sb.hasFault()) {
                throw new AxisFault(sb.getFault().getReason().getSOAPText().getText());
            }
View Full Code Here

                    fac.createText(value,
                            "Isaac Assimov, the foundation Sega"));
            method.addChild(value);
//            reqEnv.getBody().addChild(method);

            Call call = new Call();
            EndpointReference targetEPR =
                    new EndpointReference("http://127.0.0.1:"
                    + (UtilServer.TESTING_PORT)
                    + "/axis/services/EchoXMLService1");
            call.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    false);
            call.setTo(targetEPR);
            SOAPEnvelope resEnv =
                    (SOAPEnvelope) call.invokeBlocking(
                            operationName.getLocalPart(), method);

            SOAPBody sb = resEnv.getBody();
            if (sb.hasFault()) {
                throw new AxisFault(
View Full Code Here

            throws SOAPException {
        try {
            org.apache.axis2.soap.SOAPEnvelope envelope = ((SOAPEnvelopeImpl) request.getSOAPPart()
                    .getEnvelope()).getOMEnvelope();

            Call call = new Call();
            URL url = new URL(endpoint.toString());
            call.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    true);
            call.setTo(
                    new EndpointReference(url.toString()));
            org.apache.axis2.soap.SOAPEnvelope responseEnv = (org.apache.axis2.soap.SOAPEnvelope) call.invokeBlocking(
                    "echo", envelope);
            SOAPEnvelopeImpl response = new SOAPEnvelopeImpl(responseEnv);
            return new SOAPMessageImpl(response);

        } catch (MalformedURLException mue) {
View Full Code Here

     * @throws AxisFault
     */
    public static void sendMsg() throws AxisFault {
        search.trim();
        prevSearch = search;
        Call call = new Call();
        URL url = null;
        try {
            url =
                    new URL("http",
                            "soap.amazon.com",
                            "/onca/soap?Service=AlexaWebInfoService");

            /** Uncomment the folowing to use TCP Monitor, and comment the above */

            //url = new URL("http", "localhost",8080, "/onca/soap?Service=AlexaWebInfoService");

        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        call.setTo(
                new EndpointReference(url.toString()));
        MessageContext requestContext = ClientUtil.getMessageContext();
        try {
            call.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    false);

//            System.out.println("Sending the Async message ....");
            requestContext.getEnvelope().serialize(
                    XMLOutputFactory.newInstance()
                            .createXMLStreamWriter
                            (System.out));
            QName opName = new QName("urn:GoogleSearch", "doGoogleSearch");
            OperationDescription opdesc = new OperationDescription(opName);
            call.invokeNonBlocking(opdesc,
                    requestContext,
                    new ClientCallbackHandler());
        } catch (AxisFault e1) {
            e1.printStackTrace();
        } catch (XMLStreamException e) {
View Full Code Here

TOP

Related Classes of org.apache.axis2.clientapi.Call

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.