09 January 2008

HELP! I can’t consume my SharePoint web services!


OK, so you're developing an application the leverages SharePoint's web services.
You try adding the web reference to your project, but you are presented with the following error message instead:

The document at the url http://moss/_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://moss/_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').'.
The odds are that your MOSS server does not have a site collection created at the default port 80 but instead rather on some different port, usually randomly assigned.
So then you would need to add that particular port number to the URL for the web service.
So in our example, you probably would end up with something like this:

http://moss:1234/_vti_bin/lists.asmx
That should do it.

Later
C

No comments:

Post a Comment

Comments are moderated only for the purpose of keeping pesky spammers at bay.

SharePoint Remote Event Receivers are DEAD!!!

 Well, the time has finally come.  It was evident when Microsoft started pushing everyone to WebHooks, but this FAQ and related announcement...