[英]Calling ASMX web service from PHP when Operations accept an Interface
I have a .Net web service that has a method that accepts an Interface that I have written as a parameter. 我有一个.Net Web服务,该服务的方法可以接受作为参数编写的接口。 Let's call this interface ICustomer. 我们将此接口称为ICustomer。
How would you call this method from PHP? 您如何从PHP调用此方法?
The method definition is 方法定义为
[WebMethod]
public string RegisterCustomer(ICustomer customer)
{
...
}
you can create a StdClass on PHP with same attributes that in .NET. 您可以在PHP上创建具有与.NET相同属性的StdClass。
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. 如果我理解您的问题,请问是。
SOAP? 肥皂?
$client = new SoapClient($url);
$result = $client->ICustomer($param);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.