Java应用程序中的SSRS Web服务

时间:2014-02-07 12:13:34

标签: java web-services authentication reporting-services

我是SSRS网络服务的新手。

我在wsdl2java的帮助下使用wsdl获取了存根。并将它打包到jar文件到我的java项目中。

我的兴趣是使用Web服务获取报表服务器中的文件夹列表。类似于报告列表。并为用户呈现报告。

据我所知,我可以使用方法ReportService2005.listchildren()(来自MSN网站的C#代码)使用SSRS Web服务从报告中获取文件夹列表。

我可以通过网址访问或网络服务显示报告。

我真的不应该这样实现。我真的寻求帮助任何链接poiting to tutorial或任何其他。

我准备好探索和学习而不是示例代码。但是任何示例代码都会加快我的学习过程。

Kinldy对建议和输入的评论

1 个答案:

答案 0 :(得分:0)

以下是解决方案:

  1. 不使用wsdl2java,而是使用 wsimport 工具导入wsdl,该工具在JDK中从v1.6开始提供:

    wsimport.exe http://<yourserver>/reportserver/reportService2005.asmx?wsdl -s <path to save package> -extension
    
  2. 将生成的包复制到java项目中。 Amon其他的东西,它将包含ReportingService2005和ReportingService2005Soap类,这正是您所需要的。

  3. 使用以下代码对其进行测试:

    package testSSRS;
    
    import com.microsoft.schemas.sqlserver._2005._06._30.reporting.reportingservices.ArrayOfCatalogItem;
    import com.microsoft.schemas.sqlserver._2005._06._30.reporting.reportingservices.CatalogItem;
    import com.microsoft.schemas.sqlserver._2005._06._30.reporting.reportingservices.ReportingService2005;
    import com.microsoft.schemas.sqlserver._2005._06._30.reporting.reportingservices.ReportingService2005Soap;
    
    public class mainClass {
    
        public static void main(String[] args) {
    
            ReportingService2005 srv = new ReportingService2005();
            ReportingService2005Soap srvs = srv.getReportingService2005Soap();
    
            ArrayOfCatalogItem arr = srvs.listChildren("/", true);
    
            for (CatalogItem ci : arr.getCatalogItem())
            {
                System.out.println(ci.getPath() + "/" + ci.getName());
            }
        }
    
    }
    
  4. 希望它有所帮助。

    祝你好运, 阿列克谢