Friday, March 11, 2011

Integrate Java with Microsoft SQL Server Reporting Services 2005/2008

The best way to accomplish this is through the use of the ReportExecution2005 web service that is provided out of the box by Microsoft SQL Server Reporting Services.

  1. Start Eclipse and create a new workspace named ssrsClient

  2. Create a new Java project called ssrsClient

  3. Configure the advanced Axis settings so that "Generate code for all elements, even unreferenced ones" is checked, and so that "Timeout in seconds" is set to -1. (See my previous post, Configure Advanced Axis Settings from Eclipse, for more details)

  4. Create a web service client proxy for the ReportExecution2005 web service; the URL for the WSDL definition will be http://<HOST>/reportserver/ReportExecution2005.asmx?wsdl. (See my previous post, Consume Any Web Service Using Eclipse + Axis, for more details)

  5. Enable NTLM Authentication in Axis by adding the Jakarta Commons HTTPClient and Codec JAR files to the classpath. (See my previous post, Enable NTLM Authentication in Axis, for more details)

  6. Create a new Java Class named Test.java

  7. Copy and paste the following code into Test.java (overwrite the existing code)
    import com.microsoft.schemas.sqlserver._2005._06._30.reporting.reportingservices.*;
    import com.microsoft.schemas.sqlserver._2005._06._30.reporting.reportingservices.holders.*;
    import java.net.URL;
    import javax.xml.rpc.holders.ByteArrayHolder;
    import javax.xml.rpc.holders.StringHolder;
    import javax.xml.soap.SOAPException;
    import org.apache.axis.message.SOAPHeaderElement;
    
    public class Test
    {
     public static void main(String[] arg)
     {
      ReportExecutionServiceSoapStub service = getService();
      ParameterValue[] parameters = new ParameterValue[1];
      parameters[0] = new ParameterValue();
      parameters[0].setName("<PARAMETER_1_NAME>");
      parameters[0].setValue("<PARAMETER_1_VALUE>");
      
      try
      {
       ExecutionInfo info = service.loadReport("/<FOLDER_NAME>/<REPORT_NAME>", null); //Load report
       setExecutionId(service, info.getExecutionID()); //You must set the session id before continuing
       service.setExecutionParameters(parameters, "en-us"); //Set report parameters
       
       String format = "HTML4.0"; //Valid options are HTML4.0, MHTML, EXCEL, CSV, PDF, etc
       String deviceInfo = "<DeviceInfo><Toolbar>False</Toolbar><HTMLFragment>True</HTMLFragment></DeviceInfo>"; //Only generate an HTML fragment
       ByteArrayHolder result = new ByteArrayHolder();
       StringHolder extension = new StringHolder();
       StringHolder mimeType = new StringHolder();
       StringHolder encoding = new StringHolder();
       ArrayOfWarningHolder warnings = new ArrayOfWarningHolder();
       ArrayOfStringHolder streamIDs = new ArrayOfStringHolder();   
       service.render(format, deviceInfo, result, extension, mimeType, encoding, warnings, streamIDs); //Render report to HTML
       
       System.out.println(new String(result.value)); //Prints the report HTML; this could be embedded in a JSP
      }
      catch (Exception e)
      {
       e.printStackTrace();
      }
      
     }
     
     public static void setExecutionId(ReportExecutionServiceSoapStub service, String id) throws SOAPException
     {
      SOAPHeaderElement sessionHeader = new SOAPHeaderElement("http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", "ExecutionHeader");
      sessionHeader.addChildElement("ExecutionID").addTextNode(id);
      service.setHeader(sessionHeader);
     }
     
     public static ReportExecutionServiceSoapStub getService()
     {
      try
      {
       String endpoint = "http://<HOST>/reportserver/ReportExecution2005.asmx";   
       ReportExecutionServiceSoapStub service = (ReportExecutionServiceSoapStub)new ReportExecutionServiceLocator(getEngineConfiguration()).getReportExecutionServiceSoap(new URL(endpoint));
       service.setUsername("<DOMAIN>\\<USER_NAME>");
       service.setPassword("<PASSWORD>");
       return service;
      }
      catch (Exception e)
      {
       e.printStackTrace();
      }
      
      return null;
     }
     
     public static org.apache.axis.EngineConfiguration getEngineConfiguration()
     {
      java.lang.StringBuffer sb = new java.lang.StringBuffer();
      
      sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n");
      sb.append("<deployment name=\"defaultClientConfig\"\r\n");
      sb.append("xmlns=\"http://xml.apache.org/axis/wsdd/\"\r\n");
      sb.append("xmlns:java=\"http://xml.apache.org/axis/wsdd/providers/java\">\r\n");
      sb.append("<globalConfiguration>\r\n");
      sb.append("<parameter name=\"disablePrettyXML\" value=\"true\"/>\r\n");
      sb.append("<parameter name=\"enableNamespacePrefixOptimization\" value=\"true\"/>\r\n");
      sb.append("</globalConfiguration>\r\n");
      sb.append("<transport name=\"http\" pivot=\"java:org.apache.axis.transport.http.CommonsHTTPSender\"/>\r\n");
      sb.append("<transport name=\"local\" pivot=\"java:org.apache.axis.transport.local.LocalSender\"/>\r\n");
      sb.append("<transport name=\"java\" pivot=\"java:org.apache.axis.transport.java.JavaSender\"/>\r\n");
      sb.append("</deployment>\r\n");
      
      return new org.apache.axis.configuration.XMLStringProvider(sb.toString());
     }
    }
    

  8. Replace all the placeholders with actual values:
    Lines 13-17
    Replace the report parameter names/values with your own report parameter names/values. Increase the size of the array if you have more than one parameter.

    Line 21
    Replace the report path with the path to your own report. Do NOT include the .RDL extension in this path.

    Line 55
    Replace the report host with your own report host. This is the endpoint for the ReportExecution2005 web service.

    Lines 57-58
    Replace the domain, username, and password with your own. These are the Windows credentials that will be used to access the report.

  9. Execute the code. You should see the report HTML printed as output. If you face an authentication error (401) then verify NTLM is enabled and also try adding
    
    3
    
    
    
    
    in your rsreportserver.config under reportserver for basic authentication with SSRS (Thanks Sridhar Iyer).

    If you still receive an authentication error (401) then it may be that SSRS and/or Windows is using NTMLv2 (verified for Windows 7). See JB's comment near the bottom of this page and also visit the following link for more information: http://devsac.blogspot.com/2010/10/supoprt-for-ntlmv2-with-apache.html. (Thanks JB!)

  10. Package all the classes into a JAR file and copy it into the WEB-INF/lib folder of your web app. Use the same technique as above to embed the rendered report HTML in a JSP file.

  11. Build a nice user interface that accepts the appropriate report parameters and passes them through to the web service. Add an "Export" drop down list on the report page that allows users to export the report to different formats like Excel, PDF, CSV, etc. You do not have to completely reload the report every time you export it to a different format; once you initially obtain the Report Execution ID you can save it and re-use for rendering to other formats.

56 comments:

  1. Environment:
    AXIS 1.4
    SqlServer 2008 R2 on Windows Server 2008 R2
    Just to make sure that WebServices on SSRS were published and working ok, prior to Axis, I generated .NET Proxy using wsdl tool in .NET and use C# class that calls ReportingService.dll (that I have generated and compiled form wsdl), and everything worked fine.

    Mimicking the same process with Java/Axis/Eclipse, it doesn't work.
    I reused your class and got this error.
    Any idea about where am I making mistake, or something that I am missing?!?

    Thanks a lot.

    Darko


    - ntlm authentication scheme selected
    - Failure authenticating with NTLM @jlw-w2008r2-srs:8080
    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
    at org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.java:218)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at com.microsoft.schemas.sqlserver._2005._06._30.reporting.reportingservices.ReportExecutionServiceSoapStub.loadReport(ReportExecutionServiceSoapStub.java:865)
    at test.Test.main(Test.java:29)

    ReplyDelete
    Replies
    1. I got the same error, I was providing just [user name] at line 57, then I replaced the [user name] with [domain]\\[user name] and got rid of this error.

      Delete
    2. Thanks a lot for the detailed steps on invoking SSRS from Java.
      I too mimic the process mentioned here but I am getting 401 Unauthorized error after using the correct domain id and password at line 57.

      Delete
  2. hmmm... I just tested the same code using SQL Server 2008 and it executed fine without throwing any errors. I would guess that the problem is caused by the report authentication. If I type in an incorrect domain/username/password then I am able to reproduce your error. Did you perhaps forget to update lines 57-58 to use a valid Windows domain, username, & password? Also, does the username you are supplying truly have access to the report?

    You can check who has permission to the report by browsing to "http://REPORT SERVER HOST/reports" using Internet Explorer, find your report, click the drop-down arrow beside it, click "Manage", then finally click the Security tab. Try explicitly adding the user to this report by clicking "New Assignment Role" button then manually type in the user as "DOMAIN\USERNAME" format and select the "Browser" role. You also need to ensure that the user in question is able to log into SQL Server and access the database that is being queried.

    You can sometimes test this by right clicking on the windows shortcut (Internet Explorer or SQL Server Management Studio) and then click the "Run As..." option and supply the domain, username, and password of the user you are trying to verify. Then once you are impersonating that user you can try running the report or logging into SQL Server and executing a query. If you get any errors then that's a red flag and is most likely your problem.

    If none of this advice helps then I'm sorry, I'm not sure what the issue is. Feel free to send me a copy of your code to craigrs84@gmail.com and I will scan it for any obvious errors. Thanks.

    ReplyDelete
  3. Craig,
    Thank you very much for helping me with this issue. Unfortunately, I am still having the same issue, although I followed every step in your guide. It may be that it is just Network configuration issue, but before I start digging into that, I have attached few files in email that you have provided here. Could you please take a look for some obvious peculiar things that I might be doing wrong.

    Thanks again

    ReplyDelete
  4. Darkos,

    I looked at your code and I am at a loss. I did not see anything wrong, it should work. This is one of those confusing situations where there is no easy explanation. As you mentioned it may be related to your network configuration.

    I find it very strange though that you were able to get the code to run in C# but not in Java since it is more or less the same concept. Are you running the C# version with the same user id ("reporter") or it is automatically using your own Windows id? If not, try changing the C# code to also use the "reporter" user id and see if you get an authentication error.

    One more question, do you have both the commons-httpclient jar file and the commons-code jar file included in your Java project? I think the answer is yes, based on the stacktrace you included, but thought I'd double check to be safe.

    ReplyDelete
  5. *commons-codec (correction to above - not commons-code)

    ReplyDelete
  6. I asked guys from different department to set a user for me on their SSRS (different server, different SqlServer, different SSRS...) and IT WORKED LIKE A CHARM.
    Looks like my Development server is not configured well.
    Anyway, IT WORKS!
    And thank you very very much.

    Darko

    ReplyDelete
  7. And...I have sent to you in email c# code that I have used as a "proof of concept".

    Darko

    ReplyDelete
  8. Just find one, maybe crucial, difference:

    My example DID WORK against:
    Windows Server 2003 SP2/SqlServer 2008 R2

    My example DIN NOT work against:
    Windows Server 2008/SqlServer 2008 R2

    I have heard that Windows Server 2008 has, by default, very tighten security and since I got it with default security, that is why probably I had and still have an authentication problem from Axis.

    "...just me thinking out loud..."

    ReplyDelete
  9. Hi darkos/Craig

    I am facing the same problem. It dosent work with windows 7 SqlServer 2008 R2. Any solution??

    Sridhar

    ReplyDelete
  10. Hi, I need the Microsoft SQL Schema jars for this. Where do you get them?

    ReplyDelete
  11. never mind. I missed an instruction step

    ReplyDelete
  12. Sridhar/darkos:

    I do not know enough about Windows/SSRS security and how to configure it to solve your problem, but I was able to successfully execute the example using SQL Server 2008 R2 running on Windows Server 2008.

    So the problem does not appear to be directly related to SQL Server 2008 R2 or Windows Server 2008, or at least it is not impossible to get the example working with these versions.

    However, I have never tried executing the example on Windows 7, so I'm unsure if that is an issue or not.

    Unfortunately I had no involvement in installing or configuring SQL Server 2008 R2 or Windows Server 2008 so I have practically no knowledge regarding that subject.

    ReplyDelete
    Replies
    1. Hello I tried this But while creating the WebServiceClient I am getting an error as The service defination Selected is invalid. Can you please let me know whats the issue is

      Delete
  13. Sound like you are not using the correct URL for the WSDL file or something along those lines. Make sure you replace the placeholders with your own host where SQL Server Reporting Services is installed. If you are using SSL it could possibly be related to a SSL certificate error. I found another site that suggests downloading and importing the WSDL file into eclipse and validating it to see if there are any errors. I've never done this myself though, so I'm not sure exactly how to do this. Google it and see what it suggests.

    ReplyDelete
  14. Craig ,
    I have few doubts here
    1) How to create wsdl file
    2) i am getting compilation erros for above code
    could you plz tell me what jar files I have to use for below class

    import com.microsoft.schemas.sqlserver._2005._06._30.reporting.reportingservices.*;
    import com.microsoft.schemas.sqlserver._2005._06._30.reporting.reportingservices.holders.*;

    ReportExecutionServiceSoapStub

    ParameterValue

    ExecutionInfo
    ArrayOfWarningHolder warnings = new ArrayOfWarningHolder();
    ArrayOfStringHolder streamIDs = new ArrayOfStringHolder();

    ReplyDelete
  15. You do not need to create the WSDL file. You need to locate the already existing WSDL file that Microsoft SQL Server Reporting Services provides. It should be located on the same server that SQL Server Reporting Services was installed on. If you open your web browser you should be able to locate it using the following URL: http://HOST/reportserver/ReportExecution2005.asmx?wsdl ... Make sure you replace the HOST placeholder with the actual servername where SQL Server Reporting Services is installed. Once you correct this the compilation errors should go away.

    If you are not very familiar with consuming web services using Java and Axis then this is probably not the best place to start. Research more about the subject then try again later. Maybe try stepping through the example in this post: http://www.craigsprogramming.com/2011/03/tutorial-consume-any-web-service-using.html

    ReplyDelete
  16. Thank you very much craig for your replay .Now I got some idea on WSDl file and we are using SQL 2008 and that is not installed in my system it is there in another system so all SQL 2008 wsdl file will be same ?if yes can i get it in net.

    ReplyDelete
    Replies
    1. and I do not understand why we are using this method getEngineConfiguration?

      Delete
    2. SQL Server Reporting Services will not be installed on your machine, you need to figure out which server it is installed on and then get the WSDL file from there. Again, the URL for the WSDL file will be http://HOST/reportserver/ReportExecution2005.asmx?wsdl and you need to replace HOST with the name of the server where SQL Server Reporting Services is installed.

      Figure out what the name of the server is where SQL Server Reporting Services is installed then start over at step 1. Read through everything carefully, and follow the links when they are available; I didn't repeat everything in this post that I've already covered in other posts, which is the reason I've included links to the other posts. The information is all there but you may have to dig a little.

      To answer your last question, the getEngineConfiguration method is used to enable NTML authentication in Axis, which is required when using this method to connect to SQL Server Reporting Services. There are other ways to enable NTML authentication in Axis but this is the simplest way to demonstrate this within this blog post. Google "enable NTML authentication in Axis" and you will get quite a few hits explaining this in further detail.

      Delete
    3. Oh, and yes the WSDL file should be the same for both SQL Server 2008 and SQL Server 2005 - I don't think it matters. I think the URL for the WSDL file is also the same even if you are using SQL Server 2008.

      Delete
    4. Thank you very much for replay craig,and I have one more doubt here what is the purpose "parameters" and I am getting below error

      INFO: Failure authenticating with NTLM @dstwsisstest01:80
      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
      at org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.java:218)
      at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
      at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
      at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
      at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
      at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
      at org.apache.axis.client.Call.invoke(Call.java:2767)
      at org.apache.axis.client.Call.invoke(Call.java:2443)
      at org.apache.axis.client.Call.invoke(Call.java:2366)
      at org.apache.axis.client.Call.invoke(Call.java:1812)
      at com.microsoft.schemas.sqlserver._2005._06._30.reporting.reportingservices.ReportExecutionServiceSoapStub.loadReport(ReportExecutionServiceSoapStub.java:886)
      at Test.main(Test.java:30)

      Could plz help me out on this.

      Delete
    5. Craig Thank you very much for your replay .and here I have one more doubt what is the purpose of ParameterValue[] parameters = new ParameterValue[1];
      parameters[0] = new ParameterValue();
      parameters[0].setName(""); parameters[0].setValue(""); this code and '
      could you plz help me on this

      Delete
    6. Creag thank you for your replay and If my report does't have any parameters then can i pass null value setExecutionParameters()?

      Delete
  17. I can't remember and I don't have the code available to test it right now. You either pass null, or an empty array with size of 0, or maybe you just don't call the setExecutionParameters method at all. One of these techniques should work if you do not have any parameters, but I can't remember which is the correct technique.

    ReplyDelete
    Replies
    1. Hi Craig today I have tried to connect SSRS but I am getting error like Apr 4, 2012 4:45:21 PM org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
      INFO: ntlm authentication scheme selected
      Apr 4, 2012 4:45:21 PM org.apache.commons.httpclient.HttpMethodDirector processWWWAuthChallenge
      INFO: Failure authenticating with NTLM @:80
      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
      at org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.java:218)
      at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
      at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
      at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
      at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
      at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
      at org.apache.axis.client.Call.invoke(Call.java:2767)
      at org.apache.axis.client.Call.invoke(Call.java:2443)
      at org.apache.axis.client.Call.invoke(Call.java:2366)
      at org.apache.axis.client.Call.invoke(Call.java:1812)
      at com.microsoft.schemas.sqlserver._2005._06._30.reporting.reportingservices.ReportExecutionServiceSoapStub.loadReport(ReportExecutionServiceSoapStub.java:886)
      at Test.main(Test.java:27)
      I am getting this error while loading report

      ExecutionInfo info = service.loadReport("?ItemPath=%2fSAEC%2fClaim_Summary_Report_Rpt", null); //Load report
      and do we need to give "historyID" and from where can we get
      this ID ?

      I am able to see the report in web browser by giving below url

      http:///Reports/Pages/Report.aspx?ItemPath=%2fSAEC%2fClaim_Summary_Report_Rpt&SelectedTabId=ViewTab

      Please suggest me where I have done wrong?

      Delete
    2. Craig,I am getting error while loading a report NFO: Failure authenticating with NTLM @:80
      AxisFault
      faultCode: {http://xml.apache.org/axis/}HTTP
      faultSubcode:
      faultString: (401)Unauthorized
      faultActor:
      faultNode:
      faultDetail:
      {}:return code: 401

      Delete
  18. I am able to acess report through webbrowser by giving http:///Reports/Pages/Report.aspx?ItemPath=%2fSAEC%2fClaim_Summary_Report_Rpt

    and in my java code I have given folder namd report name like below
    ExecutionInfo info = service.loadReport("?ItemPath=SAEC/Claim_Summary_Report_Rpt", null);
    and what is "historyID"?
    Please help me out on this

    ReplyDelete
  19. You should not use "?ItemPath=" with the loadReport method. It should be just service.loadReport("/SAEC/Claim_Summary_Report_Rpt", null);

    If that doesn't fix it try changing the rsreportserver.config file as described in step #9. If that still doesn't help then I'm not sure what the problem is.

    ReplyDelete
    Replies
    1. ok,If we add that code will other pepole can access the (unauthoraized persons)reports?

      Delete
  20. Hey can we get csv data? If so please illustrate an example for getting csv data. I am in immediate need for this.

    ReplyDelete
  21. Yea, getting CSV should definitely be possible. You do the same thing as above except on line 25 you say format = "CSV" instead of HTML4.0. Also I don't think the same device info applies to CSV so on line 26 say deviceInfo = "<DeviceInfo/>" (it's either that or you just say deviceInfo = null, I can't remember which is correct). Let me know if that works for you. If not I'll dig a little deeper. Been awhile since I've actually used this code.

    ReplyDelete
  22. Hi Craig, Thanks for a great post! It's helped me out quite a bit. However noticing quite a few people getting the same issue I was having:

    NFO: Failure authenticating with NTLM @:80
    AxisFault
    faultCode: {http://xml.apache.org/axis/}HTTP
    faultSubcode: ....

    This was happening to me running SQLServer2008 under Windows7, and the solution I found actually has to do with the NTLMv2 protocol.
    Head here for the solution:
    http://devsac.blogspot.com/2010/10/supoprt-for-ntlmv2-with-apache.html

    Basically the problem is SSRS is trying to authenticate using NTLMv2 and your files in their current form don't allow for it, adding JCIFS and an extra line to your code and it works perfectly.

    Thanks for the good work!

    ReplyDelete
    Replies
    1. Thanks for your help JB, I added a section about this to the blog. Probably will help a lot of people, I've seen quite a few people have the same issue but didn't know what to tell them. Haven't ever tried this approach on Windows 7, only on Windows Server 2003 & 2008. Glad you figured this out.

      Delete
  23. I have my wsdl as "https://SERVER_NAME/reportserver/ReportService2005.asmx"

    I have created my web service client as suggested by you and it works fine for HTTP connection but it is not working for HTTPS. Please suggest. I am getting following error.


    faultString: javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

    ReplyDelete
    Replies
    1. HI Vaibhav Agarwal,

      Can u help me for consume SSRS using java please....

      Delete
  24. Hi Craig,
    These is nice tutorial.

    I'm getting error.I'm giving correct username and password.please help me..to solve this........

    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
    at org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.java:218)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at com.microsoft.schemas.sqlserver._2005._06._30.reporting.reportingservices.ReportExecutionServiceSoapStub.loadReport(ReportExecutionServiceSoapStub.java:886)
    at com.test.Test.main(Test.java:24)

    ReplyDelete
    Replies
    1. Hi Deepan,
      did you get the solution for this.
      Please share your thoughts.
      Thanks
      Neelesh

      Delete
  25. ExecutionInfo info = service.loadReport("/GIS_Report/sample", null); //Load report

    from here i'm getting this error

    ReplyDelete
  26. My server run in Windows server 2003.

    ReplyDelete
  27. Please some one help me for this.
    My mail id is deepandrancer@gmail.com

    Thanks Advance

    ReplyDelete
  28. Hello everyone, I appreciate all the community feedback and support. Unfortunately I'm no longer in a role where I actively work with SSRS, and the number of requests for help has become overwhelming. As a result I won't be able to provide any more guidance or help on this particular topic. You're on your own. Good luck.

    ReplyDelete
  29. Hello,

    I am really new to sql and java.
    Is is possible to do the same thing with sql server 2012 i.e. (Integrate Java with Microsoft SQL Server Reporting Services 2012)?
    Secondly, the report is a map report, would it work for a map report?
    I would appreciate your assistance.

    Regards

    ReplyDelete
  30. I'm not sure - I haven't worked with SQL Server 2012 yet and haven't worked with SSRS in over a year now. Also I've never worked with a map report. In theory SSRS 2012 should have some form of web services available, so I think the concept should still hold true even if the code is slightly different.

    ReplyDelete
  31. Thanks Craig,
    I really need help with this.

    ReplyDelete
  32. Craig,

    I wanted to know if the MS reporting services is better than the Dynamic Jasper in java? If yes, can you please let me know what are the advantages.

    ReplyDelete
  33. Hi,

    We are trying to integrate ssrs with java and we want to use url access and what is the best way to do it.

    thanks,
    sri123

    ReplyDelete
  34. Hi Craig,
    I want to download the report in PDF format, I had changed the required format and extension, but I am getting the ascii contains of PDF file on the browser instead of download.
    Please guide.
    Neelesh

    ReplyDelete
  35. Hi Craig,
    How to check the availability of result of particular input we are passing.for ex.If we try to fetch a row from sql server which need to be generated in excel format.The excel is getting generated even if the row fetched is empty how to prevent the generation of empty sheet

    ReplyDelete
  36. Hi, I had exactly the same problem (401, Unauthorized), I Implemented the class suggested by JB: http://devsac.blogspot.com/2010/10/supoprt-for-ntlmv2-with-apache.html
    Works like a charm!

    ReplyDelete
  37. Hello everyone, I have some reports with subsections that we can toggle/hide via a "+".I would like to know if there is a way to have this same behaviour in a java application that renders reports in HTML format.Thanks

    ReplyDelete
  38. Hello everyone,I had exactly the same problem (401, Unauthorized)

    ReplyDelete
  39. Thanks for sharing this post. Your post is really very helpful its students.
    SQL server dba Online Training Hyderabad

    ReplyDelete
  40. Hi I know this is an old post but I had the same error and the solution given by JB solved it. Thanks to both Craig and JB for this great post.

    ReplyDelete