Package org.apache.ws.commons.soap.impl.llom.soap12

Examples of org.apache.ws.commons.soap.impl.llom.soap12.SOAP12Factory


    public SOAPMessage createMessage() throws SOAPException {
        SOAPEnvelopeImpl soapEnvelope;
        if (soapVersion.equals(SOAPConstants.SOAP_1_2_PROTOCOL)) {
            soapEnvelope =
                    new SOAPEnvelopeImpl((org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl)
                            new SOAP12Factory().getDefaultEnvelope());
        } else if (soapVersion.equals(SOAPConstants.DYNAMIC_SOAP_PROTOCOL)) {
            throw new UnsupportedOperationException("createMessage() is not supported for " +
                    "DYNAMIC_SOAP_PROTOCOL");
        } else {
            //SOAP 1.1
View Full Code Here


        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());
        }
        this.element.addAttribute(qname.getLocalPart(), value, omNamespace);
        return this;
    }
View Full Code Here

        factory.createSOAPBody(env);       
        checkAddChild(env, false);
    }
   
    public void testAppendSOAP12() throws Exception {
        SOAP12Factory factory;
        SOAPEnvelope env;
       
        // SOAP 1.2 only allows SOAPHeader and SOAPBody elements
       
        // All these addChild() should fail
        factory = new SOAP12Factory()
        env = factory.createSOAPEnvelope();
        checkAddChild(env, true);
       
        factory = new SOAP12Factory()
        env = factory.createSOAPEnvelope();
        factory.createSOAPHeader(env);
        checkAddChild(env, true);
       
        factory = new SOAP12Factory()
        env = factory.createSOAPEnvelope();
        factory.createSOAPBody(env);       
        checkAddChild(env, true);
       
        factory = new SOAP12Factory()
        env = factory.createSOAPEnvelope();
        factory.createSOAPHeader(env);
        factory.createSOAPBody(env);
        checkAddChild(env, true);       
    }
View Full Code Here

        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());
        }
        this.element.addAttribute(qname.getLocalPart(), value, omNamespace);
        return this;
    }
View Full Code Here

    public SOAPMessage createMessage() throws SOAPException {
        SOAPEnvelopeImpl soapEnvelope;
        if (soapVersion.equals(SOAPConstants.SOAP_1_2_PROTOCOL)) {
            soapEnvelope =
                    new SOAPEnvelopeImpl((org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl)
                            new SOAP12Factory().getDefaultEnvelope());
        } else if (soapVersion.equals(SOAPConstants.DYNAMIC_SOAP_PROTOCOL)) {
            throw new UnsupportedOperationException("createMessage() is not supported for " +
                    "DYNAMIC_SOAP_PROTOCOL");
        } else {
            //SOAP 1.1
View Full Code Here

            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 + "'");
            }
           
            charset = contentType.getParameter("charset");
View Full Code Here

                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(),
View Full Code Here

    public SOAPFactory getSOAP11Factory() {
        return new SOAP11Factory();
    }

    public SOAPFactory getSOAP12Factory() {
        return new SOAP12Factory();
    }
View Full Code Here

    public static SOAPFactory getSOAP11Factory() {
        return new SOAP11Factory();
    }

    public static SOAPFactory getSOAP12Factory() {
        return new SOAP12Factory();
    }
View Full Code Here

    public SOAPFactory getSOAP11Factory() {
        return new SOAP11Factory(this);
    }

    public SOAPFactory getSOAP12Factory() {
        return new SOAP12Factory(this);
    }
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.soap.impl.llom.soap12.SOAP12Factory

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.