Package javax.xml.soap

Examples of javax.xml.soap.SOAPBodyElement


        int count = 0;

        while (it.hasNext()) {
            Object o = it.next();
            assertTrue(o instanceof SOAPBodyElement);
            SOAPBodyElement bodyElement = (SOAPBodyElement)o;
            assertEquals("http://www.jcommerce.net/soap/ns/SOAPHelloWorld",
                         bodyElement.getNamespaceURI());
            assertEquals("shw", bodyElement.getPrefix());
            assertTrue(bodyElement.getLocalName().equals("City") ||
                    bodyElement.getLocalName().equals("Address"));
            count++;
        }
        assertEquals(2, count);
    }
View Full Code Here


                        SOAPFaultImpl saajSOAPFault = new SOAPFaultImpl(fault);
                        ((NodeImpl)omSOAPBody.getFault())
                                .setUserData(SAAJ_NODE, saajSOAPFault, null);
                        childElements.add(saajSOAPFault);
                    } else {
                        SOAPBodyElement saajBodyEle = new SOAPBodyElementImpl((ElementImpl)domNode);
                        ((NodeImpl)domNode).setUserData(SAAJ_NODE, saajBodyEle, null);
                        childElements.add(saajBodyEle);
                    }
                }
            } else {
View Full Code Here

   }

   public SOAPBodyElement addBodyElement(Name name) throws SOAPException
   {
      log.trace("addBodyElement: " + name);
      SOAPBodyElement child = new SOAPBodyElementDoc(name);
      return (SOAPBodyElement)addChildElement(child);
   }
View Full Code Here

   }

   public SOAPBodyElement addBodyElement(QName qname) throws SOAPException
   {
      log.trace("addBodyElement: " + qname);
      SOAPBodyElement child = new SOAPBodyElementDoc(qname);
      return (SOAPBodyElement)addChildElement(child);
   }
View Full Code Here

      return getChildElements(new QName(getNamespaceURI(), "Fault"));
   }

   public SOAPBodyElement getBodyElement()
   {
      SOAPBodyElement bodyElement = null;
      Iterator it = getChildElements();
      while (bodyElement == null && it.hasNext())
      {
         Object next = it.next();
         if (next instanceof SOAPBodyElement)
View Full Code Here

      if (!soapBody.getPrefix().equals(domBody.getPrefix()))
      {
         soapBody.setPrefix(domBody.getPrefix());
      }

      SOAPBodyElement soapBodyElement = null;
      boolean attachHRefElements = Constants.URI_SOAP11_ENC.equals(soapEnv.getAttributeNS(envNS, "encodingStyle"));

      NodeList bodyChildNodes = domBody.getChildNodes();
      for (int i = 0; i < bodyChildNodes.getLength(); i++)
      {
View Full Code Here

      String envPrefix = soapEnv.getPrefix();

      SOAPBodyImpl soapBody = (SOAPBodyImpl)soapEnv.getBody();
      QName beName = DOMUtils.getElementQName(domBodyElement);

      SOAPBodyElement soapBodyElement = null;

      // Process a <env:Fault> message
      if (beName.equals(new QName(envNS, "Fault")))
      {
         SOAPFaultImpl soapFault = new SOAPFaultImpl(envPrefix, envNS);
View Full Code Here

   }

   public SOAPBodyElement buildBodyElementDefault(SOAPBodyImpl soapBody, Element domBodyElement) throws SOAPException
   {
      QName beName = DOMUtils.getElementQName(domBodyElement);
      SOAPBodyElement soapBodyElement = new SOAPBodyElementMessage(beName);
      soapBodyElement = (SOAPBodyElementMessage)soapBody.addChildElement(soapBodyElement);

      DOMUtils.copyAttributes(soapBodyElement, domBodyElement);

      NodeList nlist = domBodyElement.getChildNodes();
      for (int i = 0; i < nlist.getLength(); i++)
      {
         Node child = nlist.item(i);
         short childType = child.getNodeType();
         if (childType == Node.ELEMENT_NODE)
         {
            SOAPElement soapElement = soapFactory.createElement((Element)child);
            soapBodyElement.addChildElement(soapElement);
         }
         else if (childType == Node.COMMENT_NODE)
         {
            appendCommentNode(soapBodyElement, child);
         }
         else if (childType == Node.TEXT_NODE)
         {
            appendTextNode(soapBodyElement, child);
         }
         else if (childType == Node.CDATA_SECTION_NODE)
         {
            String nodeValue = child.getNodeValue();
            soapBodyElement.addTextNode(nodeValue);
         }
         else
         {
            log.warn("Ignore child type: " + childType);
         }
View Full Code Here

         if (opMetaData == null)
         {
            String faultString;

            SOAPBodyImpl soapBody = (SOAPBodyImpl)soapMessage.getSOAPBody();
            SOAPBodyElement soapBodyElement = soapBody.getBodyElement();
            if (soapBodyElement != null)
            {
               Name soapName = soapBodyElement.getElementName();
               faultString = "Endpoint " + epMetaData.getPortName() + " does not contain operation meta data for: " + soapName;
            }
            else
            {
               faultString = "Endpoint " + epMetaData.getPortName() + " does not contain operation meta data for empty soap body";
View Full Code Here

   {
      try
      {
         SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
         SOAPBody soapBody = soapMessage.getSOAPBody();
         SOAPBodyElement soapBodyElement = (SOAPBodyElement)soapBody.getChildElements().next();
         SOAPElement faultStringElement = (SOAPElement)soapBodyElement.getChildElements(new QName("faultstring")).next();
         faultStringElement.setValue(faultStringElement.getValue().toUpperCase());
         Iterator<SOAPElement> itDetail = soapBodyElement.getChildElements(new QName("detail"));
         if (itDetail.hasNext())
         {
            Iterator<SOAPElement> itException = itDetail.next().getChildElements(new QName("http://server.exception.samples.jaxws.ws.test.jboss.org/","UserException"));
            if (itException.hasNext())
            {
View Full Code Here

TOP

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