Examples of StAXSOAPModelBuilder


Examples of org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder

        _fixFaultElements(saajEnvelope);       
        // Get a XMLStreamReader backed by a SOAPElement tree
        XMLStreamReader reader = new SOAPElementReader(saajEnvelope);
       
        // Get a SOAP OM Builder.  Passing null causes the version to be automatically triggered
        StAXSOAPModelBuilder builder = null;
        if (attachments == null) {
            builder = new StAXSOAPModelBuilder(reader, null);
        } else {
            builder = new MTOMStAXSOAPModelBuilder(reader, attachments, null);
        }
        // Create and return the OM Envelope
        org.apache.axiom.soap.SOAPEnvelope omEnvelope = builder.getSOAPEnvelope();
       
        // TODO The following statement expands the OM tree.  This is
        // a brute force workaround to get around an apparent bug in the om serialization
        // (the pull stream parsing was not pulling the final tag).
        // Four things need to occur:
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder

            throw ExceptionFactory.makeWebServiceException(e);
        }
       
        SOAPEnvelope dummyEnv = (SOAPEnvelope) m.getAsOMElement();       
       
        StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(dummyEnv.getXMLStreamReaderWithoutCaching());
        SOAPEnvelope newEnv = (SOAPEnvelope) builder.getDocumentElement();
       
        SOAPBody body = newEnv.getBody();
        SOAPFault fault = body.getFault();
       
        Block[] details = getDetailBlocks(fault);
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder

   
    //Now clone the env and set it in the message context
    if (envelope!=null) {
     
      XMLStreamReader streamReader = envelope.cloneOMElement().getXMLStreamReader();
      SOAPEnvelope clonedEnvelope = new StAXSOAPModelBuilder(streamReader, null).getSOAPEnvelope();
      try {
        messageContext.setEnvelope(clonedEnvelope);
      } catch (AxisFault e) {
        throw new SandeshaStorageException (e);
      }
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder

   
    SOAPEnvelope envelope = msgContext.getEnvelope();
    //storing a cloned version of the envelope in the Map.
    if (envelope!=null) {     
      XMLStreamReader streamReader = envelope.cloneOMElement().getXMLStreamReader();
      SOAPEnvelope clonedEnvelope = new StAXSOAPModelBuilder(streamReader, null).getSOAPEnvelope();
      envMap.put(key, clonedEnvelope);
    }
   
  }
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder

        SOAPEnvelope reqEnv = null;

        // get the service name and parameters
        try {
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(request.getInputStream());
            StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(xmlReader);
            reqEnv = (SOAPEnvelope) builder.getDocumentElement();

            // log the request message
            if (Debug.verboseOn()) {
                try {
                    Debug.logInfo("Request Message:\n" + reqEnv + "\n", module);
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder

        try {
            assertTrue("Could not load Axiom message [" + resource + "]", resource.exists());
            is = resource.getInputStream();

            XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(is);
            StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(parser, null);
            org.apache.axiom.soap.SOAPMessage soapMessage = builder.getSoapMessage();
            return new AxiomSoapMessage(soapMessage, "", true, true);
        }
        finally {
            is.close();
        }
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder

        try {
            assertTrue("Could not load Axiom message [" + resource + "]", resource.exists());
            is = resource.getInputStream();

            XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(is);
            StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(parser, SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
            org.apache.axiom.soap.SOAPMessage soapMessage = builder.getSoapMessage();
            return new AxiomSoapMessage(soapMessage, "", true, true);
        }
        finally {
            is.close();
        }
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder

    private AxiomSoapMessage succeedingMessage;

    @Before
    public void setUp() throws Exception {
        XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(FAILING_FAULT));
        StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(parser);
        SOAPMessage soapMessage = builder.getSoapMessage();

        failingMessage = new AxiomSoapMessage(soapMessage, null, false, true);

        parser = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(SUCCEEDING_FAULT));
        builder = new StAXSOAPModelBuilder(parser);
        soapMessage = builder.getSoapMessage();

        succeedingMessage = new AxiomSoapMessage(soapMessage, null, false, true);

    }
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder

    /** Creates an AxiomSoapMessage without attachments. */
    private AxiomSoapMessage createAxiomSoapMessage(InputStream inputStream, String contentType, String soapAction)
            throws XMLStreamException {
        XMLStreamReader reader = inputFactory.createXMLStreamReader(inputStream, getCharSetEncoding(contentType));
        String envelopeNamespace = getSoapEnvelopeNamespace(contentType);
        StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(reader, soapFactory, envelopeNamespace);
        SOAPMessage soapMessage = builder.getSoapMessage();
        return new AxiomSoapMessage(soapMessage, soapAction, payloadCaching, langAttributeOnSoap11FaultString);
    }
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder

        Attachments attachments =
                new Attachments(inputStream, contentType, attachmentCaching, attachmentCacheDir.getAbsolutePath(),
                        Integer.toString(attachmentCacheThreshold));
        XMLStreamReader reader = inputFactory.createXMLStreamReader(attachments.getRootPartInputStream(),
                getCharSetEncoding(attachments.getRootPartContentType()));
        StAXSOAPModelBuilder builder;
        String envelopeNamespace = getSoapEnvelopeNamespace(contentType);
        if (MTOMConstants.SWA_TYPE.equals(attachments.getAttachmentSpecType()) ||
                MTOMConstants.SWA_TYPE_12.equals(attachments.getAttachmentSpecType())) {
            builder = new StAXSOAPModelBuilder(reader, soapFactory, envelopeNamespace);
        }
        else if (MTOMConstants.MTOM_TYPE.equals(attachments.getAttachmentSpecType())) {
            builder = new MTOMStAXSOAPModelBuilder(reader, attachments, envelopeNamespace);
        }
        else {
            throw new AxiomSoapMessageCreationException(
                    "Unknown attachment type: [" + attachments.getAttachmentSpecType() + "]");
        }
        return new AxiomSoapMessage(builder.getSoapMessage(), attachments, soapAction, payloadCaching,
                langAttributeOnSoap11FaultString);
    }
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.