如何在PHP环境中调用.NET的WebService ?
sqhua 2004-11-23 04:51:41 我已经可以调用.NET下的WebService了,但无法传递参数给方法
PHP:
<?php
require_once('nusoap.php');
$myString="world";
$parameters=array($myString);
// set the URL or path to the WSDL document
$wsdl = "http://localhost/vs_net_test/webService/server.asmx?WSDL";
$soap = new soapclient($wsdl,"wsdl");
$proxy = $soap->getProxy();
$result = $proxy->HelloWorld($parameters);
echo( $result ) ;
?>
经过测试,参数传递不成功,而且返回的中文变成了问号
.NET :
[WebMethod]
public string HelloWorld( string str )
{
return "->" + str + " :Hello World, 成功了";
}