The following topic describes how to realize the interaction between TrackStudio and a .NET application using TrackStudio SOAP API.
To develop the client application that uses TrackStudio SOAP API you must:
Create a proxy class for each service. Every proxy class must be a separate namespace. To generate a proxy to access the User service execute the following command:
wsdl.exe http://localhost:8888/TrackStudio/services/User?wsdl /out:dll/UserService.cs /namespace:User
As a result, the UserService.cs proxy class will be created in the dll folder. Repeat these steps for other services and link all the created proxy classes to the ts.dll library:
csc.exe /t:library /out:ts.dll dll\*.cs
UserService uSrv = new UserService();
tSrv.Url = "http://localhost:8888/TrackStudio/services/User";
string sessionId = uSrv.authenticate("root", "root");
The session id received as the result of authentication can be used to call other methods.
The code presented below shows the example of the simple .NET client application:
using System; using User; public class SoapTest { public static void Main(string[] args) { UserService uSrv = new UserService(); uSrv.Url = "http://localhost:8888/TrackStudio/services/User"; string sessionId = uSrv.authenticate("root", "root"); Console.WriteLine("Session ID is: " + sessionId); } }
csc.exe /reference:ts.dll SoapTest.cs
C:\soap\dotNET>SoapTest.exe Session ID is: 297e234cfbf9889500fbf989ee890012
Copyright (c) 2002-2006. All rights reserved.
|
What do you think about this topic? Send feedback!
|