Examples of SOAPEnvelope


Examples of javax.xml.soap.SOAPEnvelope

    private boolean getLastMessage(SOAPElement elem) throws Exception {
        return elem.getChildElements(new QName(Names.WSRM_NAMESPACE_NAME, "LastMessage")).hasNext();
    }

    protected SOAPElement getAcknowledgment(SOAPMessage msg) throws Exception {
        SOAPEnvelope env = msg.getSOAPPart().getEnvelope();
        SOAPHeader header = env.getHeader();
        Iterator headerElements = header.examineAllHeaderElements();
        while (headerElements.hasNext()) {
            SOAPHeaderElement headerElement = (SOAPHeaderElement)headerElements.next();
            Name headerName = headerElement.getElementName();
            String localName = headerName.getLocalName();
View Full Code Here

Examples of javax.xml.soap.SOAPEnvelope

        }
        return null;
    }

    private SOAPElement getAckRequested(SOAPMessage msg) throws Exception {
        SOAPEnvelope env = msg.getSOAPPart().getEnvelope();
        SOAPHeader header = env.getHeader();
        Iterator headerElements = header.examineAllHeaderElements();
        while (headerElements.hasNext()) {
            SOAPHeaderElement headerElement = (SOAPHeaderElement)headerElements.next();
            Name headerName = headerElement.getElementName();
            String localName = headerName.getLocalName();
View Full Code Here

Examples of javax.xml.soap.SOAPEnvelope

      MimeHeaders mh = message.getMimeHeaders();
      mh.setHeader("SOAPAction", "\"urn:schemas-microsoft-com:xml-analysis:Execute\"");

      SOAPPart soapPart = message.getSOAPPart();
      SOAPEnvelope envelope = soapPart.getEnvelope();
      SOAPBody body = envelope.getBody();
      Name nEx = envelope.createName("Execute", "", XMLA_URI);

      SOAPElement eEx = body.addChildElement(nEx);

      // add the parameters

      // COMMAND parameter
      // <Command>
      // <Statement>queryStr</Statement>
      // </Command>
      Name nCom = envelope.createName("Command", "", XMLA_URI);
      SOAPElement eCommand = eEx.addChildElement(nCom);
      Name nSta = envelope.createName("Statement", "", XMLA_URI);
      SOAPElement eStatement = eCommand.addChildElement(nSta);
      eStatement.addTextNode(queryStr);

      // <Properties>
      // <PropertyList>
View Full Code Here

Examples of javax.xml.soap.SOAPEnvelope

   *            The reply-Message from the Server
   */
  protected void parseResult(SOAPMessage reply) throws SOAPException
  {
    SOAPPart soapPart = reply.getSOAPPart();
    SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
    SOAPBody soapBody = soapEnvelope.getBody();
    SOAPElement eElement = null;

    if (log.isDebugEnabled())
    {
      log.debug("XML/A result envelope: " + soapEnvelope.toString());
    }
   
    SOAPFault fault = soapBody.getFault();
    if (fault != null)
    {
      handleResultFault(fault);
    }
   
    Name eName = soapEnvelope.createName("ExecuteResponse", "", XMLA_URI);

    // Get the ExecuteResponse-Node
    Iterator responseElements = soapBody.getChildElements(eName);
    if (responseElements.hasNext())
    {
      Object eObj = responseElements.next();
      if (eObj == null)
      {
        throw new JRRuntimeException("ExecuteResponse Element is null.");
      }
      eElement = (SOAPElement) eObj;
    }
    else
    {
      throw new JRRuntimeException("Could not retrieve ExecuteResponse Element.");
    }

    // Get the return-Node
    Name rName = soapEnvelope.createName("return", "", XMLA_URI);
    Iterator returnElements = eElement.getChildElements(rName);
    SOAPElement returnElement = null;
    if (returnElements.hasNext())
    {
      Object eObj = returnElements.next();
      if (eObj == null)
      {
        throw new JRRuntimeException("return Element is null.");
      }
      returnElement = (SOAPElement) eObj;
    }
    else
    {
      // Should be old-Microsoft XMLA-SDK. Try without m-prefix
      Name rName2 = soapEnvelope.createName("return", "", "");
      returnElements = eElement.getChildElements(rName2);
      if (returnElements.hasNext())
      {
        Object eObj = returnElements.next();
        if (eObj == null)
        {
          throw new JRRuntimeException("return Element is null.");
        }
        returnElement = (SOAPElement) eObj;
      }
      else
      {
        throw new JRRuntimeException("Could not retrieve return Element.");
      }
    }

    // Get the root-Node
    Name rootName = soapEnvelope.createName("root", "", MDD_URI);
    SOAPElement rootElement = null;
    Iterator rootElements = returnElement.getChildElements(rootName);
    if (rootElements.hasNext())
    {
      Object eObj = rootElements.next();
      if (eObj == null)
      {
        throw new JRRuntimeException("root Element is null.");
      }
      rootElement = (SOAPElement) eObj;
    }
    else
    {
      throw new JRRuntimeException("Could not retrieve root Element.");
    }
    // Get the OlapInfo-Node
    Name olapInfoName = soapEnvelope.createName("OlapInfo", "", MDD_URI);
    SOAPElement olapInfoElement = null;
    Iterator olapInfoElements = rootElement.getChildElements(olapInfoName);
    if (olapInfoElements.hasNext())
    {
      Object eObj = olapInfoElements.next();
      if (eObj == null)
      {
        throw new JRRuntimeException("OlapInfo Element is null.");
      }
      olapInfoElement = (SOAPElement) eObj;
    }
    else
    {
      throw new JRRuntimeException("Could not retrieve OlapInfo Element.");
    }

    parseOLAPInfoElement(olapInfoElement);

    // Get the Axes Element
    Name axesName = soapEnvelope.createName("Axes", "", MDD_URI);
    SOAPElement axesElement = null;
    Iterator axesElements = rootElement.getChildElements(axesName);
    if (axesElements.hasNext())
    {
      Object eObj = axesElements.next();
      if (eObj == null)
      {
        throw new JRRuntimeException("Axes Element is null");
      }
      axesElement = (SOAPElement) eObj;
    }
    else
    {
      throw new JRRuntimeException("Could not retrieve Axes Element.");
    }

    parseAxesElement(axesElement);

    // Get the CellData Element
    Name cellDataName = soapEnvelope.createName("CellData", "", MDD_URI);
    SOAPElement cellDataElement = null;
    Iterator cellDataElements = rootElement.getChildElements(cellDataName);
    if (cellDataElements.hasNext())
    {
      Object eObj = cellDataElements.next();
View Full Code Here

Examples of net.rim.device.api.io.parser.soap.SOAPEnvelope

     * Displays parts of the SOAP Message
     */
    private void displaySoap(final Message message) {
        final Object soap = message.getObjectPayload();

        final SOAPEnvelope env = (SOAPEnvelope) soap;
        final SOAPHeader header = env.getHeader();
        final SOAPBody body = env.getBody();

        String str = "====== Envelope:";
        str += "\nName: " + env.getName();
        str += "\nNamespace: " + env.getNamespace();
        str += "\n====== Header:";
        if (header != null) {
            str += "\nName: " + header.getName();
            str += "\nNamespace: " + header.getNamespace();
            str += "\nNumber of children: " + header.getChildren().size();
        } else {
            str += "\n null";
        }

        str += "\n====== Body:";
        if (body != null) {
            str += "\nName: " + body.getName();
            str += "\nNamespace: " + body.getNamespace();

            final Vector children = body.getChildren();

            str += "\nNumber of children: " + children.size();
            for (int i = 0; i < children.size(); i++) {
                final SOAPElement element = (SOAPElement) children.elementAt(i);
                if (element != null) {
                    str += "\n  [child " + i + "]";
                    str += "\n   Name: " + element.getName();
                    str += "\n   Type: " + element.getType();
                    str += "\n   Namespace: " + element.getNamespace();
                }
            }
        } else {
            str += "\n null";
        }

        _formattedMsgContentField.setText(str);
        _msgContentField.setText(" ******* SOAP Request *******\n"
                + env.toSoapRequest());
    }
View Full Code Here

Examples of org.apache.axiom.soap.SOAPEnvelope

            if(!outOnlyMessage) {
                    if(result != null) {
                        String soapNamespaceURI =
                                axis2Ctx.getEnvelope().getNamespace().getNamespaceURI();
                        SOAPEnvelope envelope = createSOAPEnvelope(result , soapNamespaceURI);
                        axis2Ctx.setEnvelope(envelope);
                        return messageOut;
                    }
            }
        } catch (AxisFault axisFault) {
View Full Code Here

Examples of org.apache.axiom.soap.SOAPEnvelope

                if (soapNamespaceUri.equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
                    soapFactory = OMAbstractFactory.getSOAP12Factory();
                } else {
                    soapFactory = OMAbstractFactory.getSOAP11Factory();
                }
        SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
        envelope.getBody().addChild(payload);
        return envelope;
    }
View Full Code Here

Examples of org.apache.axiom.soap.SOAPEnvelope

                                new AxisFault(errorMessage);

                        MessageContext nioFaultMessageContext =
                            MessageContextBuilder.createFaultMessageContext(mc, axisFault);

                        SOAPEnvelope envelope = nioFaultMessageContext.getEnvelope();

                        if (log.isDebugEnabled()) {
                            log.debug("Sending Fault for Request with Message ID : "
                                    + mc.getMessageID());
                        }
                       
                        nioFaultMessageContext.setProperty(
                            NhttpConstants.SENDING_FAULT, Boolean.TRUE);
                        nioFaultMessageContext.setProperty(
                                NhttpConstants.ERROR_MESSAGE, errorMessage);
                        if (errorCode != -1) {
                            nioFaultMessageContext.setProperty(
                                NhttpConstants.ERROR_CODE, errorCode);
                        }
                        if (exceptionToRaise != null) {
                            nioFaultMessageContext.setProperty(
                                NhttpConstants.ERROR_DETAIL, exceptionToRaise.toString());
                            nioFaultMessageContext.setProperty(
                                NhttpConstants.ERROR_EXCEPTION, exceptionToRaise);
                            envelope.getBody().getFault().getDetail().setText(
                                exceptionToRaise.toString());
                        } else {
                            nioFaultMessageContext.setProperty(
                                NhttpConstants.ERROR_DETAIL, errorMessage);
                            envelope.getBody().getFault().getDetail().setText(errorMessage);
                        }
                        nioFaultMessageContext.setProperty(CLIENT_CONNECTION_DEBUG,
                            mc.getProperty(CLIENT_CONNECTION_DEBUG));
                        mr.receive(nioFaultMessageContext);
View Full Code Here

Examples of org.apache.axiom.soap.SOAPEnvelope

                            StAXUtils.createXMLStreamReader(new ByteArrayInputStream(soap.getBytes()));
                    StAXBuilder builder = new StAXSOAPModelBuilder(xmlReader);
                    OMElement elem = builder.getDocumentElement();
                    elem.build();
                    if (elem instanceof SOAPEnvelope) {
                        SOAPEnvelope soapEnvelope = (SOAPEnvelope) elem;
                        String soapNamespace = soapEnvelope.getNamespace().getNamespaceURI();
                        if (soapEnvelope.getHeader() == null) {
                            SOAPFactory soapFactory;
                            if (soapNamespace.equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
                                soapFactory = OMAbstractFactory.getSOAP12Factory();
                            } else {
                                soapFactory = OMAbstractFactory.getSOAP11Factory();
                            }
                            soapFactory.createSOAPHeader(soapEnvelope);
                        }
                        sourceNodeList.add(soapEnvelope);
                    } else {
                        sourceNodeList.add(elem);
                    }
                } catch (XMLStreamException e) {
                    synLog.error("Source Property cannot be parsed : " + e.getStackTrace().toString());
                }
            } else if (o instanceof ArrayList) {
                ArrayList nodesList = (ArrayList) o;
                for (Object node : nodesList) {
                    if (node instanceof OMElement) {
                        if (node instanceof SOAPEnvelope) {
                            SOAPEnvelope soapEnvelope = (SOAPEnvelope) node;
                            String soapNamespace = null;

                            if (soapEnvelope.getNamespace() != null) {
                                soapNamespace = soapEnvelope.getNamespace().getNamespaceURI();
                            }
                            if (soapEnvelope.getHeader() == null && soapNamespace != null) {
                                SOAPFactory soapFactory;
                                if (soapNamespace.equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
                                    soapFactory = OMAbstractFactory.getSOAP12Factory();
                                } else {
                                    soapFactory = OMAbstractFactory.getSOAP11Factory();
                                }
                                soapFactory.createSOAPHeader(soapEnvelope);
                            }
                            sourceNodeList.add(soapEnvelope);
                        } else {
                            OMElement ele = (OMElement) node;
                            sourceNodeList.add(ele);
                        }
                    } else if (node instanceof OMText) {
                        sourceNodeList.add((OMText) node);
                    }
                }
            } else {
                synLog.error("Invalid source property type.");
            }
        } else if (sourceType == EnrichMediator.INLINE) {
            if (inlineOMNode instanceof OMElement) {
                OMElement inlineOMElement = (OMElement) inlineOMNode;
                if (inlineOMElement.getQName().getLocalPart().equals("Envelope")) {
                    SOAPEnvelope soapEnvelope = getSOAPEnvFromOM(inlineOMElement);
                    if (soapEnvelope != null) {
                        sourceNodeList.add(soapEnvelope);
                    } else {
                        synLog.error("Inline Source is not a valid SOAPEnvelope.");
                    }
                } else {
                    sourceNodeList.add(inlineOMElement.cloneOMElement());
                }
            } else if (inlineOMNode instanceof OMText) {
                sourceNodeList.add(inlineOMNode);
            } else if (inlineKey != null) {
                Object inlineObj = synCtx.getEntry(inlineKey);
                if (inlineObj instanceof OMElement) {
                    if (((OMElement) inlineObj).getQName().getLocalPart().equals("Envelope")) {
                        SOAPEnvelope soapEnvelope = getSOAPEnvFromOM((OMElement) inlineObj);
                        if (soapEnvelope != null) {
                            sourceNodeList.add(soapEnvelope);
                        } else {
                            synLog.error("Specified Resource as Source is not a valid SOAPEnvelope.");
                        }
View Full Code Here

Examples of org.apache.axiom.soap.SOAPEnvelope

                if (responseMessageContext.getEnvelope() == null) {
                    // If request is REST we assume the responseMessageContext is
                    // REST, so set the variable

                    SOAPEnvelope resenvelope =
                        TransportUtils.createSOAPMessage(responseMessageContext);

                    if (resenvelope != null) {
                        responseMessageContext.setEnvelope(resenvelope);
                        AxisEngine.receive(responseMessageContext);
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.