Page 1 of 1

PEAR SOAP-return assoc array,labels show up,but no values!?!

Posted: Fri May 12, 2006 11:20 am
by MentalWealth
Hi all.........

recently been playing with a PHP PEAR SOAP client and service i made, and getting the weird prob i mentioned above. The service did work, but i changed my data passing mechanism. I was returning a single string before....in the form of an XML serialized doc with data encoded within it. I am trying to make the service WSDL more pro, by specifying multiple data elements.

i started by removing all my 'xml serialisation' from my code, and modified my WSDL to specify a 'responsecode' and a 'message' returned as an array. So, when returning data from my service, i need to send an integer responsecode, and a string message.......

To test this, i placed this code at the top of my service script, to test output:

Code: Select all

return array(['responsecode']=>999,['message']=>"hello");

but all i get when i do print_r, the response is:

Code: Select all

Array ( [responsecode] => [message] => )

no values!!!??? tried multiple values in different ways.......but it should work..........my wsdl is ok, and my server/service seems to be ok....no errors.


my WSDL specifies:

Code: Select all

- <message name="accessRequest">
  <part name="client_ref" type="xsd:String" /> 
  <part name="pass" type="xsd:String" /> 
  <part name="action" type="xsd:String" /> 
  <part name="args" type="xsd:String" /> 
  </message>
- <message name="accessResponse">
  <part name="responsecode" type="xsd:Integer" /> 
  <part name="message" type="xsd:String" /> 
  </message>
- <portType name="NNEPCPort">
- <operation name="access">
  <input message="tns:accessRequest" /> 
  <output message="tns:accessResponse" /> 

any advice on this anyone about what the problem could be?

cheers.

MW

Posted: Fri May 12, 2006 11:23 am
by MentalWealth
dammit!

if i try

return array(999,"hello");

it works......seems its trying to pass assoc labels thats the prob.

should have tried this, that will do for me!
:P