web methods returning boolean : always returns false

Discussion in 'ASP .Net Web Services' started by ndrw_cheung@yahoo.ca, Nov 27, 2007.

  1. Guest

    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
    , Nov 27, 2007
    #1
    1. Advertising

  2. 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

    *************************************************
    | Think outside the box!
    |
    *************************************************
    <> wrote in message
    news:...
    > 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
    >
    Cowboy \(Gregory A. Beamer\), Nov 28, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. feng

    IsPostBack always returns False

    feng, Dec 9, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    569
    Jose L Rodriguez
    Dec 9, 2003
  2. =?Utf-8?B?VGltOjouLg==?=

    Boolean always false????

    =?Utf-8?B?VGltOjouLg==?=, Jul 25, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    716
    Clint Hill
    Jul 25, 2005
  3. peter
    Replies:
    3
    Views:
    354
    peter
    Jun 22, 2006
  4. DJ
    Replies:
    3
    Views:
    923
  5. Iñaki Baz Castillo
    Replies:
    9
    Views:
    193
    Igor Pirnovar
    Feb 26, 2009
Loading...

Share This Page