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

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


    protected StAXSOAPModelBuilder getOMBuilder(String fileName) throws Exception {
        if ("".equals(fileName) || fileName == null) {
            fileName = IN_FILE_NAME;
        }
        XMLStreamReader parser = StAXUtils.createXMLStreamReader(getTestResource(fileName));
        builder = new StAXSOAPModelBuilder(parser, new SOAP11Factory(), null);
        return builder;
    }
View Full Code Here


// TODO: more or less a copy & paste of the other OMTestUtils class; clean this up
public class OMTestUtils {
    public static OMXMLParserWrapper getOMBuilder(InputStream in) throws Exception {
        XMLStreamReader parser = StAXUtils.createXMLStreamReader(in);
        return OMXMLBuilderFactory.createStAXSOAPModelBuilder(
                new SOAP11Factory(), parser);
    }
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/>");
        MemBackedMessageImpl odeMsg = new MemBackedMessageImpl(null, msg, null, false);
        portmaper1.parseSoapRequest(odeMsg, se, opHello);
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

                    "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

    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

            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

public class OMTestUtils {
    public static OMXMLParserWrapper getOMBuilder(File file) throws Exception {
        XMLStreamReader parser = XMLInputFactory.newInstance()
                .createXMLStreamReader(new FileReader(file));
        return OMXMLBuilderFactory.createStAXSOAPModelBuilder(
                new SOAP11Factory(), parser);
    }
View Full Code Here

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

TOP

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

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.