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

Examples of org.apache.axiom.soap.impl.dom.soap11.SOAP11BodyImpl


import org.apache.axiom.soap.impl.dom.soap12.SOAP12Factory;

public class SOAPEnvelopeTest extends TestCase {
       
    public void testAppendSOAP11() throws Exception {
        SOAP11Factory factory;
        SOAPEnvelope env;
       
        // SOAP 1.1 allows for arbitrary elements after SOAPBody element
       
        // these addChild() should fail since appending before SOAPBody
        // but they do not at this point (need a better check).
        factory = new SOAP11Factory();
        env = factory.createSOAPEnvelope();
        checkAddChild(env, false);
       
        factory = new SOAP11Factory();
        env = factory.createSOAPEnvelope();
        factory.createSOAPHeader(env);
        checkAddChild(env, false);
       
        // these addChild() should work since appending after SOAPBody  
        factory = new SOAP11Factory();
        env = factory.createSOAPEnvelope();
        factory.createSOAPBody(env)
        checkAddChild(env, false);
       
        factory = new SOAP11Factory();
        env = factory.createSOAPEnvelope();
        factory.createSOAPHeader(env);
        factory.createSOAPBody(env);       
        checkAddChild(env, false);
    }
View Full Code Here


    public SOAPElement addAttribute(QName qname, String value) throws SOAPException {
        OMNamespace omNamespace = null;
        SOAPFactory soapFactory;
        if (this.element.getOMFactory() instanceof SOAP11Factory) {
            soapFactory = new SOAP11Factory();
            omNamespace = soapFactory.createOMNamespace(qname.getNamespaceURI(), qname.getPrefix());
        } else if (this.element.getOMFactory() instanceof SOAP12Factory) {
            soapFactory = new SOAP12Factory();
            omNamespace = soapFactory.createOMNamespace(qname.getNamespaceURI(), qname.getPrefix());
        }
View Full Code Here

                    "DYNAMIC_SOAP_PROTOCOL");
        } else {
            //SOAP 1.1
            soapEnvelope =
                    new SOAPEnvelopeImpl((org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl)
                            new SOAP11Factory().getDefaultEnvelope());
        }
        SOAPMessageImpl soapMessage = new SOAPMessageImpl(soapEnvelope);
        soapMessage.setSaveRequired();
        return soapMessage;
    }
View Full Code Here

        String soapEnvelopeNamespaceURI;
        SOAPFactory soapFactory;
        if (contentType == null) {
            charset = null;
            isMTOM = false;
            soapFactory = new SOAP11Factory();
            soapEnvelopeNamespaceURI = null;
        } else {
            String baseType = contentType.getBaseType().toLowerCase();
            String soapContentType;
            if (baseType.equals(MTOMConstants.MTOM_TYPE)) {
                isMTOM = true;
                String typeParam = contentType.getParameter("type");
                if (typeParam == null) {
                    throw new SOAPException("Missing 'type' parameter in XOP content type");
                } else {
                    soapContentType = typeParam.toLowerCase();
                }
            } else {
                isMTOM = false;
                soapContentType = baseType;
            }
           
            if (soapContentType.equals(HTTPConstants.MEDIA_TYPE_TEXT_XML)) {
                soapEnvelopeNamespaceURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
                soapFactory = new SOAP11Factory();
            } else if (soapContentType.equals(HTTPConstants.MEDIA_TYPE_APPLICATION_SOAP_XML)) {
                soapEnvelopeNamespaceURI = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
                soapFactory = new SOAP12Factory();
            } else {
                throw new SOAPException("Unrecognized content type '" + soapContentType + "'");
View Full Code Here

     * Check parent processing of SOAPMessage
     */
    @Validated @Test
    public void test_parentAccess3() throws Exception {

        SOAP11Factory axiomSF = new SOAP11Factory();
        org.apache.axiom.soap.SOAPEnvelope axiomSE = axiomSF.createSOAPEnvelope();
        org.apache.axiom.soap.SOAPMessage axiomSM = axiomSF.createSOAPMessage(axiomSE, null);
       
        SOAPEnvelopeImpl se =
            new SOAPEnvelopeImpl((org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl)axiomSE);
        SOAPMessageImpl sm = new SOAPMessageImpl(se);
        SOAPPartImpl sp = new SOAPPartImpl(sm, se);
View Full Code Here

                        StAXUtils.createXMLStreamReader(BuilderUtil.getReader(
                                attachments.getSOAPPartInputStream(), charSetEncoding));

                SOAPFactory factory;
                if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapEnvelopeNamespaceURI)) {
                    factory = new SOAP11Factory();
                } else {
                    factory = new SOAP12Factory();
                }
                if (attachments.getAttachmentSpecType().equals(
                        MTOMConstants.MTOM_TYPE)) {
                    //Creates the MTOM specific MTOMStAXSOAPModelBuilder
                    builder = new MTOMStAXSOAPModelBuilder(streamReader,
                                                           factory,
                                                           attachments,
                                                           soapEnvelopeNamespaceURI);
                } else if (attachments.getAttachmentSpecType().equals(
                        MTOMConstants.SWA_TYPE)) {
                    builder = new StAXSOAPModelBuilder(streamReader,
                                                       factory,
                                                       soapEnvelopeNamespaceURI);
                } else if (attachments.getAttachmentSpecType().equals(
                        MTOMConstants.SWA_TYPE_12)) {
                    builder = new StAXSOAPModelBuilder(streamReader,
                                                       factory,
                                                       soapEnvelopeNamespaceURI);
                }

            } catch (Exception e) {
                throw new SOAPException(e);
            }
        } else {
            modifiedInputStream = inputStream;
            try {
                isReader = new InputStreamReader(modifiedInputStream);
                XMLStreamReader streamReader = null;
               
                if(knownEncoding != null){
                  streamReader = StAXUtils.createXMLStreamReader(modifiedInputStream, knownEncoding);
                }else{
                  streamReader = StAXUtils.createXMLStreamReader(modifiedInputStream);                 
                }

                if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(contentType)) {
                    builder = new StAXSOAPModelBuilder(streamReader,
                                                       new SOAP11Factory(),
                                                       SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);

                } else if (HTTPConstants.MEDIA_TYPE_APPLICATION_SOAP_XML.equals(contentType)) {
                    builder = new StAXSOAPModelBuilder(streamReader,
                                                       new SOAP12Factory(),
                                                       SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);

                } else if (HTTPConstants.MEDIA_TYPE_MULTIPART_RELATED.equals(contentType)) {
                    builder = new StAXSOAPModelBuilder(streamReader,
                                                       new SOAP11Factory(),
                                                       null);
                } else {
                    builder = new StAXSOAPModelBuilder(streamReader,
                                                       new SOAP11Factory(),
                                                       null);
                }
            } catch (XMLStreamException e) {
                throw new SOAPException(e);
            }
View Full Code Here

    /**
     * Check parent processing of SOAPMessage
     */
    public void test_parentAccess3() throws Exception {

        SOAP11Factory axiomSF = new SOAP11Factory();
        org.apache.axiom.soap.SOAPEnvelope axiomSE = axiomSF.createSOAPEnvelope();
        org.apache.axiom.soap.SOAPMessage axiomSM = axiomSF.createSOAPMessage(axiomSE, null);
       
        SOAPEnvelopeImpl se =
            new SOAPEnvelopeImpl((org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl)axiomSE);
        SOAPMessageImpl sm = new SOAPMessageImpl(se);
        SOAPPartImpl sp = new SOAPPartImpl(sm, se);
View Full Code Here

        SoapMessageConverter portmaper1 = new SoapMessageConverter(wsdlHW, new QName(wsdlHW
                .getTargetNamespace(), "HelloService"), "HelloPort");

        XMLStreamReader sr = XMLInputFactory.newInstance().createXMLStreamReader(
                getClass().getResourceAsStream("/HelloWorldRequest.soap"));
        StAXSOAPModelBuilder builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(new SOAP11Factory(), sr);
        SOAPEnvelope se = builder.getSOAPEnvelope();

        Element msg = DOMUtils.stringToDOM("<message/>");
        MessageImpl odeMsg = new MessageImpl(new MessageDAOImpl(null));
        odeMsg.setMessage(msg);
View Full Code Here

        SoapMessageConverter portmaper1 = new SoapMessageConverter(wsdlHW, new QName(wsdlHW
                .getTargetNamespace(), "HelloService"), "HelloPort");

        XMLStreamReader sr = XMLInputFactory.newInstance().createXMLStreamReader(
                getClass().getResourceAsStream("/HelloWorldRequest.soap"));
        StAXSOAPModelBuilder builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(new SOAP11Factory(), sr);
        SOAPEnvelope se = builder.getSOAPEnvelope();

        Element msg = DOMUtils.stringToDOM("<message/>");
        MessageImpl odeMsg = new MessageImpl(new MessageDAOImpl(null));
        odeMsg.setMessage(msg);
View Full Code Here

            fileName = IN_FILE_NAME;
        }
        XMLStreamReader parser = XMLInputFactory.newInstance()
                .createXMLStreamReader(
                        new FileReader(getTestResourceFile(fileName)));
        builder = new StAXSOAPModelBuilder(parser, new SOAP11Factory(), null);
        return builder;
    }
View Full Code Here

TOP

Related Classes of org.apache.axiom.soap.impl.dom.soap11.SOAP11BodyImpl

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.