[英]nusoap client not not responding
I'm trying to write a simple web service server and client using nusoap. 我正在尝试使用nusoap编写一个简单的Web服务服务器和客户端。 I think my server works fine because a VB.NET client can call it.
我认为我的服务器工作正常,因为VB.NET客户端可以调用它。 However, the PHP client has a very long loading time and does not give any output.
但是,PHP客户端的加载时间非常长,并且不提供任何输出。
server1.php server1.php
<?
require_once("nusoap/lib/nusoap.php");
$ns="localhost/";
$server = new soap_server();
$server->configureWSDL('TaxCalculator', $ns);
$server->wsdl->schemaTargetNamespace = $ns;
$server->register('TaxCalc', array('amount'=>'xsd:string'),array('return'=>'xsd:string'),$ns);
function TaxCalc($amount) {
$tax = $amount * 0.5;
return new soapval('return', 'xsd:string', $tax);
}
$server->service($HTTP_RAW_POST_DATA);
?>
client1.php client1.php
<?
require_once('nusoap/lib/nusoap.php');
$client=new soapclient('http://localhost/server1.php?wsdl', 'wsdl');
echo $client->call('TaxCalc', array('amount'=>'15.00'));
?>
I'm using PHP Version 5.2.6 and nusoap version 0.9.5. 我正在使用PHP版本5.2.6和nusoap版本0.9.5。
I'd say use whatever works. 我会说使用任何可行的方法。
I have used nusoap.php,v 1.114 and it works for me. 我使用了nusoap.php,v 1.114,它对我有用。
The nuspoap_client call I have is different from what you have above. 我的nuspoap_client调用与上面的调用不同。 Yours does not have a paramter for what port to use.
您的使用端口没有参数。
$client = new nusoap_client("http://127.0.0.1:1024/soap/IApp", false,
$proxyhost, $proxyport, $proxyusername, $proxypassword);
The 2nd parameter above says not to use a wsdl file. 上面的第二个参数表示不使用wsdl文件。 I am guessing that maybe your VB client uses the same approach.
我猜想您的VB客户端可能使用相同的方法。
Your code looks like it wants to use a local wsdl file. 您的代码看起来像是要使用本地wsdl文件。
Alternatively maybe there is a permissions issue where VB is allowed to access the soap port and PHP is not. 另外,可能存在权限问题,其中允许VB访问soap端口,而不允许PHP。 (doubt it as everything is local)
(因为一切都是本地,所以对此表示怀疑)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.