[英]Calling ASMX web service from PHP when Operations accept an Interface
我有一個.Net Web服務,該服務的方法可以接受作為參數編寫的接口。 我們將此接口稱為ICustomer。
您如何從PHP調用此方法?
方法定義為
[WebMethod]
public string RegisterCustomer(ICustomer customer)
{
...
}
您可以在PHP上創建具有與.NET相同屬性的StdClass。
例如:
<?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));
...
?>
如果我理解您的問題,請問是。
肥皂?
$client = new SoapClient($url);
$result = $client->ICustomer($param);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.