Windows商店应用程序不识别web服务功能


Windows store app won't recognize function of web service

我做了一个web服务:client &服务器的工作很好,在我的浏览器,但当我把它添加到我的参考,我无法访问我的功能!

这是我的web服务器代码:

<?php
 require 'nusoap.php';
 $server=new nusoap_server();
 $server->configureWSDL("demo","urn:demo");
$server->soap_defencoding = 'utf-8';
$server->wsdl->addComplexType('getAllKeyData','complexType','struct','all','',
 array(
    'id'=> array('name'=>'id', 'type' =>'xsd:int'),
    'emailadres'=> array('name'=>'emailadres', 'type' =>'xsd:String'),
    'familienaam'=> array('name'=>'familienaam', 'type' =>'xsd:String'),
    'paswoord'=> array('name'=>'paswoord', 'type' =>'xsd:String'),
    'status'=> array('name'=>'status', 'type' =>'xsd:String'),
    'voornaam'=> array('name'=>'voornaam', 'type' =>'xsd:String')
    )
);
$server->wsdl->addComplexType(
    'MySoapObjectArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:getAllKeyData[]')),'tns:getAllKeyData');

 $server->register(
    'getAllKeys', //name of function
    array(), //inputs
    array('return'=>'tns:MySoapObjectArray'), //outputs
    'urn:getAllKeyswsdl',
    'urn:getAllKeyswsdl#getAllKeys',
    'rpc',
    'encoded',
    'Processes an array of MySoapObjects and returns one of them'
);
function getAllKeys(){

    $con=mysql_connect('localhost','root','')or die("cannot connect"); 
    mysql_select_db('test')or die("cannot select db");
    $sql = 'Select * from personen';
    $result=mysql_query($sql,$con);
    $out=array();
    while($row = mysql_fetch_assoc($result))
    {
        $out[]=$row;
    }
    return $out;

}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>

当然,我测试了这个与我的web客户端,我可以看到我的数据完美的数组:

          [0] => Array
            (
                [id] => 1
                [emailadres] => braril.com
                [familienaam] => Vandenbogaerde
                [paswoord] => test
                [status] => aktief
                [voornaam] => Bram
            )
        [1] => Array
            (
                [id] = 50
                [emailadres] => koeaenussel.be
                [familienaam] => Christiaens
                [paswoord] => HoofdletterH
                [status] => aktief
                [voornaam] => Koen
            )
        [2] => Array
            (
                [id] => 5
                [emailadres] => som
                [familienaam] => Furler
                [paswoord] => Titanium
                [status] => aktief
                [voornaam] => Sia Kate Isobelle
            )

现在我将我的web服务器添加到我的服务引用中然后我像这样声明我的服务:

 var client2 = new ServiceReference2.demoPortTypeClient();

但我现在最大的问题是,我不能使用我的功能,我在我的web服务器!

http://prntscr.com/319wv2

如果你有任何想法,请帮助!

问题解决:

$server->register(
    'getAllKeys', //name of function
    array(), //inputs
    array('return'=>'xsd:Array'), //outputs
    'urn:getAllKeyswsdl',
    'urn:getAllKeyswsdl#getAllKeys',
    'rpc',
    'encoded',
    'Processes an array of MySoapObjects and returns one of them'
);
返回类型必须是:xsd:Array