C#.NET SOAP Quickstart Guide
Examples of how to use ListManager's functions with C# .NET are available in your ListManager's soap directory:
http://yourlistmanagerurl/soap
These instructions show how to use Visual Studio with ListManager.
1. Open Visual Studio and run create new project.
2. Add Web reference http://yourlistmanagerserver/soap/wsdl/
and name it lmapiSoap.
Modify the URL above so yourlistmanagerserver points to the URL for your ListManager installation.
3. Due to a bug in VS.NET, YOU MUST modify Reference.cs or sqlSelect() will not
work
In Reference.cs:, change the function SqlSelect from:
public string[] SqlSelect(string SqlStatement)
{
object[] results = this.Invoke("SqlSelect", new object[] { SqlStatement});
return ((string[])(results[0]));
}
TO:
public string[][] SqlSelect(string SqlStatement)
{
object[] results = this.Invoke("SqlSelect", new object[] { SqlStatement});
return ((string[][])(results[0]));
}
Note the only difference is the function now returns a multi-dimensional array.
The following is the minimal client script for C#:
------C#---------
// Initialize listmanager soap object
lm = new lmapiSoap.lmapi();
// setup basic authorization
String username = "admin";
String password = "lyris";
lm.Credentials = new System.Net.NetworkCredential(username, password);
// verify we are using a version of the server this client is written for
if (lm.ApiVersion() != "1.0 Beta")
{
MessageBox.Show("Incorrect API Version! :"+ lm.ApiVersion());
}
// verify API functions work...
MessageBox.Show(lm.CurrentUserEmailAddress());
![]() ![]() |