web service xml (array hierarchy is too deep)

rsaffy

New member
Joined
Jan 16, 2009
Messages
1
Programming Experience
10+
vb.net 2005 web service asp.net

The hierarchy of the generated wsdl (xml) has too many elements. Here is the code I started with...

VB.NET:
Public Class SalesID_Role
    Public SALESID As String
    Public VALID_ROLES() As String
End Class

which generates xml like...
HTML:
<SALESID>123456</SALESID>
<VALID_ROLES>
    <string>AM</string>
    <string>MM</string>
</VALID_ROLES>

What I want is something like...
HTML:
<SALESID>123456</SALESID>
<VALID_ROLES>
    <ROLE_TYPE>AM</ROLE_TYPE>
    <ROLE_TYPE>MM</ROLE_TYPE>
</VALID_ROLES>

----------------------------------------------------------------
So, I do this...
VB.NET:
Public Class SalesID_Role_Office
    Public SALESID As String
    Public VALID_ROLES() As ROLE_TYPES
End Class
Public Class ROLE_TYPES
    Public ROLE_TYPE As String
End Class

and end up with xml in this format...
HTML:
<SALESID>123456</SALESID>
<VALID_ROLES>
    <ROLE_TYPES>
        <ROLE_TYPE>AM</ROLE_TYPE>
    </ROLE_TYPES>
    <ROLE_TYPES>
        <ROLE_TYPE>MM</ROLE_TYPE>
    </ROLE_TYPES>
</VALID_ROLES>

I don't want the <ROLE_TYPES> elements. It is harder to read.

Any ideas? I have searched everywhere for what I would think would be a simple solution ...thanks in advance.

Sorry about all the extra white space. I had trouble formatting this this post.
 

Latest posts

Back
Top