PHP SOAP Server方法接收一组参数 [英] PHP SOAP Server method receive a set of parameters

查看:228
本文介绍了PHP SOAP Server方法接收一组参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用php设置了SOAP服务器.

I have setup a SOAP Server with php.

问题在于,按照WSDL,调用服务器方法的客户端应该传递一组参数(超过50个).我是从SOAP UI上了解这一点的.

The problem is that, as per the WSDL, the client which calls the server method, is supposed to pass a set of parameters (more than 50). I got to know this from SOAP UI.

但是我该如何处理Server方法中的所有这些参数? 我应该继续为我的Server方法声明每个参数,如下所示?

But how do i handle all those parameters in my Server method? Should i go on and declare each and every parameter for my Server method, as below?

public function addMessage($a, $b, $c, $d, .................) {

}

但是我希望必须有一个更简单的方法.最好,我希望以数组或对象的形式接收Server方法中的所有参数.

But I hope there must be a simpler approach to this. Preferably, i would like to receive all parameters in my Server method, as an array or object.

更新:我正在使用Zend_Soap_Server.我需要定义任何复杂的类型来处理输入参数吗?如我所见,WSDL定义了一些复杂的类型.

UPDATE: I am using Zend_Soap_Server. Do i need to define any complex types, for handling input parameters? As i see, the WSDL defines few complex types.

推荐答案

好吧,我终于可以在我的方法中将参数作为对象接收.这些对象已经在XSD文件中定义为复杂类型.

Well, i could finally receive the parameters as objects in my method. These objects were already defined as complex types in the XSD files.

这篇关于PHP SOAP Server方法接收一组参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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