I would be truly grateful for some assistance in retrieving some information from a web service. I’m new to using web services but need to obtain some information but the only way is to “create” some sort of program to retrieve the information. I have read numerous tutorials for the last few days but still unable to get anything to work.
This is the information I have:
The web service application can be accessed at the following address: http://www.nphase.com/SIMCommissioningWS/commissioning.asmx
Logging in - "login" is the initial function that all applications must call to access the commissioning application. The function accepts a username, password, and an application name. THe username and password are verified to determine access to the application. If the username and password are valid, a secure token is returned to the calling application.
To login ot the NDCS application, call the login () function as follows:
[WebMethod]
public int Login (string UserName, string Password, string AppName, ref string token)
I, of course have the information that is needed but any way I try to do it, it just will not work.
Any help is greatly appreciated. Thanks. Chad
ChadPosted Sep 21, 2008, 5:42 PM
Scott LyslePosted Sep 21, 2008, 1:21 AM
I don't know what values would work but I added a web reference to a 2008 project pointed at the web service and used this code to evoke the login:
com.nphase.www.SIMCommissioning sc = new SimWebService.com.nphase.www.SIMCommissioning();
string token = string.Empty;
int i = sc.Login("Fred", "Bread", "Whiz", ref token);
MessageBox.Show(i.ToString() + " was returned from the web service");
MessageBox.Show(token + " is the value of the token");
Since I sent garbage to the service it returned an int value of -2 which I take as a failure, and the token was left an empty string. Looking at it, I assume that the token, once recieved, is used with other calls to different web methods.