URL上的文档未被识别为已知文档类型。 [英] The document at the url was not recognized as a known document type.

查看:248
本文介绍了URL上的文档未被识别为已知文档类型。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

场景描述:

1)创建一个WCF项目并将其作为服务在IIS中发布。单击服务的管理网站>可以查看其WSDL。浏览站点:http:// localhost:48677 / Service1.svc / GetDataTable

2)创建了一个应用程序项目,并尝试将WCF服务添加为服务引用。我收到了他的错误:

网址http:// localhost:48677 / Service1.svc / GetDataTable中的文档未被识别为已知文档类型。

Scenario Description:
1) Created a WCF project and publish it in IIS as a service. Its WSDL can be viewed by clicking the service's Manage Web Site > Browse at the site: http://localhost:48677/Service1.svc/GetDataTable
2) Created an application project, and tried add the WCF service as a Service Reference. I received he error:
The document at the url http://localhost:48677/Service1.svc/GetDataTable 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 'The root element of a W3C XML Schema should be <schema> and its namespace should be 'http://www.w3.org/2001/XMLSchema'.'.
- Report from 'DISCO Document' is 'Discovery document at the URL http://localhost:48677/Service1.svc/GetDataTable could not be found.'.
  - The document format is not recognized.
- Report from 'WSDL Document' is 'There is an error in XML document (1, 2).'.
  - <GetDataTableResponse xmlns='http://tempuri.org/'> was not expected.
Metadata contains a reference that cannot be resolved: 'http://localhost:48677/Service1.svc/GetDataTable'.
The remote server returned an unexpected response: (405) Method Not Allowed.
The remote server returned an error: (405) Method Not Allowed.
If the service is defined in the current solution, try building the solution and adding the service reference again.



问题:如何调试此问题?

谢谢。


Question: How can I debug this?
Thanks.

推荐答案

问题解决了 - 请参阅如何将xml文件转换并解析为数据集 [ ^ ]
Problem solved - see How to convert and parse an xml file to Dataset[^]


这篇关于URL上的文档未被识别为已知文档类型。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆