当Operations接受接口时从PHP调用ASMX Web服务 [英] Calling ASMX web service from PHP when Operations accept an Interface

查看:98
本文介绍了当Operations接受接口时从PHP调用ASMX Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.Net Web服务,该服务具有接受我编写为参数的接口的方法.我们将此接口称为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.

您如何从PHP调用此方法?

How would you call this method from PHP?

方法定义为

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

推荐答案

您可以在PHP上创建具有与.NET相同属性的StdClass.

you can create a StdClass on PHP with same attributes that in .NET.

例如:

<?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.

这篇关于当Operations接受接口时从PHP调用ASMX Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆