Php 计算webservice函数的函数参数

Php 计算webservice函数的函数参数,php,nusoap,Php,Nusoap,出于我无法控制的原因,我被迫使用NuSoap而不是SOAP向web服务发出请求 经过一些搜索,我在NuSoap中找到了SOAP的\uu getFunctions()等价物。我现在陷入困境的部分是找出Web服务函数所期望的参数的格式 require_once(APPPATH.'libraries/nusoap.php'); $baseurl = 'http://www.webservicex.net/geoipservice.asmx?WSDL'; $client = new nu

出于我无法控制的原因,我被迫使用
NuSoap
而不是
SOAP
向web服务发出请求

经过一些搜索,我在
NuSoap
中找到了
SOAP的
\uu getFunctions()
等价物。我现在陷入困境的部分是找出Web服务函数所期望的参数的格式

require_once(APPPATH.'libraries/nusoap.php');    
$baseurl = 'http://www.webservicex.net/geoipservice.asmx?WSDL';    
$client = new nusoap_client($baseurl, true);
$err = $client->getError();
if ($err) {
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
    die();
}
$proxy = $client->getProxyClassCode();
print_r($proxy);
现在我知道了函数名(GetGeoIP和GetGeoIPContext),我正在努力找出需要传递给这些函数的参数

我猜
$params=array('parameters'=>$parameters)
是我应该感兴趣的部分,但这并不能提供完整的信息。
简言之,在
NuSoap
中是否存在
SOAP的
\uu getTypes()
等价物?

$opdata=$proxy->getOperationData('GetGeoIP')getOperationData方法从nusoap_客户端继承。请参阅。

您可以使用SoapUI获取请求的示例

如果使用url端点(WSDL)创建一个新项目,则可以获得所有soapCalls。使用它可以更容易地理解WSDL中定义的类型

点击这个链接

$parameters是请求中每个参数的数组(键->值)


$parameters=array('IPAddress'=>'xxx.xxx.xxx.xxx')

我知道我可以通过WSDL找到参数。我所寻找的是一种动态发现的方法,即让nuSOAP找出它并让我知道。由于特殊原因,我被要求只使用nuSOAP。对不起,我的英语,但SoapUI只是一个工具软件,供您帮助。这不是图书馆。你可以用nuSOAP。
class nusoap_proxy_1027585735 extends nusoap_client 
{ 
    // http://www.webservicex.net/:GetGeoIP^ 
    $parameters function GetGeoIP($parameters) 
    { 
        $params = array('parameters' => $parameters); 
        return $this->call('GetGeoIP', $params, 'http://testuri.com', 'http://www.webservicex.net/GetGeoIP');  
    } 
    // http://www.webservicex.net/:GetGeoIPContext^ 
    $parameters function GetGeoIPContext($parameters) 
    { 
        $params = array('parameters' => $parameters); 
        return $this->call('GetGeoIPContext', $params, 'http://testuri.com', 'http://www.webservicex.net/GetGeoIPContext'); 
    } 
}