Create Service Reference Error - "not recognized as a known document type"


  • Hi

    I'm trying to create a service reference in Visual Studio 2010 but am getting the below error. Does any one have any suggestions as to how to solve it?

    The URL is

    VS asks for username and password both of which I provide, these are correct because when used in a browser I get authenticated and can see the feed data.

    Thank you


    The document at the url 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 ''.'.
    - Report from 'DISCO Document' is 'Discovery document at the URL could not be found.'.
      - The document format is not recognized (the content type is 'application/atom+xml').
    - Report from 'WSDL Document' is 'There is an error in XML document (2, 2).'.
      - <feed xmlns=''> was not expected.
    Metadata contains a reference that cannot be resolved: ''.
    The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic Realm=""'.
    The remote server returned an error: (401) Unauthorized.
    If the service is defined in the current solution, try building the solution and adding the service reference again.

    Saturday, May 07, 2011 11:44 AM


All replies

  • try to use the command line:

    svcutil.exe "http://address here..."

    do this from the VS command line.
    WCF Security, Interoperability And Performance Blog
    Saturday, May 07, 2011 4:06 PM
  • Hi

    Thanks for the reply. I have tried that but cannot work out how to pass a username and password to svcutil. Is there an option for that?

    Saturday, May 07, 2011 4:30 PM
  • in this case open the wsdl in IE and save it to the local disk. then svcutil from there.
    WCF Security, Interoperability And Performance Blog
    Saturday, May 07, 2011 6:58 PM
  • Ok, I've downloaded the wsdl...

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <service xml:base="" xmlns:atom="" xmlns:app="" xmlns="">
        <collection href="BritishEmbassiesAndHighCommissions">
        <collection href="DetailedFcoTravelAdvice">
        <collection href="LatestTravelNewsFromFco">


    And then run...


    "%windir%\Microsoft.NET\Framework\v3.5\DataSvcUtil.exe" /dataservicecollection /version:2.0 /language:CSharp /out:TravelAdvisorService.cs /uri:c:/TravelAdvisoryService-

    but am getting...

    error 7001: Expected an absolute, well formed http URL without a query or fragme
    Parameter name: serviceRoot

    Generation Complete -- 1 errors, 0 warnings


    Whats wrong?


    Sunday, May 08, 2011 12:41 PM
  • you are not using a wsdl / wcf. you are using odata / wcf data services.

    ask in the odata forum:
    WCF Security, Interoperability And Performance Blog
    • Marked as answer by Yi-Lun Luo Friday, May 13, 2011 9:15 AM
    Sunday, May 08, 2011 6:37 PM
  • Gee thanks.  So this is a dead end for those of us who come here later asking the same question.  


    I'm trying to figure out how to use RIA Services through WCF so that I can have a WPF application use the same service as a Silverlight application.  I'm really frustrated--

    Nah, forget it.  You philistines are just going to make me start a new thread.  So that's what I'm going to do.   And I'm not going to give this thread the link to that thread's answer, because you guys suck!

    Mostly kidding. :p

    Tuesday, July 12, 2011 3:21 PM