1

I'm struggling with the following problem:

I have a PHP-based web service which needs to be consumed by various clients. As long as I keep things simple, everything works fine. I figured that Axis2 and .NET don't like soapenc:array definitions in WSDL, so I created list types for mapping object arrays:

<xsd:complexType name="CourseList">
  <xsd:sequence>
    <xsd:element name="Courses" type="tns:Course" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

Now, if I include something like a List of CourseLists (using the same WSDL procedure), .NET fails as Axis2 (ADB) does with handling this data. I checked the XML that comes over the wire with soapUI; it looks reasonable.

I'm really on the ropes with this one. Any hint would be highly appreciated.

TIA

 KB22

1 Answer 1

2

This question is older than sin, but it's never been answered, and I struggled to find an answer myself when I recently ran into the same problem. There might be a better way to do this, but what I ultimately ended up doing was something like this.

This is actually even a level further, a 3-d array, but the general principle is the same.

<xs:element name="myOtherArray">
<xs:complexType>
    <xs:sequence>
        <xs:element name="someInsideArrayProperty" type="xs:int"/>
    </xs:sequence>
</xs:complexType>

<xs:element name="myArray">
<xs:complexType>
    <xs:sequence>
        <xs:element name="someArrayProperty" type="xs:string"/>
        <xs:element name="yetAnotherArray" maxOccurs="unbounded" type="ns:myOtherArray"/>
    </xs:sequence>
</xs:complexType>

<xs:element name="myResponse">
<xs:complexType>
    <xs:sequence>
        <xs:element name="myResponseArray" maxOccurs="unbounded">
            <xs:complexType>
                <xs:sequence>
                    <xs:element name="someProperty" type="xs:int"/>
                    <xs:element name="someOtherProperty" type="xs:string"/>
                    ...
                    <xs:element name="anotherArray" type="ns:myArray" maxOccurs="unbounded"/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
    </xs:sequence>
</xs:complexType>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.