SVCUTIL.exe是否已损坏或是供应商的WSDL?

时间:2011-07-11 16:46:30

标签: wsdl svcutil.exe

我正在尝试使用SDK中的SVCUTIL来生成多个Web服务中的常见类型。当我尝试生成代码时,我得到错误(显示在底部) - 这些表明WSDL被破坏了。但是,如果我在ServiceReferences中导入服务,Visual Studio不会抱怨。 SVCUTIL坏了吗?

WSDL是公开的,并且是:

http://test.wlr3.net/empws/services/WLR3AssuranceServices?wsdl
http://test.wlr3.net/empws/services/WLR3BillingServices?wsdl
http://test.wlr3.net/empws/services/WLR3DialogueServices?wsdl
http://test.wlr3.net/empws/services/WLR3FulfillmentServices?wsdl
http://test.wlr3.net/empws/services/WLR3InventoryServices?wsdl
http://test.wlr3.net/empws/services/WLR3InventoryOrderServices?wsdl
http://test.wlr3.net/empws/services/WLR3InventoryTroubleReportServices?wsdl
http://test.wlr3.net/empws/services/WLR3InventoryWorkItemServices?wsdl
http://test.wlr3.net/empws/services/WLR3IssueServices?wsdl
http://test.wlr3.net/empws/services/WLR3ReportingServices?wsdl
http://test.wlr3.net/empws/services/WLR3SecurityServices?wsdl

如果你检查这些,你会看到很多常见类型和几个命名空间。我已经尝试将这些发送到SVCUTIL来生成代码,但它不喜欢FulfillmentServices和InventoryServices:

 Error: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter
Error: Cannot import invalid schemas. Compilation on the XmlSchemaSet failed.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://imperatives.co.uk/V20']/wsdl:portType[@name='WLR3FulfilmentServices']

Error: Cannot import wsdl:binding
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://imperatives.co.uk/V20']/wsdl:portType[@name='WLR3FulfilmentServices']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://imperatives.co.uk/V20']/wsdl:binding[@name='WLR3FulfillmentServicesHttpBinding']

Error: Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://imperatives.co.uk/V20']/wsdl:binding[@name='WLR3FulfillmentServicesHttpBinding']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://imperatives.co.uk/V20']/wsdl:service[@name='WLR3FulfillmentServices']/wsdl:port[@name='WLR3FulfillmentServicesHttpPort']

1 个答案:

答案 0 :(得分:1)

根据对该问题的评论,两个问题WSDL存​​在细微差别。我将它们与旧版本进行了比较,发现这些类型基于称为“Dto”的虚拟基类型。

这仅适用于两种类型 - 一种在Fulfillment Services中,一种在Inventory Services中,这些也可以在其他WSDL中找到但没有基础 - WSDL文件不一致。

所以我可以在这里点证SVCUTIL,并给供应商一脚......

感谢John Saunders看到它