更新时间:2021-11-20 21:59:56
我对您的架构和 WSDL 进行了更多的尝试,并找到了您问题的答案,尽管您可能不喜欢它...
I have played a little more with your schemas and WSDL and found an answer to your issue, although you may not like it...
siri.xsd
,它会告诉你它找不到两个包含.xml.xsd
的任何引用并简化使用它的几个地方(仅限 xml:lang
)来解决此问题.我接下来要做的是将所有 XSD 直接放在根目录下,并修复 xsl:import
和 xsl:include
中的所有引用以反映这一点.许多重定义错误现已消失它现在抱怨 xs:group
是循环的(以前是这样,但我希望其他警告不会出现):
siri.xsd
and it will show you that it cannot locate two includes.xml.xsd
and simplifying the few places where it was used (xml:lang
only). Next thing I did was to place all XSD's directly under the root and fixed all references in xsl:import
and xsl:include
to reflect this. Many redefinition errors now disappearedIt now complains about an xs:group
being circular (it did so before, but I wanted other warnings to be out of the way):
Microsoft.ServiceModel.targets(113,5):错误:来自 targetNamespace=' 的ServiceDeliveryBodyGroup"组http://www.siri.org.uk/siri' 的定义无效:循环组引用.
Microsoft.ServiceModel.targets(113,5): error : Group 'ServiceDeliveryBodyGroup' from targetNamespace='http://www.siri.org.uk/siri' has invalid definition: Circular group reference.
这是一个棘手的问题,因为我没有设法追踪为什么它被认为是循环的,但如果是,这在 XSD 中是允许的.它被导入了两次,但这似乎不是原因,我认为这是故意的.
This is a tricky one, because I didn't manage to track why it is considered circular, but if it is, this is allowed in XSD. It gets imported twice, but that does not seem to be the cause, I think this is deliberate.
进一步搜索后,似乎是微软的xsd.exe
,与wsdl.exe
、svcutil
使用的代码类似并添加服务引用,已确认此限制了他们的 XSD 到对象映射工具.
After some further searches, it appears that Microsoft's xsd.exe
, which is similar to the code used by wsdl.exe
, svcutil
and add a service reference, has acknowledged this to be a limitation of their XSD-to-object mapping tools.
我认为你***的办法是把那个小组变成非圆形.之后,它应该接受模式为有效并继续.进口商抱怨 wsdl:portType
的事实并没有为您指明正确的方向.它抱怨说,因为它无法映射所有类型,导致根本没有映射任何类型,之后 wsdl:portType
也是未知的,因此错误.
I think your best bet is to take that group and make it non-circular. After that, it should accept the schemas as valid and proceed. The fact that the importer complains about wsdl:portType
does not point you in the right direction. It complains about that, because it fails to map all types, which results in mapping no types at all, after which also wsdl:portType
is unknown, hence the error.
修复 ServiceDeliveryBodyGroup
类型后,上述其他步骤很可能会过时.其他错误实际上是警告,我相信 Microsoft 基本上会忽略此类重新定义,并将正常"进行.
It is very well possible that the other steps outlined above become obsolete after you fix the ServiceDeliveryBodyGroup
type. The other errors were actually warnings, and I believe that Microsoft essentially ignores such redefinitions anyway and will proceed "normally".