HighTechTalks DotNet Forums  

web methods returning boolean : always returns false

ASP.net Web Services microsoft.public.dotnet.framework.aspnet.webservices


Discuss web methods returning boolean : always returns false in the ASP.net Web Services forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
ndrw_cheung@yahoo.ca
 
Posts: n/a

Default web methods returning boolean : always returns false - 11-27-2007 , 08:49 AM






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


Reply With Quote
  #2  
Old   
Cowboy \(Gregory A. Beamer\)
 
Posts: n/a

Default Re: web methods returning boolean : always returns false - 11-28-2007 , 02:06 PM






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.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
Quote:
Think outside the box!

*************************************************
<ndrw_cheung (AT) yahoo (DOT) ca> wrote

Quote:
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




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.