将WSDL导入.NET项目只会创建一个空命名空间
我第一次尝试使用WCF。 这是我做的:
- 在VS 2010中创建了一个控制台.NET 4项目
- 添加了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 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的文件,您可以将其包含在项目中。
上述就是C#学习教程:将WSDL导入.NET项目只会创建一个空命名空间分享的全部内容,如果对大家有所用处且需要了解更多关于C#学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请点击右边联系管理员删除。
如若转载,请注明出处:https://www.ctvol.com/cdevelopment/1003112.html