当Operations接受接口时,从PHP调用ASMX Web服务

Dun*_*unc 0 php c# web-services asmx

我有一个.Net Web服务,它有一个接受我作为参数编写的接口的方法.我们称这个接口为ICustomer.

你会如何从PHP调用这个方法?

方法定义是

    [WebMethod]
    public string RegisterCustomer(ICustomer customer)
    {
     ...
    }
Run Code Online (Sandbox Code Playgroud)

Ces*_*sar 5

您可以在PHP上创建一个StdClass,其属性与.NET中的相同.

例如:

<?php
$object = new stdClass();
$object->Name = "Test";
$object->LastName = "More tests";
$object->AnotherAttribute = "Abc";
...

$client = new SoapClient($url);
$client->__soapCall("MethodName", array('parameters' => array('customer' => $object));
...
?>
Run Code Online (Sandbox Code Playgroud)

如果我理解你的问题,那就是这个.