SoapClient 调用web service

参考如下,特别注意参数的数组写法

View Code
try {
    $client = new SoapClient('http://xxxService?wsdl');
    //var_dump( $client->__getFunctions() );
    //var_dump( $client->__getTypes() );
    $result = $client->__soapCall("doTrans", array('parameters'=>array('arg0'=>$param)));
    //$result = $client->__Call("doTrans", array('parameters'=>array('arg0'=>$param)));
    printf("Result = %s", $result->return);
} catch (Exception $e) {
    printf("Message = %s",$e->__toString());
}
posted @ 2012-08-22 17:30  xiaoluozi513  阅读(233)  评论(0编辑  收藏  举报