Package org.apache.axis2.client

Examples of org.apache.axis2.client.ServiceClient.addHeader()


        options.setTo(new EndpointReference(addUrl));
        options.setAction(action);
        options.setProperty(MessageContext.TRANSPORT_NON_BLOCKING,
                Boolean.FALSE); // set for fire and foget
        serviceClient.setOptions(options);
        serviceClient.addHeader(topicOm);
        OMElement payload =
                AXIOMUtil.stringToOM("<m:placeOrder xmlns:m=\"http://services.samples\">\n" +
                        "    <m:order>\n" +
                        "        <m:price>" + price + "</m:price>\n" +
                        "        <m:quantity>" + qty + "</m:quantity>\n" +
View Full Code Here


            serviceClient.engageModule("addressing");
            options.setTo(new EndpointReference(addUrl));
            options.setAction("http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe");
            OMElement identifierOm = factory.createOMElement("Identifier", nswse);
            factory.createOMText(identifierOm, identifier);
            serviceClient.addHeader(identifierOm);
            serviceClient.setOptions(options);
            System.out.println("UnSubscribing \n" + subscribeOm.toString());
            try {
                OMElement response = serviceClient.sendReceive(subscribeOm);
                System.out.println("UnSubscribed to ID " + identifier);
View Full Code Here

            serviceClient.engageModule("addressing");
            options.setTo(new EndpointReference(addUrl));
            options.setAction("http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew");
            OMElement identifierOm = factory.createOMElement("Identifier", nswse);
            factory.createOMText(identifierOm, identifier);
            serviceClient.addHeader(identifierOm);
            serviceClient.setOptions(options);
            System.out.println("SynapseSubscription Renew \n" + subscribeOm.toString());
            try {
                OMElement response = serviceClient.sendReceive(subscribeOm);
                System.out.println("SynapseSubscription Renew to ID " + identifier);
View Full Code Here

            serviceClient.engageModule("addressing");
            options.setTo(new EndpointReference(addUrl));
            options.setAction("http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus");
            OMElement identifierOm = factory.createOMElement("Identifier", nswse);
            factory.createOMText(identifierOm, identifier);
            serviceClient.addHeader(identifierOm);
            serviceClient.setOptions(options);
            System.out.println("GetStatus using \n" + subscribeOm.toString());
            try {
                OMElement response = serviceClient.sendReceive(subscribeOm);
                System.out.println("GetStatus to ID " + identifier);
View Full Code Here

        options.setTo(new EndpointReference(addUrl));
        options.setAction(action);
        options.setProperty(MessageContext.CLIENT_API_NON_BLOCKING,
                Boolean.FALSE); // set for fire and foget
        serviceClient.setOptions(options);
        serviceClient.addHeader(topicOm);
        OMElement payload =
                AXIOMUtil.stringToOM("<m:placeOrder xmlns:m=\"http://services.samples\">\n" +
                        "    <m:order>\n" +
                        "        <m:price>" + price + "</m:price>\n" +
                        "        <m:quantity>" + qty + "</m:quantity>\n" +
View Full Code Here

                    OMNamespace omNamespace = OMAbstractFactory.getOMFactory().createOMNamespace(
                            "http://sample.com", "myNs");
                    SOAPHeaderBlock header = OMAbstractFactory.getSOAP12Factory()
                            .createSOAPHeaderBlock("VitalHeader", omNamespace);
                    header.addChild(AXIOMUtil.stringToOM("<foo>This is a sample Header</foo>"));
                    serviceClient.addHeader(header);
                }
               
                // Invoking the serive in the TestCase-28 should fail. So handling it differently..
                if (i == 28) {
                    try {
View Full Code Here

        Options options = new Options();
        options.setTo(new EndpointReference(endpoint));
        options.setAction(EventingConstants.WSE_PUBLISH);
        serviceClient.setOptions(options);
        serviceClient.addHeader(topicHeader);

        if (tenantDomainHeader != null){
            serviceClient.addHeader(tenantDomainHeader);
        }
View Full Code Here

        options.setAction(EventingConstants.WSE_PUBLISH);
        serviceClient.setOptions(options);
        serviceClient.addHeader(topicHeader);

        if (tenantDomainHeader != null){
            serviceClient.addHeader(tenantDomainHeader);
        }

        serviceClient.fireAndForget(payload);
    }
View Full Code Here

        options.setTo(new EndpointReference(trpUrl));
//    options.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES,Boolean.TRUE);
    options.setProperty(HTTPConstants.CHUNKED, false);

    serviceClient.setOptions(options);
        serviceClient.addHeader(getPaypalWSTestHeader());
    OMElement element = serviceClient.sendReceive(payload);
    printResult(element);

    Thread.sleep(3600);
View Full Code Here

                    OMNamespace omNamespace = OMAbstractFactory.getOMFactory().createOMNamespace(
                            "http://sample.com", "myNs");
                    SOAPHeaderBlock header = OMAbstractFactory.getSOAP12Factory()
                            .createSOAPHeaderBlock("VitalHeader", omNamespace);
                    header.addChild(AXIOMUtil.stringToOM("<foo>This is a sample Header</foo>"));
                    serviceClient.addHeader(header);
                }
               
                // Invoking the serive in the TestCase-28 should fail. So handling it differently..
                if (i == 28) {
                    try {
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.