Package javax.xml.soap

Examples of javax.xml.soap.SOAPBody


        TestDynamicDataBindingCallback callback = 
            new TestDynamicDataBindingCallback(StreamSource.class, Mode.PAYLOAD);       
        TestSOAPBodyDataWriter<SOAPBody> soapBodyDataWriter = new TestSOAPBodyDataWriter<SOAPBody>(callback);
        obj = streamSource;
        soapBodyDataWriter.write(obj, soapMsg.getSOAPBody());
        SOAPBody soapBody = soapBodyDataWriter.getTestSOAPBody();
        assertTrue("TextContent should be TestSOAPInputMessage",
                   "TestSOAPInputMessage".equals(soapBody.getFirstChild().getTextContent()));
     
    }
View Full Code Here


            new TestDynamicDataBindingCallback(jc, Mode.PAYLOAD);       
        TestSOAPBodyDataWriter<SOAPBody> soapBodyDataWriter = new TestSOAPBodyDataWriter<SOAPBody>(callback);
        GreetMe greetMe = new GreetMe();
        greetMe.setRequestType("DIPLO");
        soapBodyDataWriter.write(greetMe, soapMsg.getSOAPBody());
        SOAPBody soapBody = soapBodyDataWriter.getTestSOAPBody();
        assertTrue("TextContent should be DIPLO",
                   "DIPLO".equals(soapBody.getFirstChild().getTextContent()));
     
    }
View Full Code Here

    }
   
    public SOAPMessage invoke(SOAPMessage request) {
        SOAPMessage response = null;       
        try {
            SOAPBody body = request.getSOAPBody();
            Node n = body.getFirstChild();

            while (n.getNodeType() != Node.ELEMENT_NODE) {
                n = n.getNextSibling();
            }
            if (n.getLocalName().equals(sayHi.getLocalPart())) {
View Full Code Here

    public DOMSource invoke(DOMSource request) {
        DOMSource response = new DOMSource();
        try {
            SOAPMessage msg = factory.createMessage();
            msg.getSOAPPart().setContent(request);
            SOAPBody body = msg.getSOAPBody();
            Node n = body.getFirstChild();

            while (n.getNodeType() != Node.ELEMENT_NODE) {
                n = n.getNextSibling();
            }
            if (n.getLocalName().equals(sayHi.getLocalPart())) {
View Full Code Here

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

   */
  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)
      {
View Full Code Here

    public String toString() {
        StringBuilder builder = new StringBuilder("SaajSoapMessage");
        try {
          SOAPEnvelope envelope = saajMessage.getSOAPPart().getEnvelope();
            if (envelope != null) {
              SOAPBody body = envelope.getBody();
                if (body != null) {
                    SOAPElement bodyElement = SaajUtils.getFirstBodyElement(body);
                    if (bodyElement != null) {
                        builder.append(' ');
                      builder.append(bodyElement.getElementQName());
View Full Code Here

    private static class SoapFaultServlet extends AbstractSoapServlet {

        @Override
        protected SOAPMessage onMessage(SOAPMessage message) throws SOAPException {
            SOAPMessage response = messageFactory.createMessage();
            SOAPBody body = response.getSOAPBody();
            body.addFault(new QName("http://schemas.xmlsoap.org/soap/envelope/", "Server"), "Server fault");
            return response;
        }
View Full Code Here

                MimeHeaders headers = getHeaders(req);
                SOAPMessage request = messageFactory.createMessage(headers, req.getInputStream());
                SOAPMessage reply = onMessage(request);
              if (reply != null) {
                reply.saveChanges();
                SOAPBody replyBody = reply.getSOAPBody();
                if (!replyBody.hasFault()) {
                  resp.setStatus(HttpServletResponse.SC_OK);
                }
                else {
                  if (replyBody.getFault().getFaultCodeAsQName()
                      .equals(SOAPConstants.SOAP_SENDER_FAULT)) {
                    resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);

                  }
                  else {
View Full Code Here

    private static class SoapReceiverFaultServlet extends AbstractSoapServlet {

        @Override
        protected SOAPMessage onMessage(SOAPMessage message) throws SOAPException {
            SOAPMessage response = messageFactory.createMessage();
            SOAPBody body = response.getSOAPBody();
            body.addFault(SOAPConstants.SOAP_RECEIVER_FAULT, "Receiver Fault");
            return response;
        }
View Full Code Here

TOP

Related Classes of javax.xml.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.