php 用户定义的类,在PHP SOAP中传递用户定义的类型

我无法理解如何在

PHP SOAP调用中传递用户定义的类型.有人可以给我一个提示(或手册的链接)吗?

例:

在我的WSDL文件中,我定义了类型:

xmlns="http://www.w3.org/2000/10/XMLSchema">

我像这样定义服务响应消息:

缺少的部分是 – 如何在SOAP服务器端初始化答案?

我试着写:

$arrRes['Result']['name'] = 'xxx';

$arrRes['Result']['title'] = 'yyy';

$arrRes['Result']['lang'] = 'zzz';

$arrRes['Result']['hehehehe1'] = 'test1';

$arrRes['Result']['hehehehe2'] = 'test2';

$arrRes['Result']['hehehehe3'] = 'test3';

$arrRes['Result']['hehehehe4'] = 'test4';

$arrRes['Result1'] = 'result1';

$arrRes['blablabla'] = 'hahaha';

return $arrRes;

客户端获取响应,当我var_dump它时,它显示arrRes:

array(2) { ["Result"]=> array(7) { ["name"]=> string(3) "xxx" ["title"]=> string(3) "yyy" ["lang"]=> string(3) "zzz" ["hehehehe1"]=> string(5) "test1" ["hehehehe2"]=> string(5) "test2" ["hehehehe3"]=> string(5) "test3" ["hehehehe4"]=> string(5) "test4" } ["Result1"]=> string(7) "result1" }

我期望得到一个错误,因为我初始化的数组与我定义的响应消息不匹配.

所以我想我在wsdl中定义的类型根本没有使用 – 因此它必须是wsdl或客户端或服务器代码中的错误.

提前感谢您的建议!!

尼古拉

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值