使用 svcutil.exe 生成接口时出错
有人可以帮我生成以下 OGC 架构的接口 (c#) 文件吗?
架构文件:下载架构文件链接
我需要为上面架构 zip 文件中的 Ordering wsdl 创建 Web 服务。我已经研究了好几天了,但没有成功生成界面。我已经尝试过:
svcutil.exe thewsdl.wsdl /language:c# /out:ITheInterface.cs
svcutil Order.wsdl /out:IOrder.cs
svcutil Order.wsdl Order.xsd ..\ws-addressing\ws-addr.xsd /out:IOrder.cs
svcutil Order.wsdl Order.xsd ws-addr.xsd /out:IOrder.cs
并且出现以下错误:
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.1]
Copyright (c) Microsoft Corporation. All rights reserved.
Error: Cannot read ws-addr.xsd.
Cannot load file D:\Documents\DEV\SARPilot\Docs\eoschema\schema\OrderSchema\ws-addr.xsd as an Assembly. Check the FusionLogs f
or more Information.
Could not load file or assembly 'file:///D:\Documents\DEV\SARPilot\Docs\eoschema\schema\OrderSchema\ws-addr.xsd' or one of its
dependencies. The module was expected to contain an assembly manifest.
Can someone help me generate the Interface (c#) file for the following OGC schema?
Schema files: Download Schema Files Link
I need to create web services for the Ordering wsdl in the schema zip file above. I've been at it for days now with no luck generating the interface. I've tried:
svcutil.exe thewsdl.wsdl /language:c# /out:ITheInterface.cs
svcutil Order.wsdl /out:IOrder.cs
svcutil Order.wsdl Order.xsd ..\ws-addressing\ws-addr.xsd /out:IOrder.cs
svcutil Order.wsdl Order.xsd ws-addr.xsd /out:IOrder.cs
and i get the following error:
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.1]
Copyright (c) Microsoft Corporation. All rights reserved.
Error: Cannot read ws-addr.xsd.
Cannot load file D:\Documents\DEV\SARPilot\Docs\eoschema\schema\OrderSchema\ws-addr.xsd as an Assembly. Check the FusionLogs f
or more Information.
Could not load file or assembly 'file:///D:\Documents\DEV\SARPilot\Docs\eoschema\schema\OrderSchema\ws-addr.xsd' or one of its
dependencies. The module was expected to contain an assembly manifest.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,所以我已经克服了这个错误。 (我现在得到更多,但这些是另一个问题)。
我在 VS2010 中打开 ws-addr.xsd 文件并查看警告列表。一位说:
所以我去了“http://www.w3.org/ 2005/08/addressing/ws-addr.xsd”并下载正确的并替换它。
我不再收到警告 105,也不再收到 svcutil 的“无法加载文件”错误
Okay, so i've gotten past this error. (i get more now, but those are for another question).
I opened the ws-addr.xsd file in VS2010 and looked down the warnings list. one said:
So i man went to "http://www.w3.org/2005/08/addressing/ws-addr.xsd" and downloaded the correct one and replaced it.
I no longer got the warning 105, and no longer get the "Could not load file" error with svcutil
另一件需要注意的事情是 wsdl 文件的编码。我收到了一个 wsdl 文件,但它没有使用 UTF-8 编码,因此我收到了“无法加载文件或程序集”消息。事实上,它所说的汇编完全是误导性的,就像微软错误经常出现的情况一样。在我看来,错误消息中应该禁止使用“或”一词。无论如何,解决方案是在 Notepad++ 中打开 wsdl 并转换为 UTF-8。 (编码-转换为UTF-8)
Another thing to be aware of is the encoding of the wsdl file. I received a wsdl file but it was not encoded with UTF-8 and so I got the 'could not load file or assembly' message. The fact that it says assembly is completely misleading, as is often the case with Microsoft errors. In my opinion the word "or" should be banned from error messages. Anyway the soloution was to open the wsdl in Notepad++ and convert to UTF-8. (Encoding-Convert to UTF-8)