Examples of MessageElement


Examples of org.apache.axis.message.MessageElement

      org.apache.axis.message.MessageElement[] roleList = roleResp.get_any();

      if (roleList.length != 1)
        throw new ManifoldCFException("Bad response - expecting one outer 'GetUserCollectionFromRole' node, saw "+Integer.toString(roleList.length));

      MessageElement roles = roleList[0];
      if (!roles.getElementName().getLocalName().equals("GetUserCollectionFromRole"))
        throw new ManifoldCFException("Bad response - outer node should have been 'GetUserCollectionFromRole' node");

      Iterator rolesIter = roles.getChildElements();
      while (rolesIter.hasNext())
      {
        MessageElement child = (MessageElement)rolesIter.next();
        if (child.getElementName().getLocalName().equals("Users"))
        {
          Iterator usersIterator = child.getChildElements();
          while (usersIterator.hasNext())
          {
            MessageElement user = (MessageElement)usersIterator.next();
            if (user.getElementName().getLocalName().equals("User"))
            {
              rval.add(user.getAttribute("Sid"));
            }
          }
        }
      }     
    }
View Full Code Here

Examples of org.apache.axis.message.MessageElement

    throws ManifoldCFException
  {
    try
    {
      GetListItemsViewFields rval = new GetListItemsViewFields();
      MessageElement viewFieldsNode = new MessageElement((String)null,"ViewFields");
      rval.set_any(new MessageElement[]{viewFieldsNode});
      for (Object x : fieldNames)
      {
        MessageElement child = new MessageElement((String)null,"FieldRef");
        viewFieldsNode.addChild(child);
        child.addAttribute(null,"Name",(String)x);
      }
      return rval;
    }
    catch (javax.xml.soap.SOAPException e)
    {
View Full Code Here

Examples of org.apache.axis.message.MessageElement

    throws ManifoldCFException
  {
    try
    {
      GetListItemsQuery rval = new GetListItemsQuery();
      MessageElement queryNode = new MessageElement((String)null,"Query");
      rval.set_any(new MessageElement[]{queryNode});
      MessageElement whereNode = new MessageElement((String)null,"Where");
      queryNode.addChild(whereNode);
      MessageElement eqNode = new MessageElement((String)null,"Eq");
      whereNode.addChild(eqNode);
      MessageElement fieldRefNode = new MessageElement((String)null,"FieldRef");
      eqNode.addChild(fieldRefNode);
      fieldRefNode.addAttribute(null,"Name",fieldName);
      MessageElement valueNode = new MessageElement((String)null,"Value");
      eqNode.addChild(valueNode);
      valueNode.addAttribute(null,"Type",type);
      valueNode.addTextNode(value);
      return rval;
    }
    catch (javax.xml.soap.SOAPException e)
    {
      throw new ManifoldCFException(e.getMessage(),e);
View Full Code Here

Examples of org.apache.axis.message.MessageElement

     
      if (Logging.authorityConnectors.isDebugEnabled()){
        Logging.authorityConnectors.debug("SharePoint authority: getUserInfo xml response: '" + usersList[0].toString() + "'");
      }

      MessageElement users = usersList[0];
      if (!users.getElementName().getLocalName().equals("GetUserInfo"))
        throw new ManifoldCFException("Bad response - outer node should have been 'GetUserInfo' node");
         
      String userID = null;
      String userName = null;
     
      Iterator userIter = users.getChildElements();
      while (userIter.hasNext())
      {
        MessageElement child = (MessageElement)userIter.next();
        if (child.getElementName().getLocalName().equals("User"))
        {
          userID = child.getAttribute("ID");
          userName = child.getAttribute("LoginName");
        }
      }

      // If userID is null, no such user
      if (userID == null)
        return null;

      List<String> accessTokens = new ArrayList<String>();
      accessTokens.add("U"+userName);
     
      com.microsoft.schemas.sharepoint.soap.directory.GetGroupCollectionFromUserResponseGetGroupCollectionFromUserResult userGroupResp =
        userCall.getGroupCollectionFromUser( userLoginName );
      org.apache.axis.message.MessageElement[] groupsList = userGroupResp.get_any();
     
      /* Response looks like this:
          <GetGroupCollectionFromUser xmlns=
             "http://schemas.microsoft.com/sharepoint/soap/directory/">
             <Groups>
                <Group ID="3" Name="Group1" Description="Description" OwnerID="1"
                   OwnerIsUser="False" />
                <Group ID="15" Name="Group2" Description="Description"
                   OwnerID="12" OwnerIsUser="True" />
                <Group ID="16" Name="Group3" Description="Description"
                   OwnerID="7" OwnerIsUser="False" />
             </Groups>
          </GetGroupCollectionFromUser>
        */

      if (groupsList.length != 1)
        throw new ManifoldCFException("Bad response - expecting one outer 'GetGroupCollectionFromUser' node, saw "+Integer.toString(groupsList.length));

      if (Logging.authorityConnectors.isDebugEnabled()){
        Logging.authorityConnectors.debug("SharePoint authority: getGroupCollectionFromUser xml response: '" + groupsList[0].toString() + "'");
      }

      MessageElement groups = groupsList[0];
      if (!groups.getElementName().getLocalName().equals("GetGroupCollectionFromUser"))
        throw new ManifoldCFException("Bad response - outer node should have been 'GetGroupCollectionFromUser' node");
         
      Iterator groupsIter = groups.getChildElements();
      while (groupsIter.hasNext())
      {
        MessageElement child = (MessageElement)groupsIter.next();
        if (child.getElementName().getLocalName().equals("Groups"))
        {
          Iterator groupIter = child.getChildElements();
          while (groupIter.hasNext())
          {
            MessageElement group = (MessageElement)groupIter.next();
            if (group.getElementName().getLocalName().equals("Group"))
            {
              String groupID = group.getAttribute("ID");
              String groupName = group.getAttribute("Name");
              // Add to the access token list
              accessTokens.add("G"+groupName);
            }
          }
        }
      }

      // AxisFault is expected for case where user has no assigned roles
      try
      {
        com.microsoft.schemas.sharepoint.soap.directory.GetRoleCollectionFromUserResponseGetRoleCollectionFromUserResult userRoleResp =
          userCall.getRoleCollectionFromUser( userLoginName );
        org.apache.axis.message.MessageElement[] rolesList = userRoleResp.get_any();

        if (rolesList.length != 1)
          throw new ManifoldCFException("Bad response - expecting one outer 'GetRoleCollectionFromUser' node, saw "+Integer.toString(rolesList.length));
       
        if (Logging.authorityConnectors.isDebugEnabled()){
          Logging.authorityConnectors.debug("SharePoint authority: getRoleCollectionFromUser xml response: '" + rolesList[0].toString() + "'");
        }

        // Not specified in doc and must be determined experimentally
        /*
<ns1:GetRoleCollectionFromUser xmlns:ns1="http://schemas.microsoft.com/sharepoint/soap/directory/">
  <ns1:Roles>
    <ns1:Role ID="1073741825" Name="Limited Access" Description="Can view specific lists, document libraries, list items, folders, or documents when given permissions."
      Order="160" Hidden="True" Type="Guest" BasePermissions="ViewFormPages, Open, BrowseUserInfo, UseClientIntegration, UseRemoteAPIs"/>
  </ns1:Roles>
</ns1:GetRoleCollectionFromUser>'
        */
       
        MessageElement roles = rolesList[0];
        if (!roles.getElementName().getLocalName().equals("GetRoleCollectionFromUser"))
          throw new ManifoldCFException("Bad response - outer node should have been 'GetRoleCollectionFromUser' node");
           
        Iterator rolesIter = roles.getChildElements();
        while (rolesIter.hasNext())
        {
          MessageElement child = (MessageElement)rolesIter.next();
          if (child.getElementName().getLocalName().equals("Roles"))
          {
            Iterator roleIter = child.getChildElements();
            while (roleIter.hasNext())
            {
              MessageElement role = (MessageElement)roleIter.next();
              if (role.getElementName().getLocalName().equals("Role"))
              {
                String roleID = role.getAttribute("ID");
                String roleName = role.getAttribute("Name");
                // Add to the access token list
                accessTokens.add("R"+roleName);
              }
            }
          }
View Full Code Here

Examples of org.apache.axis.message.MessageElement

    throws ManifoldCFException
  {
    try
    {
      GetListItemsQuery rval = new GetListItemsQuery();
      MessageElement queryNode = new MessageElement((String)null,"Query");
      rval.set_any(new MessageElement[]{queryNode});
      MessageElement orderByNode = new MessageElement((String)null,"OrderBy");
      queryNode.addChild(orderByNode);
      orderByNode.addAttribute(null,"Override","TRUE");
      orderByNode.addAttribute(null,"UseIndexForOrderBy","TRUE");
      MessageElement fieldRefNode = new MessageElement((String)null,"FieldRef");
      orderByNode.addChild(fieldRefNode);
      fieldRefNode.addAttribute(null,"Ascending","TRUE");
      fieldRefNode.addAttribute(null,"Name",indexedColumn);
      return rval;
    }
    catch (javax.xml.soap.SOAPException e)
    {
      throw new ManifoldCFException(e.getMessage(),e);
View Full Code Here

Examples of org.apache.axis.message.MessageElement

    throws ManifoldCFException
  {
    try
    {
      GetListItemsQueryOptions rval = new GetListItemsQueryOptions();
      MessageElement queryOptionsNode = new MessageElement((String)null,"QueryOptions");
      rval.set_any(new MessageElement[]{queryOptionsNode});
      MessageElement pagingNode = new MessageElement((String)null,"Paging");
      queryOptionsNode.addChild(pagingNode);
      pagingNode.addAttribute(null,"ListItemCollectionPositionNext",pageNextString);
      MessageElement viewAttributesNode = new MessageElement((String)null,"ViewAttributes");
      queryOptionsNode.addChild(viewAttributesNode);
      viewAttributesNode.addAttribute(null,"Scope","Recursive");

      return rval;
    }
    catch (javax.xml.soap.SOAPException e)
    {
View Full Code Here

Examples of org.apache.axis.message.MessageElement

    throws ManifoldCFException
  {
    try
    {
      GetListItemsQueryOptions rval = new GetListItemsQueryOptions();
      MessageElement queryOptionsNode = new MessageElement((String)null,"QueryOptions");
      rval.set_any(new MessageElement[]{queryOptionsNode});
      MessageElement viewAttributesNode = new MessageElement((String)null,"ViewAttributes");
      queryOptionsNode.addChild(viewAttributesNode);
      viewAttributesNode.addAttribute(null,"Scope","Recursive");

      return rval;
    }
    catch (javax.xml.soap.SOAPException e)
    {
View Full Code Here

Examples of org.apache.axis.message.MessageElement

                    MessageElement [] newElements = new MessageElement[length + 1];
                    if (curElements != null) {
                        System.arraycopy(curElements, 0,
                                         newElements, 0, length);
                    }
                    MessageElement thisEl = context.getCurElement();

                    newElements[length] = thisEl;
                    propDesc.set(value, newElements);

                    return new SOAPHandler();
View Full Code Here

Examples of org.apache.axis.message.MessageElement

       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.getCompleteAttributes();
       assertTrue(atts.getLength()==2);
    }
View Full Code Here

Examples of org.apache.axis.message.MessageElement

            String localName,
            DeserializationContext context)
            throws SAXException {

        try {
            MessageElement msgElem = context.getCurElement();
            if (msgElem != null) {
                ArrayList children = msgElem.getChildren();
                if (children != null) {
                    msgElem = (MessageElement) children.get(0);
                    if (msgElem != null) {
                        // Unmarshall the nested XML element into a castor object of type 'javaType'
                        value = Unmarshaller.unmarshal(javaType, msgElem.getAsDOM());
                    }
                }
            }
        } catch (MarshalException me) {
            log.error(Messages.getMessage("castorMarshalException00"), me);
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.