2

I have the following in a WSDL I am consuming;

<xsd:complexType name="SomeClassType">
  <xsd:sequence>
    <xsd:element type="xsd:string" name="errorMessage" minOccurs="1" nillable="true" maxOccurs="1">     </xsd:element>
    <xsd:element type="tp:ArrayOfArrayOfString" name="values" minOccurs="1" nillable="true" maxOccurs="1">     </xsd:element>
    <xsd:element type="xsd:boolean" name="isEmpty" minOccurs="1" maxOccurs="1">      </xsd:element>
  </xsd:sequence>
</xsd:complexType>

where

<xsd:complexType name="ArrayOfArrayOfString">
  <xsd:complexContent>
    <xsd:restriction base="soapenc:Array">
      <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[,]"></xsd:attribute>
    </xsd:restriction>
  </xsd:complexContent>
</xsd:complexType>

However using wsdl.exe from MS (Runtime Version: 1.1.4322.573) generates

    public class SomeClassType {

        /// 
        public string errorMessage;

        /// 
        public string[] values;

        /// 
        public bool isEmpty;

    }

I expected string[,] values not string[] values

Is there a fix or a work around to this problem? (other than manually changing the generated code)

Asher
  • 1,016
  • 1
  • 6
  • 20
  • Step one: maybe you shouldn't be using obsolete versions of .NET? Step two: maybe you should be using WCF instead? Try it at least, to see if svcutil.exe can handle the WSDL and produce reasonable code. Step three: are you at least running the latest service pack of .NET 1.1? Step four: try .NET 2.0, which is largely the fix to .NET 1.1. – John Saunders Apr 20 '11 at 06:27
  • @John: not my call to make. stuck in the past. .NET1.1 or bust. – Asher Apr 20 '11 at 06:33
  • @John: I have tried this with Visual Studio Express 2010 (which is framework 4 right?) and it fails there too. So it looks like it is not a framework issue... – Asher Apr 20 '11 at 06:43
  • @Asher: sorry to hear that. RPC/Encoded services are difficult, if not impossible, to use. They're not WS-I BP 1.1 compliant. – John Saunders Apr 20 '11 at 12:34
  • @John: Do you know how to specify a multidimensional array type in the WSDL so that .NET tools will consume it properly? – Asher Apr 21 '11 at 07:52
  • It's not a question of the array - it's a question of how the service is implemented. If you want, try creating a service yourself that returns a similar multi-dimensional array, and look to see what kind of WSDL .NET produces. – John Saunders Apr 21 '11 at 16:02
  • @John: I had to set the type="tp:ArrayOfArrayOfString" to type="tp:ArrayOfString" and the maxOccurs="unbounded". – Asher Apr 28 '11 at 08:58
  • @Asher: post that as an answer, and I'll upvote it. – John Saunders Apr 28 '11 at 15:54

3 Answers3

1

I had to set the type="tp:ArrayOfArrayOfString" to type="tp:ArrayOfString" and the maxOccurs="unbounded"

Asher
  • 1,016
  • 1
  • 6
  • 20
0

I believe you could try the WCF proxy generator (I believe WCF uses some other util, not wsdl.exe) - maybe that would be useful, but if that fails - I think that manually editing the generated code is your only option.

Hassan
  • 2,603
  • 2
  • 19
  • 18
0

Try svcutil.exe. it is advisable to try a newer version of .net.

Dipti Mehta
  • 537
  • 3
  • 13