NUSOAP serialization problem with soapval and WSDL

From: Date: Wed, 18 May 2005 08:42:54 +0000
Subject: NUSOAP serialization problem with soapval and WSDL
Groups: php.soap 
Request: Send a blank email to php-soap+get-1916@lists.php.net to get a copy of this message
Hi, I am currently using NuSOAP (0.6.9) with PHP4 for some basic Web Services using WSDL functions. I have some trouble with returning arrays: My array looks like that: Array (
    [0] => 52062
    [1] => 52064
    [2] => 52066
    [3] => 52068
    [4] => 52070
    [5] => 52072
    [6] => 52074
    [7] => 52076
    [8] => 52078
    [9] => 52080
) To return this I created a soapval: $datatype = new soapval("zipcodes","array",$zipcodes); return $datatype; Executing the Web Service gives me the following error array: Array (
    [faultcode] => Server
    [faultactor] =>
    [faultstring] => unable to serialize result
    [detail] => Array
        (
            [soapVal] =>
        )
) I tried to implement some workarounds, but they were neither an elegant nor a functionally satisfying solution: 1. I did not use soapval but serialized the array by hand. This works fine but the user of the Web Service then has to unserialize himself. Not good... 2. I disabled WSDL. Instead of $soap->register("city2zip", array("city"=>"xsd:string"), array("zipcodes"=>"xsd:array"), "http://soapinterop.org/"); I then used $soap->register("city2zip"); which also works fine but then the Web Service is without description. I read in the NuSOAP documentation that soapval is used when there is no WSDL. But I do not know how to describe the return array for the WSDL version of my code, so that I do not have to serialize myself. Does anyone know this problem?? Thx in advance Stefan Reimers

« previous php.soap (#1916) next »