How can i make this a valid WSDL?

capdragon picture capdragon · Sep 14, 2011 · Viewed 17.6k times · Source

I'm trying to generate code from this WSDL using the following command:

svcutil /noConfig /language:C# /out:ICatalog.cs http://schemas.opengis.net/csw/2.0.2/profiles/ebrim/1.0/wsdl/2.0/csw-ebrim-interface.wsdl

However svcutil cannot read it, and the xMethods WSDL validator says it's invalid.

What's invalid about it? How can i get svcutil to generate my interface code?

Answer

user159088 picture user159088 · Sep 15, 2011

I'm not sure if the WSDL is valid or not but what you are trying to do won't work. Svcutil can generate code only for WSDL files of version 1.1. Yours is a WSDL version 2.0.

The WSDL validator you pointed in your question returns the following message when given your WSDL:

faultCode=INVALID_WSDL: Expected element 'http://schemas.xmlsoap.org/wsdl/:definitions'.

It parses the file as WSDL 1.1. and expects the root to be definitions, but that changed in WSDL 2.0 to description.

If you have a valid WSDL 2.0 file, Svcutil2 might be able to generate the code for you, but this tool isn't stable yet.

To validate the WSDL, I guess you could use the validator from The Woden project, which isn't stable either, but is basically the only one that I know that has moved passed the "toy project" status.

The idea is this: version 1.1 is still the "de facto" language when taking WSDL. Not many WS frameworks have adopted WSDL 2.0 so (just my 2 cents!) I think it's better to stick with "the standard" untill support is fully matured for WSDL 2.0.