符合WCF服务标准的“汽车零售技术标准”

时间:2018-12-11 21:11:10

标签: .net wcf

我需要构建符合STAR(汽车零售技术标准)模型link to wsdl and xsd的WCF服务。我正在尝试使用svcutil.exe工具生成类和端点,但收到如下错误:

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://www.starstandards.org/webservices/2009/transport/bindings']/wsdl:binding[@name='starTransport']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.starstandards.org/webservices/2009/transport/bindings']/wsdl:service[@name='ProcessServiceAppointmentWebService']/wsdl:port[@name='ProcessServiceAppointmentStarTransport']

Error: There was a validation error on a schema generated during export:
Source:
Line: 2747 Column: 14
Validation Error: The 'http://www.openapplications.org/oagis/9:Signature' element is not declared.

我尝试了诸如svcutil *.wsdl *.xsd之类的不同命令,但是它也无法正常工作。

有人曾经使用这种标准构建任何服务吗?

1 个答案:

答案 0 :(得分:0)

您可以使用Visual Studio的xsd2code扩展名将xsd文件转换为类,但仍然必须创建操作合同等。

另一个选择是将wsdl添加到soupUI,双击绑定,这将为您显示该wsdl所需的所有xsd文件的列表。然后使用wsdl.exe传入wsdl和所有相应的xsd文件。这可能使您更接近所需的东西,但是如果您要实现他们的许多wsdl的话,将会非常乏味。

示例:

wsdl /si /protocol:SOAP /l:CS /o:"c:\test\starfile" "C:\test\STAR\5.11.4\WSDL\WS4Templates\ProcessPartsPriceList.wsdl" "C:\test\STAR\5.11.4\BODs\Developer\ProcessPartsPriceList.xsd" "C:\test\STAR\5.11.4\Resources\Nouns\PartsPriceList.xsd" "C:\test\STAR\5.11.4\Resources\Components\Common\QualifiedDataTypes.xsd" "C:\test\STAR\5.11.4\Resources\Components\OAGIS\CoreComponents\QualifiedDataTypes.xsd" "C:\test\STAR\5.11.4\Resources\Components\OAGIS\CoreComponents\UnqualifiedDataTypes.xsd" "C:\test\STAR\5.11.4\Resources\Components\OAGIS\Common\CodeLists.xsd" "C:\test\STAR\5.11.4\Resources\Components\OAGIS\CoreComponents\CodeList_CurrencyCode_ISO_7_04.xsd" "C:\test\STAR\5.11.4\Resources\Components\OAGIS\CoreComponents\CodeList_LanguageCode_ISO_7_04.xsd" "C:\test\STAR\5.11.4\Resources\Components\OAGIS\CoreComponents\CodeList_MIMEMediaTypeCode_IANA_7_04.xsd" "C:\test\STAR\5.11.4\Resources\Components\OAGIS\CoreComponents\CodeList_UnitCode_UNECE_7_04.xsd" "C:\test\STAR\5.11.4\Resources\Components\Common\CodeLists.xsd" "C:\test\STAR\5.11.4\Resources\Components\Common\CodeList_UnitsOfMeasureCode_XFront.xsd" "C:\test\STAR\5.11.4\Resources\Components\Common\CodeLists_NMMA.xsd" "C:\test\STAR\5.11.4\Resources\Components\OAGIS\Common\Components.xsd" "C:\test\STAR\5.11.4\Resources\Components\OAGIS\Common\Meta.xsd" "C:\test\STAR\5.11.4\Resources\Components\OAGIS\Common\Fields.xsd" "C:\test\STAR\5.11.4\Resources\Components\Common\Meta.xsd" "C:\test\STAR\5.11.4\Resources\Components\Common\DeprecatedComponents.xsd" "C:\test\STAR\5.11.4\Resources\Components\Common\Components.xsd" "C:\test\STAR\5.11.4\BODs\Developer\AcknowledgePartsPriceList.xsd" "C:\test\STAR\5.11.4\WSDL\WS4Templates\STARWSDLDataTypes4.xsd"