minOccurs from VB code - attribute?
- From: Lucvdv <replace_name@xxxxxxxx>
- Date: Fri, 16 Jun 2006 16:15:56 +0200
In a VB.Net webservice, after adding a data class, members of type String
get a "minOccurs=0" attribute in the generated WSDL.
Is there an attribute you can apply to the definition, or some other way to
turn this into "minOccurs=1"?
For example, in this class:
<WebService(Namespace:=...)> _
public class MyWebService
Inherits System.Web.Services.WebService
<WebMethod()> Public Sub TestFunc(byval t as TestData)
....
End Sub
public class TestData
Public Name as string
end class
end class
the "Name" member of TestData comes out in WSDL as
<s:element minOccurs="0" maxOccurs="1" name="Name" type="s:string" />
I'd like to get minOccurs="1" instead, so clients can understand that the
value isn't optional.
I've tried playing around with the IsNullable attribute through
SystemXml.Serialization.XmlElementAttribute and
System.Xml.Serialization.SoapElement, but it makes no difference.
.
- Follow-Ups:
- Re: minOccurs from VB code - attribute?
- From: Josh Twist
- Re: minOccurs from VB code - attribute?
- Prev by Date: Calling Web Service that calls other Web Service with Windows Authentication
- Next by Date: RE: Exceptions not serializable due to new data property?
- Previous by thread: Calling Web Service that calls other Web Service with Windows Authentication
- Next by thread: Re: minOccurs from VB code - attribute?
- Index(es):
Relevant Pages
|