将WSDL导入.NET项目只会创建一个空命名空间

我第一次尝试使用WCF。 这是我做的:

  1. 在VS 2010中创建了一个控制台.NET 4项目
  2. 添加了WSDL文件作为服务引用。

但是,我似乎无法使用该服务,因为没有创建类。 服务引用只是一个空命名空间。

我错过了什么?

这是WSDL:

                                              main schema e-service developers Nicholas Knowles, KIZOOM LTD., London EC4A 1LT Europe >Drafted for version 1.0, by Cen TC278 WG3 SG7 Christophe Duquesne DRYADE SA mailto:schemer@siri.org.uk  2005-03-01   2005-05-11   2007-01-30   2007-04-17    2008-02-12    2007-04-17     

SIRI is a European CEN standard for the exchange of real time information. This describes WSDL Server binding

text/xml http://www.w3.org/2001/XMLSchema XML schema, W3C Recommendation 2001 {http://www.siri.org.uk/schemas/1.3/siri}siri_wsProducer.wsdl [ISO 639-2/B] ENG Kizoom, 109-123 Clifton Street, London EC4A 4LD Unclassified CEN, VDV, RTIG 2005-2008
  • SIRI is derived from the VDV, RTIGXML and Trident standards.
Version 1.0 Draft for approval Arts, recreation and travel, Tourism, Travel (tourism), Transport, Air transport, Airports, Ports and maritime transport, Ferries (marine), Public transport, Bus services, Coach services, Bus stops and stations, Rail transport, Railway stations and track, Train services, Underground trains, Business and industry, Transport, Air transport , Ports and maritime transport, Public transport, Rail transport, Roads and road transport Cen TC278 WG3 SG7 SIRI XML schema. WSDL Server binding. Standard

显然导入模式有错误,我应该查看错误列表窗口。

尝试运行命令工具wsdl.exe。 我用你的wsdl试了一下,但是有一些错误。 将wsdl保存到文件(此处为service.wsdl)并尝试运行:

 wsdl service.wsdl /language:CS 

应创建一个名为Service.cs的文件,您可以将其包含在项目中。