ChartBlocks / php-ssrs

PHP library for connecting to SSRS over SOAP
MIT License
25 stars 22 forks source link

ListChildren is not a valid method #11

Closed afvalzak closed 9 years ago

afvalzak commented 9 years ago

I try to get all the reports using the following code:

$ssrs = new \SSRS\Report("http://10.10.2.106/reportserver", $options); $result = $ssrs->ListChildren("/", true);

But I get the following error:

Fatal error: Uncaught SoapFault exception: [Client] Function ("ListChildren") is not a valid method for this service in D:\IIS_sites\SSRS_tester\vendor\chartblocks\php-ssrs\library\SSRS\Report.php:207 Stack trace: #0 D:\IIS_sites\SSRS_tester\vendor\chartblocks\php-ssrs\library\SSRS\Report.php(207): SoapClient->__call('ListChildren', Array) #1 D:\IIS_sites\SSRS_tester\vendor\chartblocks\php-ssrs\library\SSRS\Report.php(207): SSRS\Soap\NTLM->ListChildren(Array) #2 D:\IIS_sites\SSRS_tester\index.php(18): SSRS\Report->listChildren('/', true) #3 {main} thrown in D:\IIS_sites\SSRS_tester\vendor\chartblocks\php-ssrs\library\SSRS\Report.php on line 207

What's causing this problem?

afvalzak commented 9 years ago

I'm not sure what happened, but listChildren works now, but calling LoadReport gives the same error. Code is now like this:

$result = $ssrs -> listChildren("/test", false);
printr($result);

$report = $ssrs -> loadReport('/test/Report1');
printr($report);

This returns:

SSRS\Object\CatalogItems Object
(
    [iteratorKey] => CatalogItems
    [data] => Array
        (
            [CatalogItems] => Array
                (
                    [0] => SSRS\Object\CatalogItem Object
                        (
                            [data] => Array
                                (
                                    [ID] => af66da95-005f-4094-9d22-d232e1201cb9
                                    [Name] => rapport
                                    [Path] => /test/rapport
                                    [TypeName] => Report
                                    [Size] => 4153
                                    [CreationDate] => 2015-03-24T15:18:36.27
                                    [ModifiedDate] => 2015-03-24T15:18:36.27
                                    [CreatedBy] => W2K12DMZDB\Administrator
                                    [ModifiedBy] => W2K12DMZDB\Administrator
                                    [ItemMetadata] => stdClass Object
                                        (
                                        )

                                )

                        )

                    [1] => SSRS\Object\CatalogItem Object
                        (
                            [data] => Array
                                (
                                    [ID] => 20b67064-83fa-4b4d-9ac0-fb9d245abb87
                                    [Name] => Report1
                                    [Path] => /test/Report1
                                    [TypeName] => Report
                                    [Size] => 8302
                                    [CreationDate] => 2015-03-24T16:22:59.413
                                    [ModifiedDate] => 2015-03-24T16:26:30.77
                                    [CreatedBy] => W2K12DMZDB\Administrator
                                    [ModifiedBy] => W2K12DMZDB\Administrator
                                    [ItemMetadata] => stdClass Object
                                        (
                                        )

                                )

                        )

                )

        )

)
Fatal error: Uncaught SoapFault exception: [Client] Function ("LoadReport") is not a valid method for this service in D:\IIS_sites\SSRS_tester\vendor\chartblocks\php-ssrs\library\SSRS\Report.php:267 Stack trace: #0 D:\IIS_sites\SSRS_tester\vendor\chartblocks\php-ssrs\library\SSRS\Report.php(267): SoapClient->__call('LoadReport', Array) #1 D:\IIS_sites\SSRS_tester\vendor\chartblocks\php-ssrs\library\SSRS\Report.php(267): SSRS\Soap\NTLM->LoadReport(Array) #2 D:\IIS_sites\SSRS_tester\index.php(13): SSRS\Report->loadReport('/test/Report1') #3 {main} thrown in D:\IIS_sites\SSRS_tester\vendor\chartblocks\php-ssrs\library\SSRS\Report.php on line 267
afvalzak commented 9 years ago

Ok, This problem is fixed. The cause was that I set the wsdl path in the index.php. This caused both of the wsdl files (execution and service) to write to the same file. I just removed this parameter, changed the default wsdl cache path to somewhere I did have write permissions and the problem is solved.