WebMethod and WSDL with optional parameters

P

PMCG

Hi
If i have a simple web service lik
[WebMethodAttribute()
public string DoIt(string Name, int Age

return ""

and i look at the WSDL i get
element minOccurs="0" for the string parameter but element minOccurs="1" for the int parameter
I cannot find any of the Serialization attributes that i could use on the string parameter to indicate it should occour at least once

If anyone has a solution for this i would appreciate your hel
Pat
 
J

Jan Tielens

This is because a string is a reference type and a int is a value type.

I don't know how you could control this... But I think it doesn't make sense
to change this. Consider this (normal) function:
public TestMe(string p)
{}

There is no way you could prevent an empty string to be passed...

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

PMCG said:
Hi,
If i have a simple web service like
[WebMethodAttribute()]
public string DoIt(string Name, int Age)
{
return "";
}
and i look at the WSDL i get
element minOccurs="0" for the string parameter but element minOccurs="1" for the int parameter.
I cannot find any of the Serialization attributes that i could use on the
string parameter to indicate it should occour at least once.
 

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,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top