Nick Grattan's Blog

About Microsoft SharePoint, .NET, Natural Language Processing and Machine Learning

DISCO Error creating SharePoint Web Service Reference

with 27 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”.

Advertisements

Written by Nick Grattan

July 27, 2007 at 11:24 am

27 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

    • Thank you for this information. IT helped me a log

      Shanta

      March 4, 2010 at 8:55 am

  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

    • This is the correct solution if using Project Server 2007. Good work Samar 🙂

      Asad Abbas

      May 19, 2011 at 7:45 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

  13. La solución es mas sencilla de lo que creen. No es necesario instalar ninguna actualización.

    caca

    December 20, 2009 at 6:57 am

    • Ahá que útil tu info.

      Lo del post de abajo me sirvió

      harro87

      July 29, 2010 at 5:40 pm

  14. I know that is later for the response but I think it valid(sorry my English). Try changing the url for this one:

    http://server:port/sites/intranet/projectx/_vti_bin/listswsdl.aspx

    look that you will be referencing to listwsdl.aspx file. This one contain the web services too. I solved the problem using it.

    Daniel

    March 17, 2010 at 3:32 am

    • Hi, Daniel, Thanks
      Its working for me. I am creating the webpart for search. I ws facing error since 4 days. thanks again.

      Lalit

      June 18, 2010 at 1:09 pm

    • I made use of this info. Thanks 🙂

      Sreenivasan

      July 14, 2011 at 7:35 am

    • Thank you very much for this, Daniel. It’s the only solution that I’ve tried that works with SharePoint 2013 and Visual Studio 2013. But you need to use the “Add Service Reference -> Advanced -> Add Web Reference” method. Other methods of adding the service reference don’t seem for me.

      BogosiN

      August 3, 2015 at 9:56 am

      • Well seems like now it works adding it directly to the Service Reference section without having to go into “Web References”. Beats me how…..

        BogosiN

        August 3, 2015 at 10:09 am

  15. Thanks Nick !! It works for me !! Saved a hell lot of time 🙂

    Rachna

    January 17, 2011 at 7:17 am

  16. sema

    You’ve saved my life…tnx man

    Vitor

    June 9, 2011 at 2:10 am

  17. […] Thanks and credits go to Nick Grattan, who bloged about this error on SP2007 […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: