By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,852 Members | 2,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,852 IT Pros & Developers. It's quick & easy.

Help - how to set WSDL minOccurs=1 for WebMethod argument properties?

P: n/a
I'm defining a C# WebMethod where the argument has properties that are

public bool PerformTask(SimpleObject simpleObject)

where SimpleObject is as follows:

public class SimpleObject
private string _name;

public SimpleObject()

public string MyName
return _name;
_name = value;

However, upon viewing the generated WSDL associated with this object, I
see the following:

<s:complexType name="SimpleObject">
<s:element minOccurs="0" maxOccurs="1" name="MyName"
type="s:string" />

This is a required property of the object for the application, and it
would be best to publish that fact in the generated WSDL instead of
adding application logic in my code to check this value and return an
error message if the required values are not populated. Is there any
attribute or mechanism that I can use which will result in a
specification that an object property is required in the generated WSDL

Thanks in advance

Mar 23 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.