Calling ASMX web service from PHP when Operations accept an Interface

杀马特。学长 韩版系。学妹 提交于 2019-12-23 04:49:15

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!