Visual Studio 2010 中的服务引用添加问题
我目前正在开发一个允许使用 silverlight + bing 地图进行反向地理编码的应用程序。问题是我想添加对 msdn 中提供的反向地理编码服务的引用( http://msdn.microsoft.com/en-us/library/cc879136.aspx)即http://dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc?wsdl,但是当我尝试在 vs2010 中获取参考,出现以下错误:
url http://dev.virtualearth.net/webservices/v1/metadata/geocodeservice/geocodeservice.wsdl 处的文档未被识别为已知文档类型。
来自每个已知类型的错误消息可能会帮助您解决问题:
- “XML Schema”的报告是“”,十六进制值 0x1F,是无效字符。第 1 行,位置 1。'。
- 来自“DISCO Document”的报告为 ''',十六进制值 0x1F,是无效字符。第 1 行,位置 1。'。
- “WSDL 文档”的报告是“XML 文档 (1, 1) 中存在错误。”。
- '',十六进制值 0x1F,是无效字符。第 1 行,位置 1。 元数据包含无法解析的引用:'http://dev. virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc?wsdl'。 内容类型 application/soap+xml;服务 http://dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc?wsdl 不支持 charset=utf-8。客户端和服务绑定可能不匹配。 远程服务器返回错误:(415) 不支持的媒体类型。 如果当前解决方案中定义了该服务,请尝试构建该解决方案并再次添加服务引用。
值得一提的是,我可以从浏览器访问服务 URL(没有样式信息警告)。我知道还有其他反向地理编码服务,但在某些情况下我被迫只使用 Microsoft 相关的组件/服务。请帮忙:)
I am currently working on an application that allows reverse geocoding using silverlight + bing maps. The thing is that I want to add a reference to the reverse geocoding service provided in msdn ( http://msdn.microsoft.com/en-us/library/cc879136.aspx) i.e. http:// dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc?wsdl, but when I try to get a reference in vs2010, I get the following error:
The document at the url http:// dev.virtualearth.net/webservices/v1/metadata/geocodeservice/geocodeservice.wsdl was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'XML Schema' is ''', hexadecimal value 0x1F, is an invalid character. Line 1, position 1.'.
- Report from 'DISCO Document' is ''', hexadecimal value 0x1F, is an invalid character. Line 1, position 1.'.
- Report from 'WSDL Document' is 'There is an error in XML document (1, 1).'.
- '', hexadecimal value 0x1F, is an invalid character. Line 1, position 1.
Metadata contains a reference that cannot be resolved: 'http://dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc?wsdl'.
Content Type application/soap+xml; charset=utf-8 was not supported by service http: //dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc?wsdl. The client and service bindings may be mismatched.
The remote server returned an error: (415) Unsupported Media Type.
If the service is defined in the current solution, try building the solution and adding the service reference again.
- '', hexadecimal value 0x1F, is an invalid character. Line 1, position 1.
It is good to mention that I can access the service URL from the browser (with a no style information warning). I am aware that there are other reverse geolocoding services out there, but I am somewhat forced by certain circumstances to use only Microsoft-related components/services. Please help :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚尝试过同样的事情,它似乎对我来说效果很好。我在 MSDN 新闻组上看到一篇文章,表明参考文献在某个阶段可能存在问题(请参阅 Bing 地图路线计算服务),尽管它提到是暂存 URL 导致了问题,而不是您所遇到的问题使用(如当前文章中所示)。除此之外,您使用的是VS2010当前的RC吗? (如果早期版本存在问题)
可能值得再试一次;我在 http://code.google.com/p 上创建了一个存根应用程序/bingmapssilverlightapp/downloads/list 如果有任何用处。
I've just tried the same thing and it seems to work fine for me. I saw an article on the MSDN newsgroups that suggest there may have been a problem at some stage with the references (see a post on Bing Map Route Calculation Service) although it mentions that it was the staging URL's that were causing a problem, not those that you're using (as in the article currently). Other than that, are you using the current RC of VS2010? (on the off chance that there were issues in an earlier version)
Might be worth trying again; I've whipped up a stub application at http://code.google.com/p/bingmapssilverlightapp/downloads/list if it's any use.