minOccurs from VB code - attribute?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lucvdv

    #1

    minOccurs from VB code - attribute?

    [I already asked this in the .framework.webs ervices group last week, but
    got no answer]


    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(Nam espace:=...)> _
    public class MyWebService
    Inherits System.Web.Serv ices.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 understand that the value
    isn't optional.

    I tried using the IsNullable attribute through
    System.Xml.Seri alization.XmlEl ementAttribute and
    System.Xml.Seri alization.SoapE lement, but it makes no difference.
Working...