Using Web Service with C#

J

Joseph R. Thomas

hi,
i am utilizing a web service in a C# windows application for a smart
client.
there is a method

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://kajol
.csse.monash.edu.au/cse3211/ValidateUser",
RequestNamespace="http://kajol.csse.monash.edu.au/cse3211",
ResponseNamespace="http://kajol.csse.monash.edu.au/cse3211",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)
]
public int ValidateUser(string userName, string password) {
object[] results = this.Invoke("ValidateUser", new object[]
{
userName,
password});
return ((int)(results[0]));
}

which works fine.....when i supply a user name and pwd..

but then there is this other method ;

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://kajol
.csse.monash.edu.au/cse3211/GetMovies",
RequestNamespace="http://kajol.csse.monash.edu.au/cse3211",
ResponseNamespace="http://kajol.csse.monash.edu.au/cse3211",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)
]
public System.Data.DataSet GetMovies(int userID) {
object[] results = this.Invoke("GetMovies", new object[] {
userID});
return ((System.Data.DataSet)(results[0]));
}

but whenever i supply the user id (196 or 129) to this it gives me error
saying
"The remote server returned an error : (403)
Forbidden"

but when i manually go to the site and enter the user id (196 or 129) i
dont get any error and i can see the data in XML format..


what i am trying to do in my code is to get the dataset returned by the
web-service method : "GetMovies" into a dataset so i do this :
DataSet ds = new System.Data.DataSet();
Users wsUsers = new Users();
ds = wsUsers.GetMovies(129);

this is where i get the above mentioned error..
can anyone pls help????
tks a lot...
 
S

Sami Vaaraniemi

Joseph R. Thomas said:
hi,
i am utilizing a web service in a C# windows application for a smart
client.
there is a method [snip]
but whenever i supply the user id (196 or 129) to this it gives me error
saying
"The remote server returned an error : (403)
Forbidden"

but when i manually go to the site and enter the user id (196 or 129) i
dont get any error and i can see the data in XML format..


what i am trying to do in my code is to get the dataset returned by the
web-service method : "GetMovies" into a dataset so i do this :
DataSet ds = new System.Data.DataSet();
Users wsUsers = new Users();
ds = wsUsers.GetMovies(129);

this is where i get the above mentioned error..
can anyone pls help????
tks a lot...

Is the server running Windows XP? Error code 403 might be an indication that
you are running into the 10 concurrent connections limit on Windows XP. If
so, try disabling HTTP keep-alives from IIS settings. This will not remove
the connection limit but will allow a few more connections.

Sami
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top