Click here to Skip to main content
15,886,693 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
XML
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.
Posted
Comments
Bernhard Hiller 9-Sep-13 5:50am    
Try with simple functions first: e.g. a function which only returns an int instead of a complex object.

1 solution

 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900