Pass bool parameter to web method

B

Baohua Li

When I use bool parameter in my web method, it is always false regardless
what I pass in. I can use int or char, but I don't believe that web method
doesn't like bool parameter. Any idea?

Thanks,
Li
 
B

Baohua Li

It's input.

My web method is like this:

[WebMethod (Description = "Retrieve Jobs")]
public BusinessEntity.Job[] RetrieveJobList(string jobNumber, string
jobTitle1, contractNumber, bool stagingOnly, uint resultLimit)
{
if (stagingOnly)
{
...
}
......
}

stagingOnly is always 'false' regardless what I paased in.


Thanks,
 
J

Jan Tielens

I've altered your code to this (for testing):

[WebMethod (Description = "Retrieve Jobs")]
public string RetrieveJobList(bool stagingOnly)
{
if (stagingOnly)
return "Staging";
else
return "Not";
}

If I invoke this service from the web browser everything works fine. Also if
I invoke it from a test app in C#, it works fine too. So maybe you could try
to implement the function above (for testing) and let me know if it worked
by using IE and C#.

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan


Baohua Li said:
It's input.

My web method is like this:

[WebMethod (Description = "Retrieve Jobs")]
public BusinessEntity.Job[] RetrieveJobList(string jobNumber, string
jobTitle1, contractNumber, bool stagingOnly, uint resultLimit)
{
if (stagingOnly)
{
...
}
.....
}

stagingOnly is always 'false' regardless what I paased in.


Thanks,

Jan Tielens said:
Can you post some code? Is it an input or output parameter? Which language?

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
 

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

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top