views:

1411

answers:

2

I'm pointing the .Net command line WSDL utility that ships with Visual Studio 2005 at a web service implemented in Java (which I have no control over) and it spits out the following error:

WSDL : error WSDL1: Unable to cast object of type 'System.Xml.XmlElement' 
to type 'System.Web.Services.Description.ServiceDescriptionFormatExtension'.

Yet if I point Visual Studio 2005 itself at the service via the Add Web Reference dialog it generates a proxy class for me just fine.

I'm using the WSDL utility to generate all my other service proxies just fine (though an old one does emit a bunch of warnings).

Currently I'm pointing the WSDL utility at the URLs of deployed web services. All of which were developed in Java.

I want to use the WSDL command line utility in the build process to ensure I have the most up-to-date proxy code each time I compile.

A: 

Is this an XSD File? files have dependencies. Download the dependency files and place them side/by/side with the XSD you downloaded. I would assume visual studio may fetch dependencies.

If this doesn't solve it, please provide more details.

Klathzazt
+1  A: 

Try specifying the option protocol SOAP12

/protocol:protocol (as show on MSDN)

Specifies the protocol to implement. You can specify SOAP (default), HttpGet, HttpPost, or a custom protocol specified in the configuration file. When using the /parameters option, this value is the element and contains a string.

If that does not help then.......

Visual Studio's "Add Web Reference" calls the WSDL.exe when adding a web reference. Basically there is no difference, other then the control you retain when running the WSDL.exe command from the command line. I would suspect that one of your arguments is incorrect or different then the one Visual Studio is setting.

To test this you would need to compare the output for from the 2 different XSD files that are generated, that will give you more of a clue of what is wrong(as Klathzazt has suggested).

Good Luck

cgreeno
/protocol:soap12 appears to have fixed the problem. Thanks.
orj