2011-04-15 78 views

回答

0

您可以使用WSDL模式,并且还设置位置,在构造函数中都使用“location”选项,并通过使用__setLocation()函数。你也可以做一个包装类为SoapClient的做更复杂的事情就像拉着所有端点出来的WSDL,然后运用逻辑来他们确定使用哪个端点什么:

class SoapClientCompatibility extends SoapClient{ 

    public function __construct($wsdl, $options){ 
     parent::__construct($wsdl, $options); 

     //determine which location you want to use here 

     parent::__setLocation($chosenLocation); 
    } 

    public function __doRequest($request, $location, $action, $version){ 
     // --Or, perhaps you want to dynamically switch location in here 
    } 
}