Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPBody


    public void setStreamingPayload(StreamingPayload payload) {
        Assert.notNull(payload, "'payload' must not be null");
        OMDataSource dataSource = new StreamingOMDataSource(payload);
        OMElement payloadElement = getAxiomFactory().createOMElement(dataSource, payload.getName());

        SOAPBody soapBody = getAxiomBody();
        AxiomUtils.removeContents(soapBody);
        soapBody.addChild(payloadElement);
    }
View Full Code Here


  private void doInvocation(MessageContext mc) throws AxisFault {
    SOAPEnvelope envelope = mc.getEnvelope();

    assertNotNull(envelope);

    SOAPBody body = envelope.getBody();

    OMElement payload = body.getFirstElement();
    OMElement attachmentElem = payload.getFirstChildWithName(new QName(applicationNamespaceName, Attachment));
    if (attachmentElem == null)
      throw new AxisFault("'Attachment' element is not present as a child of the 'Ping' element");

    OMText binaryElem = (OMText) attachmentElem.getFirstOMChild();
View Full Code Here

        Debug.logVerbose("[Processing]: SOAP Event", module);

        String serviceName = null;
        try {
            SOAPBody reqBody = reqEnv.getBody();
            validateSOAPBody(reqBody);
            OMElement serviceElement = reqBody.getFirstElement();
            serviceName = serviceElement.getLocalName();
            Map<String, Object> parameters = UtilGenerics.cast(SoapSerializer.deserialize(serviceElement.toString(), delegator));
            try {
                // verify the service is exported for remote execution and invoke it
                ModelService model = dispatcher.getDispatchContext().getModelService(serviceName);
View Full Code Here

            OMElement resultSer = resultsBuilder.getDocumentElement();

            // create the response soap
            SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
            SOAPEnvelope resEnv = factory.createSOAPEnvelope();
            SOAPBody resBody = factory.createSOAPBody();
            OMElement resService = factory.createOMElement(new QName(serviceName + "Response"));
            resService.addChild(resultSer.getFirstElement());
            resBody.addChild(resService);
            resEnv.addChild(resBody);

            // The declareDefaultNamespace method doesn't work see (https://issues.apache.org/jira/browse/AXIS2-3156)
            // so the following doesn't work:
            // resService.declareDefaultNamespace(ModelService.TNS);
View Full Code Here

            OMElement resultSer = resultsBuilder.getDocumentElement();

            // create the response soap
            SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
            SOAPEnvelope resEnv = factory.createSOAPEnvelope();
            SOAPBody resBody = factory.createSOAPBody();
            OMElement errMsg = factory.createOMElement(new QName((serviceName != null ? serviceName : "") + "Response"));
            errMsg.addChild(resultSer.getFirstElement());
            resBody.addChild(errMsg);
            resEnv.addChild(resBody);

            // The declareDefaultNamespace method doesn't work see (https://issues.apache.org/jira/browse/AXIS2-3156)
            // so the following doesn't work:
            // resService.declareDefaultNamespace(ModelService.TNS);
View Full Code Here

      this.name = name;
    }
   
    public void onComplete(AsyncResult result) {
      //System.out.println("On Complete Called for " + text);
      SOAPBody body = result.getResponseEnvelope().getBody();
     
      OMElement echoStringResponseElem = body.getFirstChildWithName(new QName (applicationNamespaceName,echoStringResponse));
      if (echoStringResponseElem==null) {
        System.out.println("Error: SOAPBody does not have a 'echoStringResponse' child");
        return;
      }
     
View Full Code Here

      this.name = name;
    }
   
    public void onComplete(AsyncResult result) {
      //System.out.println("On Complete Called for " + text);
      SOAPBody body = result.getResponseEnvelope().getBody();
     
      OMElement echoStringResponseElem = body.getFirstChildWithName(new QName (applicationNamespaceName,echoStringResponse));
      if (echoStringResponseElem==null) {
        System.out.println("Error: SOAPBody does not have a 'echoStringResponse' child");
        return;
      }
     
View Full Code Here

      SOAPEnvelope envelope = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil.getSOAPVersion(env))
          .getDefaultEnvelope();
      rmMsgCtx.setSOAPEnvelop(envelope);
    }

    SOAPBody soapBody = rmMsgCtx.getSOAPEnvelope().getBody();
    if (soapBody == null) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.soapBodyNotPresent);
      log.debug(message);
      throw new SandeshaException(message);
    }
View Full Code Here

    public TestCallback (String name) {
      this.name = name;
    }
   
    public void onComplete(AsyncResult result) {
      SOAPBody body = result.getResponseEnvelope().getBody();
     
      OMElement echoStringResponseElem = body.getFirstChildWithName(new QName (applicationNamespaceName,echoStringResponse));     
      OMElement echoStringReturnElem = echoStringResponseElem.getFirstChildWithName(new QName (applicationNamespaceName,EchoStringReturn));
     
      String resultStr = echoStringReturnElem.getText();
      System.out.println("Callback '" + name +  "' got result:" + resultStr);
    }
View Full Code Here

          }
        } catch(Exception e) {
          // Do nothing, we failed to find a Sequence header
        }
        if(lastMessageHeader) {
          SOAPBody body = env.getBody();
          if(body != null && body.getFirstElement() == null) {
            // There is an empty body so we know this is the kind of message
            // that we are looking for.
            if(log.isDebugEnabled()) log.debug("Setting SOAP Action for a WSRM 1.0 last message");
            msgContext.setSoapAction(Sandesha2Constants.SPEC_2005_02.Actions.SOAP_ACTION_LAST_MESSAGE);
          }
View Full Code Here

TOP

Related Classes of org.apache.axiom.soap.SOAPBody

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.