Returns a list of co-workers of the current user.
Visual Basic (declaration) |
---|
Public Function GetCoWorkers( _ |
C# (declaration) |
---|
public XmlNode GetCoWorkers( |
<response success="true" error="">
<users>
<User exists="true" Domain="Developer Center" UserName="JoeD" FirstName="Joe" LastName="Doe" Email="joed@acme.com" .... />
<User exists="true" Domain="" UserName="Guest" FirstName="Guest" LastName="NA" Email="" .../>
</users>
</response>
Visual Basic Example |
---|
Public Sub ListCoWorkers() Const IRAuthenticationTicket As String = "sid-xxxxxxxxxxxxxxxx" Dim xmlResponse As System.Xml.XmlElement Dim IR_Obj As InfoRouter.srv Try 'Create InfoRouter Object IR_Obj = New InfoRouter.srv xmlResponse = IRObj.GetCoWorkers(IR_AuthenticationTicket) If xmlResponse.GetAttribute("success") = "true" Then 'get co-workers elem Dim xmlcoworkers As System.Xml.XmlElement = xmlResponse.FirstChild Console.WriteLine("Co-workers of " & IR_UID) Console.WriteLine("----------------------------------") 'loop trough users Dim xmlUserElem As System.Xml.XmlElement For Each xmlUserElem In xmlcoworkers Console.WriteLine(xmlUserElem.GetAttribute("DomainName") & vbTab & _ xmlUserElem.GetAttribute("UserName") & vbTab & _ xmlUserElem.GetAttribute("FirstName") & vbTab & _ xmlUserElem.GetAttribute("LastName") & vbTab & _ xmlUserElem.GetAttribute("Email")) Next Console.WriteLine("----------------------------------") Else Console.WriteLine("Server Response:" & xmlResponse.GetAttribute("error")) End If xmlResponse = Nothing Catch ex As Exception Console.WriteLine("Error:" & ex.message) Finally IR_Obj = Nothing End Try End Sub |