如何在php中通过SOAP访问.net web方法

时间:2017-12-22 07:15:28

标签: php .net soap nusoap

当在.NET中访问函数时,它将始终返回null

//PHP
$client = new nusoap_client("http://14.14.9.4:82/medApi.asmx?wsdl",true);
$result = $client->call("AddDepartment", array('test'));
echo "<pre>";
print_r($result);


//.NET Coading
[WebMethod]
public string AddDepartment(string Param1) {
    if(Param1 == null)
        return "value is null";
    } else {
       return "value present";
    }
}

它总是返回

  

array(AddDepartmentResult-&gt; value为null)

0 个答案:

没有答案