开发者

How can i make this a valid WSDL?

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 ge开发者_StackOverflow中文版t svcutil to generate my interface code?


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.


try to add reference References > Add Reference > COM > System.ServiceModel

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜