PHP+;WSDL+;SOAP-如何在屏幕上显示webservice结果

PHP+;WSDL+;SOAP-如何在屏幕上显示webservice结果,php,web-services,soap,Php,Web Services,Soap,我刚刚开始学习PHP,希望得到一些关于如何在数组中显示webservice结果的建议 例如,我想将货币代码从以下WSDL打印到一个数组中 $wsdl="http://www.webservicex.com/CurrencyConvertor.asmx?WSDL 到目前为止,我已经做到了这一点,但实际上什么都没有发生: $proxyhost="proxy.cpit.ac.nz"; $proxyport = 8080; $wsdl="http://www.webservicex.com/

我刚刚开始学习PHP,希望得到一些关于如何在数组中显示webservice结果的建议

例如,我想将货币代码从以下WSDL打印到一个数组中

$wsdl="http://www.webservicex.com/CurrencyConvertor.asmx?WSDL
到目前为止,我已经做到了这一点,但实际上什么都没有发生:

$proxyhost="proxy.cpit.ac.nz";  
$proxyport = 8080;  

$wsdl="http://www.webservicex.com/CurrencyConvertor.asmx?WSDL";

$client = new SoapClient($wsdl,
  array('proxy_host' => "$proxyhost",'proxy_port' => 8080, 'trace' => 1));

$country=array();
$result = $client->ConversionRate($country);
print_r($result);

基本上,它是您的$country变量

如果您查看ConversionRate Web服务,它根据需要定义FromCurrency和ToCurrency

  <s:element name="ConversionRate"> 
    <s:complexType> 
      <s:sequence> 
        <s:element minOccurs="1" maxOccurs="1" name="FromCurrency" type="tns:Currency" /> 
        <s:element minOccurs="1" maxOccurs="1" name="ToCurrency" type="tns:Currency" /> 
      </s:sequence> 
    </s:complexType> 
  </s:element> 
这应该行得通

$country = array( "FromCurrency" => "AFA",
                  "ToCurrency" => "AUD");