WCF:添加服务引用不生成客户端代理代码
我正在尝试使用 Visual Studio 2010 Express
来演练这个项目http://www.codeproject.com/KB/windows-phone-7/Text_to_speech_in_wp7.aspx?display=Print
测试 Windows 7 手机文本到语音。当我添加对所有内容的引用时
http://api.microsofttranslator.com/V2/Soap.svc
似乎有效。但是,我没有获得客户端代理代码。 Reference.cs 为空,Visual Studio 出现以下警告和错误:
警告 1 自定义工具警告:无法导入 wsdl:portType 详细信息:运行 WSDL 导入扩展时引发异常:System.ServiceModel.Description.DataContractSerializerMessageContractImporter 错误:无法从程序集“System.Runtime.Serialization,Version=2.0.5.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e”加载类型“System.Runtime.Serialization.DataContractSet”。 错误源的 XPath: //wsdl:definitions[@targetNamespace='http://api.microsofttranslator.com/V2']/wsdl:portType[@name='LanguageService'] D:\Documents\Visual Studio 2010\Projects \TrackMe\TrackMe\Service References\MicrosoftTranslator\Reference.svcmap 1 1 TrackMe
警告 2 自定义工具警告:无法导入 wsdl:binding 详细信息:导入 wsdl:binding 所依赖的 wsdl:portType 时出错。 wsdl:portType 的 XPath: //wsdl:definitions[@targetNamespace='http://api.microsofttranslator.com/V2']/wsdl:portType[@name='LanguageService'] 错误源的 XPath: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='BasicHttpBinding_LanguageService'] D:\Documents\Visual Studio 2010\Projects\TrackMe\ TrackMe\Service References\MicrosoftTranslator\Reference.svcmap 1 1 TrackMe
警告 3 自定义工具警告:无法导入 wsdl:port 详细信息:导入 wsdl:port 所依赖的 wsdl:binding 时出错。 wsdl:binding 的 XPath: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='BasicHttpBinding_LanguageService'] 错误源的 XPath: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='SoapService']/wsdl:port[@name='BasicHttpBinding_LanguageService'] D :\Documents\Visual Studio 2010\Projects\TrackMe\TrackMe\Service References\MicrosoftTranslator\Reference.svcmap 1 1 追踪我
警告 4 自定义工具警告:未找到与 Silverlight 3 兼容的端点。除非通过构造函数提供端点信息,否则生成的客户端类将不可用。 D:\Documents\Visual Studio 2010\Projects\TrackMe\TrackMe\Service References\MicrosoftTranslator\Reference.svcmap 1 1 TrackMe
警告 5 自定义工具警告:调用目标已引发异常。 D:\Documents\Visual Studio 2010\Projects\TrackMe\TrackMe\Service References\MicrosoftTranslator\Reference.svcmap 1 1 TrackMe
错误 6 自定义工具错误:无法为服务引用“MicrosoftTranslator”生成代码。请检查其他错误和警告消息以了解详细信息。 D:\Documents\Visual Studio 2010\Projects\TrackMe\TrackMe\Service References\MicrosoftTranslator\Reference.svcmap 1 1 TrackMe
取消选中“引用程序集中的重用类型”也没有帮助。
以前有人遇到过这个吗?
I am trying to walk through this project sing Visual Studio 2010 Express
http://www.codeproject.com/KB/windows-phone-7/Text_to_speech_in_wp7.aspx?display=Print
to test Windows 7 phone text to speech. When I add a reference to
http://api.microsofttranslator.com/V2/Soap.svc
all seems to work. However, I do not get client proxy code. Reference.cs is empty and Visual Studio presents the following warnings and errors:
Warning 1 Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Could not load type 'System.Runtime.Serialization.DataContractSet' from assembly 'System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://api.microsofttranslator.com/V2']/wsdl:portType[@name='LanguageService'] D:\Documents\Visual Studio 2010\Projects\TrackMe\TrackMe\Service References\MicrosoftTranslator\Reference.svcmap 1 1 TrackMeWarning 2 Custom tool warning: 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://api.microsofttranslator.com/V2']/wsdl:portType[@name='LanguageService']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='BasicHttpBinding_LanguageService'] D:\Documents\Visual Studio 2010\Projects\TrackMe\TrackMe\Service References\MicrosoftTranslator\Reference.svcmap 1 1 TrackMeWarning 3 Custom tool warning: 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://tempuri.org/']/wsdl:binding[@name='BasicHttpBinding_LanguageService']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='SoapService']/wsdl:port[@name='BasicHttpBinding_LanguageService'] D:\Documents\Visual Studio 2010\Projects\TrackMe\TrackMe\Service References\MicrosoftTranslator\Reference.svcmap 1 1 TrackMeWarning 4 Custom tool warning: No endpoints compatible with Silverlight 3 were found. The generated client class will not be usable unless endpoint information is provided via the constructor. D:\Documents\Visual Studio 2010\Projects\TrackMe\TrackMe\Service References\MicrosoftTranslator\Reference.svcmap 1 1 TrackMe
Warning 5 Custom tool warning: Exception has been thrown by the target of an invocation. D:\Documents\Visual Studio 2010\Projects\TrackMe\TrackMe\Service References\MicrosoftTranslator\Reference.svcmap 1 1 TrackMe
Error 6 Custom tool error: Failed to generate code for the service reference 'MicrosoftTranslator'. Please check other error and warning messages for details. D:\Documents\Visual Studio 2010\Projects\TrackMe\TrackMe\Service References\MicrosoftTranslator\Reference.svcmap 1 1 TrackMe
Unchecking 'Reuse types in referenced assemblies" does not help either.
Anyone run into this before?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论