dsfds2353 2013-04-27 19:20
浏览 61
已采纳

PHP Web服务没有消耗

I'm using nusoap and I'm having dificulties in consuming webservices ... What I'm trying to return to who consumes one of the webservices is one array ... In the first case I'm trying to return this type of array:

Array ( [0] => EX123EX [1] => Test [2] => 2013/04/27 [3] => 12:06 [4] => This is a test [5] => [+]Info [-]Info ) 

And for this I have:

$server->wsdl->addComplexType(
'details',
'complexType',
'struct',
'all',
'',
array(
        'id' => array('name' => 'id', 'type' => 'xsd:string'),
        'product' => array('name' => 'product', 'type' => 'xsd:string'),
        'date' => array('name' => 'date', 'type' => 'xsd:string'),
        'hour' => array('name' => 'hour', 'type' => 'xsd:string'),
        'status' => array('name' => 'status', 'type' => 'xsd:string'),
    'info' => array('name' => 'info', 'type' => 'xsd:string'),
));

$server->register(
'getdetails',
array('url' => 'xsd:string'),
array('return' => 'tns:details'),
            $namespace,
            false,
            'rpc',
            'literal',
            'details');

and the function:

function getdetalhes($url)
{
$details = getHeader($url);
return $details;
}

The problem is that the webservice is not consumed... When I make the request I have no answer ... With this error I'm also unable to keep on for the next webservice that would return an array with this structure:

Array ( [0] => Array ( ) [1] => Array ( [0] => 2012/12/13 [1] => 12:06 [2] => Test [3] => - [4] => Test Test  [5] => Test ) [2] => Array ( [0] => 2012/12/13 [1] => 09:23 [2] => Test Test  [3] => - [4] => Test  [5] => - ) [3] => Array ( [0] => 2012/12/12 [1] => 17:43 [2] => Test  [3] => - [4] => Test  [5] => - ) [4] => Array ( [0] => 2012/12/12 [1] => 11:25 [2] => Test  [3] => Test  [4] =>Test [5] => - )

I'm confident that the error is on the complexType declaration but I can't figure out what is the problem, can someone help me please?

  • 写回答

1条回答 默认 最新

  • dongqiu8375 2013-04-30 10:41
    关注

    Please, make sure that you're accessing the associative keywords of the array instead of indexes :)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 r语言神经网络自变量重要性分析
  • ¥15 基于双目测规则物体尺寸
  • ¥15 wegame打不开英雄联盟
  • ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)
  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢