问题
I have a .Net web service that has a method that accepts an Interface that I have written as a parameter. Let's call this interface ICustomer.
How would you call this method from PHP?
The method definition is
[WebMethod]
public string RegisterCustomer(ICustomer customer)
{
...
}
回答1:
you can create a StdClass on PHP with same attributes that in .NET.
ex:
<?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));
...
?>
If I understand your question, is this.
回答2:
SOAP?
$client = new SoapClient($url);
$result = $client->ICustomer($param);
来源:https://stackoverflow.com/questions/4648999/calling-asmx-web-service-from-php-when-operations-accept-an-interface