3 Replies - 474 Views - Last Post: 06 June 2012 - 03:47 AM Rate Topic: -----

#1 nym-ph  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 27
  • Joined: 18-December 10

Function Call to Web Services server only returns integers?

Posted 06 June 2012 - 03:30 AM

Hello everyone!

Can someone help me please? I'm trying to solve this one, and having a hard time. This is an assignment for school.


I am trying to make a remote call, to a function on my Web Services server.

If I do this on the client side,

$cliente = new SoapClient($wsdl, $options);
	$res = $cliente->getTexto();
	echo " $res ";



And this on the server side (my Web Services server),

	/** Função getTexto
	  * @return int
	  */
	function getTexto() {
	$bananas = 123;
	
		return $bananas;
	}


I will get on the client side, an integer with -> 123


Problem is, If I do this instead, on the server side,

	/** Função getTexto
	  * @return string
	  */
	function getTexto() {
	$bananas = "bananas";
	
		return $bananas;
	}



I would expect to get a string with "bananas".

But I get nothing! If I do a var_dump() or a gettype() I get NULL!

So I can send integers, but not strings! Or Arrays with a return type stdClass... That also doesn't work!


Is there anything I might be missing here?

Thank you so much in advance! Any help would be much appreciated!

Nuno

Is This A Good Question/Topic? 0
  • +

Replies To: Function Call to Web Services server only returns integers?

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3521
  • View blog
  • Posts: 10,163
  • Joined: 08-June 10

Re: Function Call to Web Services server only returns integers?

Posted 06 June 2012 - 03:34 AM

did you change the WSDL definition to reflect the change in the return type?
Was This Post Helpful? 2
  • +
  • -

#3 nym-ph  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 27
  • Joined: 18-December 10

Re: Function Call to Web Services server only returns integers?

Posted 06 June 2012 - 03:45 AM

View PostDormilich, on 06 June 2012 - 03:34 AM, said:

did you change the WSDL definition to reflect the change in the return type?


Ahah! Fantastic! That was it! Thank you so much for your help Dormilich! =) It's working now.
Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3521
  • View blog
  • Posts: 10,163
  • Joined: 08-June 10

Re: Function Call to Web Services server only returns integers?

Posted 06 June 2012 - 03:47 AM

I’m glad I could help.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1