本文介绍了如果 &lt;redefine&gt; svcUtil 错误 'SchemaLocation' 必须成功解决包含除 <annotation> 之外的任何子项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从 3rd 方 wsdl 和 xsd 文件生成代理.我像这样调用 svcutil:

I am trying to generate a proxy from a 3rd party wsdl and xsd files. I am calling svcutil like so:

svcutil *.wsdl *.xsd /language:C#

它返回此错误:如果包含除 . 以外的任何子项,则SchemaLocation"必须成功解析.

It returns this error: 'SchemaLocation' must successfully resolve if contains any child other than .

所有文件中只有一个元素,它的schemaLocation属性指向同一目录下的另一个文件.我尝试完全限定 uri,但这没有帮助.

There is only one element in all the files, and it's schemaLocation attribute points to another file in the same directory. I tried fully qualifying the uri, but that did not help.

想法?

推荐答案

此错误是由与 wsdl 文件无关的问题引起的.portType 操作参数已命名,但绑定操作参数未命名.当我修复这个 svcutil 生成的代理时,我假设它一定能够找到正确的 xsd 包含.

This error was caused by an unrelated problem with the wsdl file. The portType operation parameters were named, but the binding operation peramters were not. When I fixed this svcutil generated the proxy, so I assume it must have been able to find the proper xsd includes.

这篇关于如果 &lt;redefine&gt; svcUtil 错误 'SchemaLocation' 必须成功解决包含除 <annotation> 之外的任何子项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 07:33