web methods returning boolean : always returns false

N

ndrw_cheung

Hi, all. I have a created a web service with a web method that returns
a boolean (bool) value.

[WebMethod]
public bool IsUser(String username)
{
....
}


When I tested it on the local server using the .asmx page, it returns
the appropriate value depending on the parameter passed in. However,
when I created some code to consume the web service and invokes the
web method, it always returns false regardless.

The webservice and the page that consumes it are running under .NET
2.0.

Any ideas why that's happening? How do I fix it?

Thanks in advance for your help.

-Andrew
 
C

Cowboy \(Gregory A. Beamer\)

You also have to be sure any SOAP message you put together properly adheres
to the WSDL. Start by looking at the WSDL (contract) and you should be able
to see which elements you have set up incorrectly.

My suggestion, as it is one of the best ways to learn, is to download
Fiddler2 and examine the actual SOAP sent to the method. It will shine a bit
of light. There are equivalent tools that plug into both IE and FireFox, if
you prefer a tool that plugs into the browser. These tools are also a great
way to "cheat" and see where you are setting up your own SOAP calls
incorrectly.

Another help is setting up a test project with a web reference and ripping
through the proxy code created.
 

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

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top