Package org.apache.axiom.soap.impl.llom.soap11

Examples of org.apache.axiom.soap.impl.llom.soap11.SOAP11HeaderImpl


    protected void tearDown() throws Exception {
        rootElement.close(false);
    }

    public void testWithCashAndBuild() throws Exception {
        SOAPFactory soapFactory = new SOAP11Factory();
        SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
        envelope.getBody().addChild(rootElement);
        envelope.getBody().getFirstElement().getXMLStreamReaderWithoutCaching();
    }
View Full Code Here


                                   Map map,ConfigurationContext configCtx) throws AxisFault {
        String[] values =
                Utils.parseRequestURLForServiceAndOperation(requestUrl,
                                                        configCtx.getServiceContextPath());
        if (values == null) {
            return new SOAP11Factory().getDefaultEnvelope();
        }

        if ((values[1] != null) && (values[0] != null)) {
            String srvice = values[0];
            AxisService service = configCtx.getAxisConfiguration().getService(srvice);
            if (service == null) {
                throw new AxisFault("service not found: " + srvice);
            }
            String operation = values[1];
            SOAPFactory soapFactory = new SOAP11Factory();
            SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
//            OMNamespace omNs = soapFactory.createOMNamespace(values[0], "services");
            OMNamespace omNs = soapFactory.createOMNamespace(service.getSchematargetNamespace(),
                                                             service.getSchematargetNamespacePrefix());
            //OMNamespace defualtNs = new OMNamespaceImpl("", null, soapFactory);
            soapFactory.createOMNamespace(service.getSchematargetNamespace(),
                                          service.getSchematargetNamespacePrefix());
            OMElement opElement = soapFactory.createOMElement(operation, omNs);
            Iterator it = map.keySet().iterator();

            while (it.hasNext()) {
                String name = (String) it.next();
                String value = (String) map.get(name);
                OMElement omEle = soapFactory.createOMElement(name, omNs);

                omEle.setText(value);
                opElement.addChild(omEle);
            }
View Full Code Here

                                // If the content Type is text/xml (BTW which is the SOAP 1.1 Content type ) and
                                // the SOAP Action is absent it is rest !!
                                msgContext.setDoingREST(true);

                                SOAPFactory soapFactory = new SOAP11Factory();

                                builder = new StAXOMBuilder(xmlreader);
                                builder.setOMBuilderFactory(soapFactory);
                                envelope = soapFactory.getDefaultEnvelope();
                                envelope.getBody().addChild(builder.getDocumentElement());
                            }
                        } else {
                            builder = new StAXSOAPModelBuilder(
                                    xmlreader, SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
View Full Code Here

                        (String) contentType,true);
                envelope = (SOAPEnvelope) builder.getDocumentElement();
            } else if (msgContext.isDoingREST()) {
                XMLStreamReader xmlreader =
                        StAXUtils.createXMLStreamReader(inStream, charSetEnc);
                SOAPFactory soapFactory = new SOAP11Factory();

                builder = new StAXOMBuilder(xmlreader);
                builder.setOMBuilderFactory(soapFactory);
                envelope = soapFactory.getDefaultEnvelope();
                envelope.getBody().addChild(builder.getDocumentElement());
               
                // We now have the message inside an envolope. However, this is
                // only an OM; We need to build a SOAP model from it.
View Full Code Here

    public static SOAPEnvelope createEnvelopeFromGetRequest(String requestUrl, Map map,
                                                            ConfigurationContext configurationContext) throws AxisFault {
        String[] values = Utils.parseRequestURLForServiceAndOperation(requestUrl);

        if (values == null) {
            return new SOAP11Factory().getDefaultEnvelope();
        }

        if ((values[1] != null) && (values[0] != null)) {
            String srvice = values[0];
            AxisService service = configurationContext.getAxisConfiguration().getService(srvice);
            if (service == null) {
                throw new AxisFault("service not found: " + srvice);
            }
            String operation = values[1];
            SOAPFactory soapFactory = new SOAP11Factory();
            SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
//            OMNamespace omNs = soapFactory.createOMNamespace(values[0], "services");
            OMNamespace omNs = soapFactory.createOMNamespace(service.getSchematargetNamespace(),
                    service.getSchematargetNamespacePrefix());
            //OMNamespace defualtNs = new OMNamespaceImpl("", null, soapFactory);
            soapFactory.createOMNamespace(service.getSchematargetNamespace(),
                    service.getSchematargetNamespacePrefix());
            OMElement opElement = soapFactory.createOMElement(operation, omNs);
            Iterator it = map.keySet().iterator();

            while (it.hasNext()) {
                String name = (String) it.next();
                String value = (String) map.get(name);
                OMElement omEle = soapFactory.createOMElement(name, omNs);

                omEle.setText(value);
                opElement.addChild(omEle);
            }
View Full Code Here

                                // If the content Type is text/xml (BTW which is the SOAP 1.1 Content type ) and
                                // the SOAP Action is absent it is rest !!
                                msgContext.setDoingREST(true);

                                SOAPFactory soapFactory = new SOAP11Factory();

                                builder = new StAXOMBuilder(xmlreader);
                                builder.setOMBuilderFactory(soapFactory);
                                envelope = soapFactory.getDefaultEnvelope();
                                envelope.getBody().addChild(builder.getDocumentElement());
                            }
                        } else {
                            builder = new StAXSOAPModelBuilder(
                                    xmlreader, SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
View Full Code Here

                        (String) contentType);
                envelope = (SOAPEnvelope) builder.getDocumentElement();
            } else if (msgContext.isDoingREST()) {
                XMLStreamReader xmlreader =
                        StAXUtils.createXMLStreamReader(inStream, charSetEnc);
                SOAPFactory soapFactory = new SOAP11Factory();

                builder = new StAXOMBuilder(xmlreader);
                builder.setOMBuilderFactory(soapFactory);
                envelope = soapFactory.getDefaultEnvelope();
                envelope.getBody().addChild(builder.getDocumentElement());
               
                // We now have the message inside an envolope. However, this is
                // only an OM; We need to build a SOAP model from it.
View Full Code Here

       
        // get message object and convert to SOAPEnvelope
        OMElement omEnvelope = messageContext.getMessage().getAsOMElement();
       
        // confirm headers are there.  I can cast here only because I know the implementation.  :)
        SOAP11HeaderImpl omHeader = (SOAP11HeaderImpl)omEnvelope.getChildElements().next();

        Iterator<OMSourcedElementImpl> it = omHeader.getChildElements();
        // TODO: not sure if the order of the header additions is or should be preserved.
        // in other words, this test may be a little too strict.
        OMSourcedElementImpl headerElem1 = it.next();
        OMSourcedElementImpl headerElem2 = it.next();
        // should only be two header elements, so...
View Full Code Here

       
        // get message object and convert to SOAPEnvelope
        OMElement omEnvelope = messageContext.getMessage().getAsOMElement();
       
        // confirm headers are there.  I can cast here only because I know the implementation.  :)
        SOAP11HeaderImpl omHeader = (SOAP11HeaderImpl)omEnvelope.getChildElements().next();

        Iterator<OMSourcedElementImpl> it = omHeader.getChildElements();
        // TODO: not sure if the order of the header additions is or should be preserved.
        // in other words, this test may be a little too strict.
        OMSourcedElementImpl headerElem1 = it.next();
        OMSourcedElementImpl headerElem2 = it.next();
        // should only be two header elements, so...
View Full Code Here

       
        // get message object and convert to SOAPEnvelope
        OMElement omEnvelope = messageContext.getMessage().getAsOMElement();
       
        // confirm headers are there.  I can cast here only because I know the implementation.  :)
        SOAP11HeaderImpl omHeader = (SOAP11HeaderImpl)omEnvelope.getChildElements().next();

        Iterator<OMSourcedElementImpl> it = omHeader.getChildElements();
        // TODO: not sure if the order of the header additions is or should be preserved.
        // in other words, this test may be a little too strict.
        OMSourcedElementImpl headerElem1 = it.next();
        OMSourcedElementImpl headerElem2 = it.next();
        // should only be two header elements, so...
View Full Code Here

TOP

Related Classes of org.apache.axiom.soap.impl.llom.soap11.SOAP11HeaderImpl

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.