NuSOAP and response with Array

我的梦境 提交于 2019-12-04 10:25:36

I solved this problem using this

$server->wsdl->addComplexType(
'Event',
'element',
'struct',
'all',
'',
array(
    'field1' => array('name' => 'MemberNumber', 'type' => 'xsd:int'),
             // ...
    'fieldN' => array('name' => 'WebMemberID', 'type' => 'xsd:int')
));

I use "element" instead of "complexType" for the typeClass parameter.

I solve the problem doing this in the v1.123 2010/04/26 20:15:08 nusoap lib.

Comment the Line 6136:

$contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use);

And add this code:

$tag = end( explode(":" , $typeDef['arrayType'] ));
$tag = $tag==""?'item':$tag;
$contents .= $this->serializeType( $tag, $typeDef['arrayType'], $v, $use);

Works for me ! Hope helps !

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