开发者

Calling ASMX web service from PHP when Operations accept an Interface

开发者 https://www.devze.com 2023-02-04 12:20 出处:网络
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.

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 开发者_StackOverflow社区this method from PHP?

The method definition is

    [WebMethod]
    public string RegisterCustomer(ICustomer customer)
    {
     ...
    }


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.


SOAP?

$client = new SoapClient($url);
$result = $client->ICustomer($param);
0

精彩评论

暂无评论...
验证码 换一张
取 消