Problem in web service's web method's parameters.

Last post 06-09-2008 5:07 PM by RogerRabbit. 5 replies.

Sort Posts:

  • Problem in web service's web method's parameters.

    05-15-2008, 6:21 AM
    • Loading...
    • rashish12
    • Joined on 06-21-2007, 6:48 AM
    • Posts 9

    Hello All,

    I am tring to consume a Java web service in ASP.NET(c#) application.

    In the web service, the web method 'checklogin' accepts 2 string parameters only, with return type a boolean variable.

     But, when I use that method in my ASP.NET application it shows me 4 parameters in the definition namely 2 string parameters(which should be there) and extra 2  boolean type OUT parameters. Out of these 2 extra OUT parameters, in the 1st parameter I get the return variable of the web method which I called/used and in the 2nd parameter, its showing nothing (means its showing default value).

    e.g. the actual definition for the web method is -

    bool checkLogin(string username,string password)

    and the definition I am getting at the time of calling that method is -

    checkLogin(string username,string password, out bool return, out bool returnspecified).

    Can anybody please figure out that where the actually problem is? In the Java web service or in the .NET application and why its showing 2 extra parameters?

    Thanks in advance.

    Ashish R. 

  • Re: Problem in web service's web method's parameters.

    05-15-2008, 12:35 PM

    What does is the WSDL for the method?

     

  • Re: Problem in web service's web method's parameters.

    05-16-2008, 5:01 AM
    • Loading...
    • rashish12
    • Joined on 06-21-2007, 6:48 AM
    • Posts 9

     I am getting the  same number of parameters in WSDL too as I have defined in the web service i.e 2 string parameters.

     But still its prompting for 4 parameters while using in ASP.NET application.

     
     

  • Re: Problem in web service's web method's parameters.

    05-27-2008, 12:35 PM

    Is your return value (bool) declared as nullable?

     

    eg: bool?  or Nullable<bool> 

  • Re: Problem in web service's web method's parameters.

    05-28-2008, 11:22 AM
    • Loading...
    • rashish12
    • Joined on 06-21-2007, 6:48 AM
    • Posts 9

    No, I havent declared the return value as nullable.

  • Re: Problem in web service's web method's parameters.

    06-09-2008, 5:07 PM

    Sorry, I just realized this is a Java web service.  I think you will find that the WSDL contains the attribute nillable="true" where the response type for the web services is declared.  For every nillable parameter or return value in the web method, .Net generates a *specified property to indicate if the type is null.  In your example this means that the function returns the boolean value and a value indicating if the boolean value is null.  Since a function can only return one value and not two, the two return values are converted to ref or out parameters. 

     

     

Page 1 of 1 (6 items)