php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #52219 More useful return values for SoapClient::__getFunctions() / __getTypes()
Submitted: 2010-07-01 12:29 UTC Modified: -
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: php_bugs at m-h-it dot de Assigned:
Status: Open Package: SOAP related
PHP Version: 5.2.13 OS: irrelevant
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-07-01 12:29 UTC] php_bugs at m-h-it dot de
Description:
------------
SoapClient::__getFunctions() / SoapClient::__getTypes() now return both an array 
of strings. Each string contains a function signature or a structure description 
respectively. So it's hard to really use this information programmatically. You 
have to parse the strings into something useful first. 

It would be more useful to get a nested array with all information from the 
WSDL. For example __getFunctions() now delivers this:

array (
  0 => 'LoginCustomerResponse loginCustomer(LoginCustomer $loginCustomer)',
  1 => 'FindCustomerResponse findCustomer(FindCustomer $findCustomer)',
  ...
)

it's easier to use this:

array (
  array(
    'name'=>'loginCustomer',
    'returnType'=>'LoginCustomerResponse',
    'arguments'=>array(
      array('name'=>'loginCustomer'),
      array('type'=>'LoginCustomer')
    )
  ),
  array(
    'name'=>'findCustomer',
    'returnType'=>'FindCustomerResponse',
    'arguments'=>array(
      array('name'=>'findCustomer'),
      array('type'=>'FindCustomerResponse')
    )
  ),
...
)

To keep BC i suggest to use default argument:

SoapClient::__getFunctions($asStrings=true) 
SoapClient::__getTypes($asStrings=true)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-01 12:31 UTC] php_bugs at m-h-it dot de
I'm sorry, i have typo in my suggestion. It should be:

array (
  array(
    'name'=>'loginCustomer',
    'returnType'=>'LoginCustomerResponse',
    'arguments'=>array(
      array('name'=>'loginCustomer','type'=>'LoginCustomer')
    )
  ),
  array(
    'name'=>'findCustomer',
    'returnType'=>'FindCustomerResponse',
    'arguments'=>array(
      array('name'=>'findCustomer','type'=>'FindCustomerResponse'),
    )
  ),
...
)
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Jan 26 00:01:25 2020 UTC