NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Problem with asoociative array


Joined: 20 Nov 2008
Posts: 2
Reply with quote
I have a SOAP Server (created with the PHP5 Standard Soap Functions) and a nuSoap Client.

The Parameters are a username (string), a password (string) and customerdata (associative array)

Code:

function add_data(username,password,customerdata) {
 dosomething();
 return array($errorcode,$msg);
}


The strange Problem:
If i use an associative array and want to access it in the soap function (for example customerdata["firstname"]) i get an error-response

Code:

Array
(
    [faultcode] => SOAP-ENV:Server
    [faultstring] => Cannot use object of type stdClass as array
)


But if i immediatly return the complete array (return customerdata;) in the soap function i get back the correct associative array, and also if i don't use an associative array i don't have these problems.

I'm relatively new to soap (and don't use a WDL Description of the SOAP Service atm) but need this functionality for a project.

Any Ideas?

Matthias
View user's profileFind all posts by zappzarappSend private message


Joined: 20 Nov 2008
Posts: 2
Reply with quote
Ok, after some research in the forum and with Google I think I will solve it with a nuSoap-Server and complex types.

Matthias
View user's profileFind all posts by zappzarappSend private message
Problem with asoociative array
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic