Why generate minOccurs='0' while the parameter is not optional?

A

Alan Chen

Hi,
I am writing my first web service, here is the signiture of my
webmethod in C#:
[WebMethod]
public string Request(
string productType,
double version,
out string confirmationID
)

And here is part of the generated WSDL file:
- <s:element name="Request">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="productType"
type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="version"
type="s:double" />
</s:sequence>
</s:complexType>
</s:element>

My question is why minOccures="0" for productType even if it is not
optional.
I know there is no optional parameters for webmethod, but the WSDL
file might confuse users.
Thanks for your help!

Alan Chen
 
G

Girish bharadwaj

I am thinking because String can be nulled out.. I.e. caller can pass no
productType and it will come through as a null string (guessing, really).
 

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,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top