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 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?