Wednesday, March 28, 2012

reporting services 2005 proxy

I am trying to create a RS proxy to use in my web site. I did this successfully with RS2000. I used web matrix to generate the proxy and put the dll and .cs file in the bin directory of the web site, then I just used <%@. import namspace="rsProxy" %>. It worked like a charm. Now I am trying to get the 2005 version working and created the dll's but all I get in my web page is that it couldn't find the namespace.

I also tried adding a web reference through VS 2005. I don't use projects in my web site so in the VS 2005 method it created a folder under my web site called App_WebReferences. In that folder was another named after my server (reference name defaulted it to, say myServerName). Within that folder there are two files: reportservice2005.discomap and reportservice2005.wsdl. I then tried thier examples to create an instance of ReportingService2005 on the page_load event:

reportservice2005.myServerName.reportservice2005 rs = new reportservice2005.myServerName.reportservice2005();

rs.Url = "http://myservername.reportserver/reportservice2005.asmx?wsdl";

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

I get the follwiong error:

CS0246: The type or namespace name 'reportservice2005' could not be found (are you missing a using directive or an assembly reference?)

I tried to import the namespace as I did in 2000 with the same error.

I am trying to read the listchildren and populate a treeview. Any suggestions?

Not sure how VS 2005 is different in this respect, but in any case you could use wsdl.exe to extract a *.cs file from a SOAP endpoint. Then you can just include that file in your project.|||

I can get the dll and .cs file to generate. Again, I am not using projects in my web site. Even when I created the web reference in VS it showed all the methods available in the reportingservice2005 and reportexecution2005. I generated it and have tried to implement it using multiple methods but none work. Is there something on the report server or IIS that needs to be setup in order to make a web service available for consumption? I was thinking that maybe during the installation or configuration I missed something. Anyway, I followed the exact same process I used with RS 2000 and it doesn't work.

By the way, thanks for the reply. I'll keep plugging away at it.

|||

ok, I got it this far. I can get the auto-list members to display in VS 2005. Here is my code:

WindowsImpersonationContext impersonationContext;

WindowsIdentity currentWindowsIdentity;

currentWindowsIdentity = WindowsIdentity.GetCurrent();

impersonationContext = currentWindowsIdentity.Impersonate();

rsWebReference.ReportingService2005 rs = new rsWebReference.ReportingService2005();

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

rsWebReference.CatalogItem[] items = rs.ListChildren("/", true);

foreach (rsWebReference.CatalogItem ci in items)

{

if (ci.Type.ToString() == "Folder" && ci.Hidden == false)

{

Response.Write(ci.Name);

Response.Write(ci.Path);

}

}

impersonationContext.Undo();

Even though the list members are working, it still gives me the same error:

The type or namespace name 'rsWebReference' could not be found (are you missing a using directive or an assembly reference?)

|||The problem was the web site is using the 1.1 framework. When I changed it to use 2.0 it worked.

No comments:

Post a Comment