使用nusoap调用.net WebService
2008-10-18 18:06 Jaypei 阅读(326) 评论(0) 编辑 收藏 举报网上找的实例代码:
$client = new soapclient("http://host/Webservice.asmx?WSDL", true);
$client->soap_defencoding = 'UTF-8';
$client->decode_utf8 = false;
if ($client->getError()) {
// error
return false;
}
$param = array('arg1'=>$arg1);
$result = $client->call('RemoteMethod', array('parameters'=>$param), '', '', false,
true, 'dcoument', 'encoded');
if ($client->fault) {
// error
return false;
}
if ($client->getError()) {
// error
return false;
}
if ($result) {
// Done
return $result;
} else {
// others...
}
$client->soap_defencoding = 'UTF-8';
$client->decode_utf8 = false;
if ($client->getError()) {
// error
return false;
}
$param = array('arg1'=>$arg1);
$result = $client->call('RemoteMethod', array('parameters'=>$param), '', '', false,
true, 'dcoument', 'encoded');
if ($client->fault) {
// error
return false;
}
if ($client->getError()) {
// error
return false;
}
if ($result) {
// Done
return $result;
} else {
// others...
}