cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2603
Views
10
Helpful
14
Replies

AXL SOAPUI load Groups from a member

softwareguy
Level 1
Level 1

Hello all,

Looking for a bit of help please as this is the final bit of my puzzle. 

 

I would like get the details from CUCM page about groups from members search criteria using AXLtoolkit  in SOAPUI with API 11.5.

 

this bit of code loads all members in a given group where the group is called "testgroup"

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/11.5">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:getLineGroup>
         <name>testgroup<name/>
         <returnedTags>
            <members>
               <member>
                  <directoryNumber>
                     <pattern/>
                  </directoryNumber>
               </member>
            </members>
            <name/>
         </returnedTags>
      </ns:getLineGroup>
   </soapenv:Body>
</soapenv:Envelope>

What I am wanting to now do is the opposite of this.

I am wanting to load all groups that a given member say member 70001 is in, I know that this member is in two groups but I now want to load those groups from the member search.

Can you help with what call I need to do this with please?

 

thank you for any and all help given as always. 

 

1 Accepted Solution

Accepted Solutions

I think in order to get at the data 'backwards' like this, you will need to use a custom SQL query.  This seems to be a good starting point:

 

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ns:executeSQLQuery xmlns:ns="http://www.cisco.com/AXL/API/11.5">
      <sql xsi:type="xsd:string">select linegroup.name from linegroup, numplan, linegroupnumplanmap 
      where linegroupnumplanmap.fklinegroup=linegroup.pkid and 
      linegroupnumplanmap.fknumplan=numplan.pkid and
      numplan.dnorpattern='1000'</sql>
    </ns:executeSQLQuery>
  </soap:Body>
</soap:Envelope>

View solution in original post

14 Replies 14

TDoan
Level 1
Level 1

Hi,

 

The getLineGroup function gets the particular name only. If you would like to list all line groups then you need to use listLineGroup. as follows

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/11.5">
<soapenv:Header/>
   <soapenv:Body>
        <ns:listLineGroup sequence="1">
             <searchCriteria>
                 <name>%</name>
             </searchCriteria>');
             <returnedTags><uuid/><name/></returnedTags>
       </ns:listLineGroup>
   </soapenv:Body>
</soapenv:Envelope>

 

Note: % = list all line groups in CUCM

         In this example I only return uuid and name.

 

Hope this would help you.

 

Regards

Thuy Doan

Thank you Thuy Doan for your reply, however the answer you posted is not what I am looking for on this occasion. 

All this does is list the groups or list a group I already know the name of.

 

I am trying to list all of the groups that a user/member is apart of, so the search criteria needs to include the user/member of that group in this case "70001" and as far as I can see the listLineGroup function does not allow for that search criteria. 

 

I welcome all responses to solve this problem. 

Hi,

You mean the line group is the Hunt List. If so, you can use getHuntList and will return uuid, description, name, members (members -> lineGroupName - uuid)...

Hope this would help you.

 

Regards,

Thuy Doan

 

 

 

 

Hi Thuy Doan

Thank you for the response.

can you show me the code for this as i cannot get it work without a faultstring error or using a Hunt list to search for a line group but I need to use the user to search for groups they are apart of and this does not seem to be an option as i can see using getHuntList?

 

thank you for any and all help

Hi,

This is a sample code as follows

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/11.5">
<soapenv:Header/>
    <soapenv:Body>
        <ns:getHuntList sequence="1">
              <name>YourHuntName</name>
              <returnedTags><uuid/><name/><description/>
                   <members>
                         <member>
                              <uuid/>
                              <lineGroupName>
                                     <uuid/>
                              </lineGroupName>
                         </member>
                   </members>
             </returnedTags>
        </ns:getHuntList>
    </soapenv:Body>
</soapenv:Envelope>

 

Regards,

Thuy Doan

 

Thank you Thuy Doan, however this still does not help. this has just moved the problem up. this is using a hunt list name as the search term.

 

to be clear I need to do the following:

 

input a user/member of a group as the only search term in this test case "70001"

 

I then need my query to output the groups or to be clearer the Line groups this member/user is part of.

 

as far as i can see getHuntGroup, getLineGroup or getHuntList cannot be used in this way. 

 

kind regards. 

Hi,

As I know getUser will return firstName, lastName, uuid, associatedGroups (userGroup, userRoles -> userRole)...

If you getUserGroup will return uuid, name, members (member -> uuid), userRoles -> userRole -> uid,

userRoles -> userRole ->roleName -> uuid)

and getHuntList function. It depends on which function you want to use in your case.

Hope this would help you.

 

Regards,

Thuy Doan

 

Hi,

Please confirm if <70001> is the hunt/line group or extension or group name.

 

Regards

Thuy Doan

70001 is the username/extension, all users on my system are stored by a 5 digit number. 

 

I am needing to input in the username and output the group 

Hi,

If <70001> is an username then you need to use getUser and will return firstName, lastName, associatedGroups....

If <70001> is an extension then you need to use getLine and will return pattern, description, presenceGroupName ....

 

Regards,

Thuy Doan

 

Thank you Thuy Doan for your continued patience here. 

<70001> is the username so I used getUser

which loads fine when using userid as the search term and then loads everything from the CCUM page on that user except the two Line Groups the user is in and that is the thing I need. 

 

Is there a return tag for getUser that will return the Line Groups that the user is in?

This is the code I am using

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/11.5">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:getUser>
         <userid>70001</userid>
         <returnedTags>
            <firstName/>
            <displayName/>
            <lastName/>
            <iserid/>
            <mailid/>
            <associatedGroups>
		<userGroup>
		   <name/>
		   <userRoles>
		      <userRole/>
		   </userRoles>
		</userGroup>
            </associatedGroups>
            <presenceGroupName/>
         </returnedTags>
      </ns:getUser>
   </soapenv:Body>
</soapenv:Envelope>

 

 

I have also tried to use getLine however, the search pattern I am using does not load. I am trying the username that is also the extension <70001> I have also tried the wildcard option ”%” with no luck.

This is the code.

 

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/11.5">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:geLine>
         <pattern>70001</pattern>
         <returnedTags>
            <pattern/>
            <description/>
            <usage/>
            <routePartitionName/>
            <aarNeighborhoodName/>
            <callPickupGroupName>
            <presenceGroupName/>
            <active/>
         </returnedTags>
      </ns:getLine>
   </soapenv:Body>
</soapenv:Envelope>

 

 

 

 

I can see on the CCUM page of user <70001> that the user is in Line Group “testgroup” and “techgroup” but I cannot get this to load as an AXL request with the input of the user <70001>

 

Thank you for any and all help from everyone

 

 

I think in order to get at the data 'backwards' like this, you will need to use a custom SQL query.  This seems to be a good starting point:

 

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ns:executeSQLQuery xmlns:ns="http://www.cisco.com/AXL/API/11.5">
      <sql xsi:type="xsd:string">select linegroup.name from linegroup, numplan, linegroupnumplanmap 
      where linegroupnumplanmap.fklinegroup=linegroup.pkid and 
      linegroupnumplanmap.fknumplan=numplan.pkid and
      numplan.dnorpattern='1000'</sql>
    </ns:executeSQLQuery>
  </soap:Body>
</soap:Envelope>

Thank you for the reply.

 

Being fairly new to all of this I have never used SQL before, so I apologise for the delay in my reply as I have been trying to read what I can about SQL

 

 

This works great thank you, I just need to understand now what the SQL query is actually doing. 

thank you dstaudt for the great reply. Is there there any documentation to explain SQL in this AXL stuff so I can understand and learn more?

 

thank you again

Glad this helped :)

The SQL does a SQL 'join' (actually an implicit inner join) that associates the three tables in the query based on the first two 'where' clause criteria, i.e. by their primary key fields. An additional criteria at the end of the 'where' clause limits the results where the DN=1000.

Some more detail on SQL joins: https://en.wikipedia.org/wiki/Join_(SQL)
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: