views:

548

answers:

2

It seems that the nested element with a custom defined type doesn't work in visual studio 2008. I have the following wsdl file:

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
 xmlns:ns1="http://org.apache.axis2/xsd"
 xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
 xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:ns0="http://processmaker.com"
 xmlns:xs="http://www.w3.org/2001/XMLSchema"
 xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
 xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
 targetNamespace="http://processmaker.com"&gt;
  <wsdl:types>
     <xs:element name="processListStruct" >
        <xs:complexType >
          <xs:sequence >
            <xs:element name="guid" type="xs:string"/>
            <xs:element name="name" type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
     <xs:element name="processListResponse" >
        <xs:complexType >
          <xs:sequence >
            <xs:element name="processes" maxOccurs="unbounded" type="ns0:processListStruct"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
</wsdl:types>
<!-- snip other definition -->
</wsdl:definitions>

However inside Visual studio I got a "type processListStruct not declared error" when I navigated my mouse cursor over the line <xs:element name="processes" maxOccurs="unbounded" type="ns0:processListStruct"/> . And as I wanted to generate the proxy class using the following command,

wsdl /out:mycsclass.cs blahblah.wsdl

I got an error saying that

The datatype 'http://processmaker.com:processListStruct' is missing.

How to fix this, and is there any other tool besides wsdl that can successfully transform the above element?

A: 

I believe that this is a wsdl.exe bug and I have reported this issue to Microsoft.

Ngu Soon Hui
A: 

As Microsoft responded, it's not a WSDL.EXE bug, it's a bug in the schema:

<xs:element name="processes" maxOccurs="unbounded" type="ns0:processListStruct"/>

Yet, as we can see:

<xs:element name="processListStruct" >

processListStruct is an element, not a type.

John Saunders
But the wsdl should be able to distinguish between element and type, even though they have the same name.
Ngu Soon Hui
No. It's not WSDL that's the problem. The XML schema is simply bad. You said type=, but it's an element. They are not the same thing.
John Saunders