Friday, February 24, 2012

Error while trying to use ReportServices 2005 WebService

I'm messing around with the SSRS 2005 WebService from a vb.net application. When calling the .ListChildren method I get the following error:

Client found response content type of '', but expected 'text/xml'. The request failed with an empty response.

Here is the code I'm using (I called the webreference ssrs)

dim rs as new ssrs.ReportingService2005()

rs.url = "http://127.0.0.1/reportserver"

rs.credentials = System.New.CredentialCache.DefaultCredentials

dim items() as ssrs.CatalogItem

items = rs.ListChildren ("/", True)

The error is coming from the Visual Studio generated proxy. The issue is that when you override the .Url property you must specify the entire URL of the Reporting Services endpoint.

Change your URL string to http://127.0.0.1/reportserver/reportservice2005.asmx and everything should work then.

All of the various designers that we ship automatically append the appropriate web service endpoint. Unfortunately we do not control the code that is generated by the proxy that VS creates. You must ensure that the URL points to the endpoint yourself if you choose to overwrite the default URL that is assigned when the proxy is generated.

|||

Check your credentials...you got a typo

rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

No comments:

Post a Comment