Examples of SOAPElement


Examples of javax.xml.soap.SOAPElement

*/
class SoapArrayFactory {

  <T> SOAPElement createSoapArray(String name, Collection<T> values)
      throws DOMException, SOAPException {
    SOAPElement element = SOAPFactory.newInstance().createElement(name);

    // Check the type of the array and default to string if empty
    String type;
    if (values.size() != 0) {
      type = XSDTypeConverter.simpleTypeForObject(values.iterator().next());
    } else {
      type = "xsi:string";
    }

    element.setAttribute("soapenc:arrayType", type + "[" + values.size() + "]");
    element.setAttribute("xsi:type", "soapenc:Array");

    for (T s : values) {
      element.addChildElement("item").addTextNode(s.toString()).setAttribute("xsi:type", type);
    }

    return element;
  }
View Full Code Here

Examples of javax.xml.soap.SOAPElement

            SOAPMessageContext smc = (SOAPMessageContext) messageContext;
           
            SOAPHeader header = smc.getMessage().getSOAPHeader();
            if (header != null)
            {
               SOAPElement element = header.addChildElement(CIDQN);
               element.addTextNode(conversationId);
               smc.getMessage().saveChanges();              
            }           
         }
        
         Manager.instance().endRequest( new ServletRequestSessionMap(request) );
View Full Code Here

Examples of javax.xml.soap.SOAPElement

      if (header != null)
      {
         Iterator iter = header.getChildElements(CIDQN);
         if (iter.hasNext())
         {
            SOAPElement element = (SOAPElement) iter.next();
            return element.getFirstChild().getNodeValue();
         }
      }
     
      return null;
   }
View Full Code Here

Examples of javax.xml.soap.SOAPElement

    private String login(final String sid, final String username,
        final String password) throws SOAPException, IOException
    {
        final SOAPMessage soapMessage = getSoapMessage();
        final SOAPBody soapBody = soapMessage.getSOAPBody();
        final SOAPElement loginElement =
            soapBody.addChildElement("loginUser", NAMESPACE_PREFIX);

        loginElement.addChildElement("SID", NAMESPACE_PREFIX).addTextNode(sid);
        loginElement.addChildElement("username", NAMESPACE_PREFIX).addTextNode(
            username);
        loginElement.addChildElement("userpass", NAMESPACE_PREFIX).addTextNode(
            password);
        soapMessage.saveChanges();

        final SOAPBody soapResponseBody = getSOAPResponseBody(soapMessage, getUserServiceUrl());
        final String textContent = soapResponseBody.getFirstChild().getTextContent();
View Full Code Here

Examples of javax.xml.soap.SOAPElement

        final String password, final String displayedName, final String RoomID)
            throws Exception
    {
        final SOAPMessage soapMessage = getSoapMessage();
        final SOAPBody soapBody = soapMessage.getSOAPBody();
        final SOAPElement requestElement =
            soapBody.addChildElement("getInvitationHash", NAMESPACE_PREFIX);

        logger.info(username + ":" + displayedName);

        String sid = getSID(username, password);
        String error_id = null;
        try
        {
            error_id = login(sid, username, password);
        }
        catch (Exception e)
        {
            logger.info(e.getMessage());
        }

        if (!error_id.equals("1"))
        {
            logger.info("User cant login!");
            return null;
        }

        String room_id = RoomID;
        if ((room_id == null) || (room_id.trim().isEmpty()))
            room_id = getAvailableRooms(sid);
        if (room_id == null)
        {
            logger.error("No rooms available in openmeetings");
            return null;
        } else
        {
            room_id = room_id.trim();
            logger.info("Found openmeetings conference room ID " + room_id);
        }

        requestElement.addChildElement("SID", NAMESPACE_PREFIX)
            .addTextNode(sid);
        requestElement.addChildElement("username", NAMESPACE_PREFIX)
            .addTextNode(displayedName);
        requestElement.addChildElement("room_id", NAMESPACE_PREFIX)
            .addTextNode(room_id);
        soapMessage.saveChanges();

        final SOAPBody soapResponseBody = getSOAPResponseBody(soapMessage, getJabberServiceUrl());
        final String textContent = soapResponseBody.getFirstChild().getTextContent();
View Full Code Here

Examples of javax.xml.soap.SOAPElement

        IOException,
        TransformerException
    {
        final SOAPMessage soapMessage = getSoapMessage();
        final SOAPBody soapBody = soapMessage.getSOAPBody();
        final SOAPElement elemCodeElement =
            soapBody.addChildElement("getAvailableRooms", NAMESPACE_PREFIX);
        elemCodeElement.addChildElement("SID", "rooms").addTextNode(sid);
        soapMessage.saveChanges();

        final SOAPBody soapResponseBody = getSOAPResponseBody(soapMessage, getJabberServiceUrl());
        final Node getFirstRoomResult = soapResponseBody.getFirstChild().getFirstChild();
        if (getFirstRoomResult == null)
View Full Code Here

Examples of javax.xml.soap.SOAPElement

        throws SOAPException,
        IOException
    {
        final SOAPMessage soapMessage = getSoapMessage();
        final SOAPBody soapBody = soapMessage.getSOAPBody();
        final SOAPElement errorCodeElement =
            soapBody.addChildElement("getErrorByCode", NAMESPACE_PREFIX);
        errorCodeElement.addChildElement("SID", NAMESPACE_PREFIX).addTextNode(
            sid);
        errorCodeElement.addChildElement("errorid", NAMESPACE_PREFIX)
            .addTextNode(error_id);
        errorCodeElement.addChildElement("language_id", NAMESPACE_PREFIX)
            .addTextNode("0");
        soapMessage.saveChanges();

        final SOAPBody soapResponseBody = getSOAPResponseBody(soapMessage, getUserServiceUrl());
        return soapResponseBody.getFirstChild().getTextContent();
View Full Code Here

Examples of javax.xml.soap.SOAPElement

         boolean   hasAnotherChild = cursor.toFirstChild(  );
         while ( hasAnotherChild )
         {
            // TODO: *SJC* the below logic should handle refProps that are complexTypes..
            // Best way to do may be to build SOAPMessage as XmlBean and use MessageFactory.createMessage(..) to construct using the InputStream
            SOAPElement soapElem = XmlBeanUtils.toSOAPElement( cursor.getObject(  ) );
            headerElem = header.addHeaderElement( soapElem.getElementName(  ) );
            headerElem.addTextNode( soapElem.getValue(  ) );
            hasAnotherChild = cursor.toNextSibling(  );
         }

         cursor.dispose(  );
      }
View Full Code Here

Examples of javax.xml.soap.SOAPElement

                soapFault.setFaultString(faultString);
                soapFault.setFaultActor(faultActor);

                Detail faultDetail = soapFault.addDetail();

                SOAPElement dispRpt = faultDetail.addChildElement("dispositionReport", "", IRegistry.UDDI_V2_NAMESPACE);
                dispRpt.setAttribute("generic", IRegistry.UDDI_V2_GENERIC);
                dispRpt.setAttribute("operator", Config.getOperator());

                SOAPElement result = dispRpt.addChildElement("result");
                result.setAttribute("errno", errno);

                SOAPElement errInfo = result.addChildElement("errInfo");
                errInfo.setAttribute("errCode", errCode);
                errInfo.setValue(errMsg);
            } catch (Exception e)
            { // if we end up in here it's just NOT good.
                log.error("A serious error has occured while assembling the SOAP Fault.", e);
            }
        } finally
View Full Code Here

Examples of javax.xml.soap.SOAPElement

           short nodeType = node != null ? node.getNodeType() : -100;
           if (Node.ELEMENT_NODE == nodeType)
           {
              Element el = (Element)node;
              Name name = factory.createName(el.getNodeName(), prefix,uddins);
              SOAPElement attachedEl = bodyElement.addChildElement(name);
              appendAttributes(attachedEl, el.getAttributes(), factory);
              appendElements(attachedEl, el.getChildNodes(), factory);
           } else if (nodeType == Node.TEXT_NODE)
           {
               bodyElement.addTextNode(node.getNodeValue());
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.