Home > Backend Development > PHP Tutorial > php怎么调用webservice

php怎么调用webservice

WBOY
Release: 2016-06-13 13:42:41
Original
889 people have browsed it

php如何调用webservice,
//require_once('../lib/nusoap.php');
//$client = new soapclient('http://localhost:8080/IBEIntf/services/IBEService?wsdl','wsdl');


/******************************************************************************/
/* 文件名 : soapclient.php
/* 说 明 : WebService接口客户端例程
/******************************************************************************/
include('../lib/nusoap.php');

// 创建一个soapclient对象,参数是server的WSDL 
$client = new soapclient('http://localhost:8080/IBEIntf/services/IBEService?wsdl', 'wsdl');

// 参数转为数组形式传递
$aryPara = array('strUsername'=>'username', 'strPassword'=>MD5('password'));

// 调用远程函数
$aryResult = $client->call('login',$aryPara);

//echo $client->debug_str;
/*
if (!$err=$client->getError()) {
  print_r($aryResult); 
} else { 
  print "ERROR: $err"; 
}
*/

$document=$client->document;
echo
 
 
  $document
 
 

SoapDocument;


?>
这是我在网上搜的例子,但不能运行,求高手帮帮我,我的Q1175210752

------解决方案--------------------
在浏览器地址栏输入 http://localhost:8080/IBEIntf/services/IBEService?wsdl
后,得到什么?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template