0

我正在尝试将我的页面连接到网络服务肥皂。我的主机不支持soap,所以无法识别SoapClient。我有一个工作示例可以连接到该 ws,但使用的是 SoapClient。这是:

$params = array('location'=>"www.wssite.com/test.php",
                            'trace'=>1,
                            'exceptions'=>1);
$client = new SoapClient("url_of_wsdl",$params);
var_dump($client->__getFunctions());
var_dump($client->__getTypes());

$pars = array('ipcInvocationName' => 'wsinvokeservice',
          'ipcMethodNamespace' => 'svcmsgxml.bldximsgin',
          'ttIn' => array(
          'ttInRow' => array( array('ParPos' => '0','ParNam' => 'MethodName',
              'ParVal' => POST),
           array('ParPos' => '1','ParNam' => 'XMLDocumentIn',
              'ParVal' => 'LoginXmlValue'))),
          'ttOut' => array('ttOutRow' => array(array('ParPos' => '0',
              'ParNam' => 'ContentType','ParVal' => ''),array('ParPos' => '1',
              'ParNam' => 'Result','ParVal' => ''),
               array('ParPos' => '2','ParNam' => 'XMLDocumentOut','ParVal' => '')));

$return = $client->wssigateway($pars);

效果很好!

我以这种方式使用 NuSoap:

require_once 'soap/nusoap.php';

$wsdl = 'url_of_wsdl';


$client = new soapclient($wsdl,true);
$err = $client -> getError();
if ($err) {
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
    exit();
}
    $pars = array()//the same as above 
    $result = $client -> call('wssigateway',$pars);

该脚本工作了太多时间,并没有让我得到任何东西..为什么?有人能帮我吗?

4

1 回答 1

0

尝试$client = new nusoap_client($wsdl,true);

代替$client = new soapclient($wsdl,true);

于 2013-07-03T09:59:58.793 回答