尝试添加服务引用时出现错误消息

发布于 2024-08-12 22:12:11 字数 1097 浏览 9 评论 0原文

我正在尝试从托管服务器上存储的文件向我的 silverlight 项目添加服务引用。当我输入链接时,出现以下错误:

The document at the url http://www.lloydp.co.uk/Test/WcfRectangleService.dll was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'DISCO Document' is 'Data at the root level is invalid. Line 1, position 1.'.
- Report from 'WSDL Document' is 'There is an error in XML document (1, 1).'.
  - Data at the root level is invalid. Line 1, position 1.
- Report from 'XML Schema' is 'Data at the root level is invalid. Line 1, position 1.'.
Metadata contains a reference that cannot be resolved: 'http://www.lloydp.co.uk/Test/WcfRectangleService.dll'.
The content type application/octet-stream of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: 'MZ�

任何人都可以告诉我问题是什么吗? XML 文件无论如何都没有被更改,我对这一切都很陌生,所以我现在有点迷失。

提前致谢,

劳埃德

I'm trying to add a service reference to my silverlight project from a file stored on my hosting server. When I put the link in I get the following error:

The document at the url http://www.lloydp.co.uk/Test/WcfRectangleService.dll was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'DISCO Document' is 'Data at the root level is invalid. Line 1, position 1.'.
- Report from 'WSDL Document' is 'There is an error in XML document (1, 1).'.
  - Data at the root level is invalid. Line 1, position 1.
- Report from 'XML Schema' is 'Data at the root level is invalid. Line 1, position 1.'.
Metadata contains a reference that cannot be resolved: 'http://www.lloydp.co.uk/Test/WcfRectangleService.dll'.
The content type application/octet-stream of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: 'MZ�

Can anyone tell me what the problem is? The XML file hasn't been altered in anyway, I'm new to all this so I'm a bit lost at the minute.

Thanks in advance,

Lloyd

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱本泡沫多脆弱 2024-08-19 22:12:11

您指向的 URL http://www.lloydp.co.uk/Test/ WcfRectangleService.dll - 请注意 .dll 扩展名。这是该服务的内部代码。因此 Web 服务器返回的是一堆二进制代码而不是 XML 文档。

相反,请指向 .svc 文件——这是服务端点。

You are pointing at the URL http://www.lloydp.co.uk/Test/WcfRectangleService.dll -- note the .dll extension. This is the internal code for the service. So the web server is returning a bunch of binary code rather than a XML document.

Point at the .svc file instead -- this is the service endpoint.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文