当Operations接受接口时,从PHP调用ASMX Web服务
我有一个.Net Web服务,它有一个接受我作为参数编写的接口的方法。 我们称这个接口为ICustomer。
你会如何从PHP调用这个方法?
方法定义是
[WebMethod] public string RegisterCustomer(ICustomer customer) { ... }
您可以在PHP上创建一个StdClass,其属性与.NET中的相同。
例如:
Name = "Test"; $object->LastName = "More tests"; $object->AnotherAttribute = "Abc"; ... $client = new SoapClient($url); $client->__soapCall("MethodName", array('parameters' => array('customer' => $object)); ... ?>
如果我理解你的问题,那就是这个。
肥皂?
$client = new SoapClient($url); $result = $client->ICustomer($param);