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. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    446
  2. Mavis
    Replies:
    0
    Views:
    432
    Mavis
    Jun 1, 2006
  3. pete142
    Replies:
    5
    Views:
    443
    Ben Bacarisse
    Jan 23, 2008
  4. Bob Rock
    Replies:
    3
    Views:
    170
    Ming Chen [.NET MVP]
    Jun 17, 2004
  5. Jen
    Replies:
    3
    Views:
    223
    Robert Klemme
    Mar 23, 2011
Loading...

Share This Page