Package org.apache.axis.message

Examples of org.apache.axis.message.SOAPBodyElement


        if (env.getBody() == null) {
            env.addBody();
        }

        Name name = env.createName("", Constants.WSRM.NS_PREFIX_RM, Constants.WSRM.NS_URI_RM);
        SOAPBodyElement bodyElement = (SOAPBodyElement) env.getBody().addBodyElement(name);

        bodyElement.setName(Constants.WSRM.CREATE_SEQUENCE);

        if (acksTo != null)
            acksTo.toSOAPEnvelope(bodyElement);
        if (offer != null)
            offer.toSOAPEnvelope(bodyElement);
View Full Code Here


            DeserializationContext dser =
                new DeserializationContext(new InputSource(in), resMsg.getMessageContext(), null);
            dser.parse();
            SOAPEnvelope responseEnvelope = dser.getEnvelope();

            SOAPBodyElement bodyEl = responseEnvelope.getFirstBody();
            if (bodyEl == null) {
                return null;
            }

            QName returnType = operation.getReturnType();
            if (XMLType.AXIS_VOID.equals(returnType)) {
                return null;
            }

            Object result = null;

            if (bodyEl instanceof RPCElement) {
                RPCElement body = (RPCElement)bodyEl;
                body.setNeedDeser(true);
                Vector args = null;
                try {
                    args = body.getParams();
                } catch (SAXException e) {
                    if (e.getException() != null) {
                        throw e.getException();
                    }
                    throw e;
                }

                QName returnParamQName = operation.getReturnQName();
                if (args != null && args.size() > 0) {

                    if (returnParamQName == null) {
                        RPCParam param = (RPCParam) args.get(0);
                        result = param.getObjectValue();
                    } else {
                        for (int i = 0; i < args.size(); i++) {
                            RPCParam param = (RPCParam) args.get(i);
                            if (returnParamQName.equals(param.getQName())) {
                                result = param.getObjectValue();
                                break;
                            }
                        }
                    }

                }
            } else {
                try {
                    result = bodyEl.getValueAsType(returnType);
                } catch (Exception e) {
                    result = bodyEl;
                }
            }
View Full Code Here

      service = new Service();
      call = (Call)service.createCall();
      call.setTargetEndpointAddress(endpointURL.toURL());
     
      String requestString = XMLUtils.ElementToString(request);
      SOAPBodyElement body = new SOAPBodyElement(new ByteArrayInputStream(requestString.getBytes("UTF-8")));
      Object[] soapBodies = new Object[] { body };

      Vector result = (Vector)call.invoke(soapBodies);
      response = ((SOAPBodyElement)result.elementAt(0)).getAsDOM();
    }
View Full Code Here

       
      service = new Service();
      call = (Call)service.createCall();
      call.setTargetEndpointAddress(endpointURL.toURL());
   
      SOAPBodyElement body = new SOAPBodyElement(new ByteArrayInputStream(request.getBytes("UTF-8")));
      Object[] soapBodies = new Object[] { body };
   
      Vector result = (Vector)call.invoke(soapBodies);
      response = ((SOAPBodyElement)result.elementAt(0)).getAsString();
    }
View Full Code Here

      service = new Service();
      call = (Call)service.createCall();
      call.setTargetEndpointAddress(endpointURL.toURL());
     
      String requestString = XMLUtils.ElementToString(request);
      SOAPBodyElement body = new SOAPBodyElement(new ByteArrayInputStream(requestString.getBytes("UTF-8")));
      Object[] soapBodies = new Object[] { body };

      Vector result = (Vector)call.invoke(soapBodies);
      if (result.size() > 0) {
        response = ((SOAPBodyElement)result.elementAt(0)).getAsDOM();
View Full Code Here

       
      service = new Service();
      call = (Call)service.createCall();
      call.setTargetEndpointAddress(endpointURL.toURL());
   
      SOAPBodyElement body = new SOAPBodyElement(new ByteArrayInputStream(request.getBytes("UTF-8")));
      Object[] soapBodies = new Object[] { body };
   
      Vector result = (Vector)call.invoke(soapBodies);
      if (result.size() > 0 ) {
        response = ((SOAPBodyElement)result.elementAt(0)).getAsString();
View Full Code Here

       msgContext.setHighFidelity(true);
       String request = header + request2 + footer;
       Message message = new Message(request);
       message.setMessageContext(msgContext);
       SOAPEnvelope envelope = message.getSOAPEnvelope();
       SOAPBodyElement bodyElement = (SOAPBodyElement)envelope.getBodyElements().elementAt(0);
       MessageElement me = (MessageElement) bodyElement.getChildren().get(0);
       org.xml.sax.Attributes atts = me.getAttributes();
       assertTrue(atts.getLength()==2);
    }
View Full Code Here

       assertTrue(atts.getLength()==2);
    }

    public void testEmptyNode() throws Exception
    {
        SOAPBodyElement body = new SOAPBodyElement(XMLUtils.newDocument().createElement("tmp"));
        assertEquals("<tmp/>",body.toString());
    }
View Full Code Here

    public void testNodeWithAttribute() throws Exception
    {
        org.w3c.dom.Element element = XMLUtils.newDocument().createElement("tmp");
        element.setAttribute("attrib", "foo");
        SOAPBodyElement body = new SOAPBodyElement(element);
        assertEquals("<tmp attrib=\"foo\"/>",body.toString());
    }
View Full Code Here

       Element operationWrapper = doc.createElementNS("urn:operationNS","operation");
       doc.appendChild(operationWrapper);
       Node node = doc.importNode(element,true);
       operationWrapper.appendChild(node);

       message.addBodyElement(new SOAPBodyElement(operationWrapper));
      
       StringWriter stringWriter = new StringWriter();
       SerializationContext context = new SerializationContextImpl(stringWriter, messageContext);
       context.setDoMultiRefs(false);
       message.output(context);
View Full Code Here

TOP

Related Classes of org.apache.axis.message.SOAPBodyElement

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.