<p>Is there a way to change the way asp.net generates elements in the WSDL generated from a .asmx file?  Specifically, it seems to mark all elements minoccurs="0" and there are some elements that I want to be minoccurs="1" (aka required fields). </p>

<p>One of these is an argument to the web service (e.g.  foo(arg1, arg2) where I want arg2 to be generated in the WSDL as minoccurs="1") the other is a particular field in the class that corresponds to arg1.  Do I have to forego auto WSDL generation and take a "contract first" approach?</p>

I think that the
```
XmlElement(IsNullable = true)
```
attribute will do the job:
```
```
using System.Xml.Serialization;

[WebMethod]
public string MyService([XmlElement(IsNullable = true)] string arg)
{
  return "1";
}
```
```
EDIT [VB version]
```
```
Imports System.Xml.Serialization

Public Function MyService(<XmlElement(IsNullable:=True)> ByVal arg As String) As String
  Return ("1")
End Function
```
```