Creating araays as unbounded elements instead of "ArrayOf" elements

Discussion in 'ASP .Net Web Services' started by John Harvey, Jan 9, 2006.

  1. John Harvey

    John Harvey Guest

    I have been struggling with the following: I want to create a class
    that contains an array of some user-defined type. so I have the
    following vb code:

    Public Class Communications
    Public PhoneInfo() As ACORD.PhoneInfo
    End Class

    Public Class PhoneInfo
    Public PhoneNumber As String
    Public PhoneTypeCd As String
    End Class

    The problem is when I generate the WSDL I get:


    <s:complexType name="Communications">
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="PhoneInfo"
    type="tns:ArrayOfPhoneInfo" />
    </s:sequence>
    </s:complexType>
    <s:complexType name="ArrayOfPhoneInfo">
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="unbounded" name="PhoneInfo"
    nillable="true" type="tns:phoneInfo" />
    </s:sequence>
    </s:complexType>
    <s:complexType name="PhoneInfo">
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="PhoneNumber"
    type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="PhoneTypeCd"
    type="s:string" />
    </s:sequence>
    </s:complexType>

    But I was hoping for:

    <s:complexType name="Communications">
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="unbounded" name="PhoneInfo"
    type="tns:phoneInfo" />
    </s:sequence>
    </s:complexType>
    <s:complexType name="PhoneInfo">
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="PhoneNumber"
    type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="PhoneTypeCd"
    type="s:string" />
    </s:sequence>
    </s:complexType>

    Any help would be greatly appreciated!
     
    John Harvey, Jan 9, 2006
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.