Answered by:
Integrating Reporting Services with Java Applications

Question
-
Hello SSRS Experts,
I have followed the steps in one of the lab manual to integrate SSRS with Java applications.
1. Copied the ReportService2005.asmx?wsdl into my local machine
2. Crated the java proxy using Apache Axis (via eclipse IDE)
3. created an simple servlet client to invoke SSRS webservice via newly created java proxy.
below please find the codeReportingService2005Locator loc = new ReportingService2005Locator(); ReportingService2005Soap port = loc.getReportingService2005Soap(new java.net.URL("https://localhost/ReportServer")); org.apache.axis.client.Stub stub = (org.apache.axis.client.Stub) port; stub.setUsername(username); stub.setPassword(password); CatalogItem[] catalogItems = port.listChildren("/", true); for (CatalogItem catalogItem : catalogItems) { out.println(catalogItem.getPath()); }
When i execute this code i got the SOAP fault 401 unaothorized exception;
AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (401)Unauthorized
faultActor:
faultNode:
faultDetail:
{}:return code: 401
{http://xml.apache.org/axis/}HttpErrorCode:401
(401)Unauthorized
am i missing anything. I dont find any help on this in net.
Advise...............Sunday, May 3, 2009 1:58 PM
Answers
-
When you say that you have "followed the steps in one of the lab manual...", to which book, course or other publication are you referring?
Although you should be able to consume the web service from any capable programming tool or language, another option is to use a URL request rather than an API call to the web service. Build the appropriate URL with parameter values and ReportViewer or Report Server commands (rc:... & rs:...) and then set this string as the source of a frame or page to view the report.
Paul Turley [Hitachi Consulting] SQLServerBIBlog.com- Marked as answer by Jinchun ChenMicrosoft employee Friday, May 15, 2009 8:09 AM
Monday, May 4, 2009 5:20 AM -
Hi Vinayagam,
You need to configure permissions in Internet Information Services to allow access to the Report Server Web service as mentioned in Exercise 3 and step4 in the Lab Manual.
Thanks,
Jin
Jin Chen - MSFT- Marked as answer by Jinchun ChenMicrosoft employee Friday, May 15, 2009 8:09 AM
Tuesday, May 5, 2009 1:23 AM
All replies
-
When you say that you have "followed the steps in one of the lab manual...", to which book, course or other publication are you referring?
Although you should be able to consume the web service from any capable programming tool or language, another option is to use a URL request rather than an API call to the web service. Build the appropriate URL with parameter values and ReportViewer or Report Server commands (rc:... & rs:...) and then set this string as the source of a frame or page to view the report.
Paul Turley [Hitachi Consulting] SQLServerBIBlog.com- Marked as answer by Jinchun ChenMicrosoft employee Friday, May 15, 2009 8:09 AM
Monday, May 4, 2009 5:20 AM -
Paul,
Thanks a lot for your response.
I followed the instructions from MSDN lab.
http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032315323&EventCategory=3&culture=en-US&CountryCode=US
I am able to access the reports directly from IE. But when i tried to access the reports from Java application (i.e Servlet) using SSRS webservices i got the 401 error. I have tried Apache Axis as wells as Jax-WS too, could not succeed...
Thanks & Regards,
ViniMonday, May 4, 2009 4:38 PM -
You would also have to specify a domain name or a computer name with the username and password.Monday, May 4, 2009 6:13 PM
-
I have passed the user name, password and the domain too.Monday, May 4, 2009 7:53 PM
-
Hi Vinayagam,
You need to configure permissions in Internet Information Services to allow access to the Report Server Web service as mentioned in Exercise 3 and step4 in the Lab Manual.
Thanks,
Jin
Jin Chen - MSFT- Marked as answer by Jinchun ChenMicrosoft employee Friday, May 15, 2009 8:09 AM
Tuesday, May 5, 2009 1:23 AM -
The credentials that i passed thru the webservices, owns the local system admin credentials in the RS server.
Regards
VinayagamFriday, May 15, 2009 9:40 PM -
I came across same issue. If you are using sql server 2008, the security configuration in exercise step 3 and 4 does not apply. The access confuguration can not be performed through IIS as mentioned in one of the answers.
not sure what the solution is.Tuesday, September 22, 2009 7:56 PM -
I am trying to accomplish exactly what your question was about. I noticed you placed a link to the lab. I tried signing up for the lab through the link but it appears that it is no longer available. Would you happen to have the lab manual (electronic version) you could share? Basically i want to know how i can integrate a java application with Reporting Services through web services.Tuesday, January 26, 2010 12:44 AM
-
I am at this point. I need to authenticate to SSRS 2008 from a Java program. And I realize that there is no IIS on the server. When I instantiate the get method, I either get a 401 status code or a 200 status code with a blank screen - ie no report shows, but there is no other error.
Have you been able to solve this problem?
Thanks for any help you can give...
Thursday, April 29, 2010 7:30 PM -
Hi All,
I face same problem when trying to access SSRS web services from a Java client. I have generated Java Client Proxy using eclipse IDE. When i try using any of the SSRS web services from the generated Java proxy, I get 401-unauthorized exception. I face the problem even when the server is on local host. I modified the ReportServer virtual directory properties to accept anonymus access. Here is my code:
try
{
sample = new URL("http://hyi3w272/ReportServer/ReportService2005.asmx?WSDL");
port = loc.getReportingService2005Soap(sample);
org.apache.axis.client.Stub stub = (org.apache.axis.client.Stub) port;
stub.setUsername( "<domain\\<userid" );
stub.setPassword( "<password>" );
}
catch( MalformedURLException e2 )
{}
catch( ServiceException e )
{}
ByteArrayHolder test = new ByteArrayHolder();
StringHolder testStr = new StringHolder();
try
{
CatalogItem [] allChildren = port.listChildren( "Jmk", false );
System.out.println(allChildren);
}
catch( RemoteException e1)
{
System.out.println(e1);
}Please Help me in this regard
Thanks,
Swetha
Wednesday, May 26, 2010 8:52 AM -
Hi,
How to do this modification?
thx to share
Monday, July 26, 2010 12:43 PM -
Hi All,
Did you find out what the solution is for this issue? Could you share please?
Thanks,
Luiz.
Thursday, July 29, 2010 7:08 PM