Nick Grattan’s SharePoint Blog

About Microsoft SharePoint and some .NET

DISCO Error creating SharePoint Web Service Reference

with 12 comments

In Visual Studio 2005 you’ll need to create a web reference before you can start programming SharePoint Web Services. You will typically use a URL like the following:

http://server:port/sites/intranet/projectx/_vti_bin/lists.asmx

However, when creating the web reference you may see the following an error reporting that the DISCO document is missing a root element:

AddRefErr

The entire error text is:

The document at the url http://moss2007:2500/sites/DevSite/ _vti_bin/lists.asmx 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 ‘Root element is missing.’.
- Report from ‘http://moss2007:2500/sites/DevSite/_vti_bin/lists.asmx’ is ‘The document format is not recognized (the content type is ‘text/html; charset=utf-8′).’.
- Report from ‘WSDL Document’ is ‘The document format is not recognized (the content type is ‘text/html; charset=utf-8′).’.
- Report from ‘XML Schema’ is ‘The document format is not recognized (the content type is ‘text/html; charset=utf-8′).’.

To circumvent this problem click “Service Description” in the browser view in the “Add Web Reference” dialog. This shows the WSDL for the web service and allows you to enter a Web reference name. This is equivalent to entering the following URL with the parameter “?WSDL”.

Written by Nick Grattan

July 27, 2007 at 11:24 am

12 Responses

Subscribe to comments with RSS.

  1. happens when url has spaces

    hotfix from MS
    http://support.microsoft.com/kb/890201

    f00

    September 12, 2007 at 7:30 pm

  2. Thanks, explains the problem. Nick

    nickgrattan

    September 12, 2007 at 9:18 pm

  3. FYI, you also get the exact same problem if the url for the webservice is wrong.

    For instance if http://moss2007:2500/sites/DevSite/_vti_bin/lists.asmx is the *actual* url for the web service but you try to reference http://moss2007:2500/DevSite/_vti_bin/lists.asmx (removed the folder sites) it will still generate the asmx page but it will not generate the disco or the wsdl. You would expect that if typed an worng url for a web service you get a 404 or something to that effect but with sharepoint it seems that this is not the case!

    shane dixon

    December 13, 2007 at 12:06 am

  4. Thanks for the additional information! Nick

    nickgrattan

    December 13, 2007 at 4:54 pm

  5. I am getting the same error even when all the above conditions are met. not sure if we are not able to add reference through wizard.

    any further suggestions, welcome.

    thanks in advance.
    -Manjunath.

    Manjunath

    April 1, 2008 at 1:51 pm

  6. Thank you, thank you, thank you!

    You would not believe how much this has helped me. I have been stuck on this for almost a week and couldn’t find any help anywhere.

    AHHHH!!! The Relief!!!

    Thanks again!

    Alistair

    July 21, 2008 at 4:45 pm

  7. Thanks it really helped me too…

    Rinkal

    July 25, 2008 at 2:15 pm

  8. The url should point the the Central Admin site and not to a site collection you created

    this solved it

    sema

    August 5, 2008 at 4:54 pm

  9. Hi Folks,
    This error is the simple case of sharepoint is not able to map the content.

    To solve this issue please have the root Site (/) collection in your Web Site.
    that’s all.

    Hope this solves the problem.

    Samar

    October 10, 2008 at 4:01 am

  10. Hi…..

    i have tried this but it doesn’t work for me….
    http://serverName:port/sitecollectionName/_vti_bin/list.asmx

    it gives an error …..
    The document at the url http://serverName:port/sitecollectionName/_vti_bin/list.asmx 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 ‘Root element is missing.’.
    - Report from ‘WSDL Document’ is ‘The document format

    Saurabh

    November 14, 2008 at 12:15 pm

  11. This has something to do with authentication. SP needs to authenticate with the client.

    abmaheco

    June 28, 2009 at 2:55 pm

  12. This helped us a lot, we were stuck with this issue for almost 2 days and we had a delivery also which would have got impacted because of this.

    Manju

    July 28, 2009 at 8:49 am


Leave a Reply