Yii Framework Forum: Web Service & Special Characters - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Web Service & Special Characters Rate Topic: -----

#1 User is offline   DavidMarin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 09-April 12
  • Location:Cancun, Mexico

Posted 11 April 2014 - 10:08 AM

Hi.

I have the next problem, I'am using a web service which returns an object, in this object I have many string properties and in some of them i have the letter 'Ñ', and when i use this property the value is always null.
Here is my code:

	public function ObtenerEmpleadoporNumero($numero)
	{
		$empleadosRequest = new EmpleadosRequest();
		$empleadosRequest->numeroEmpleado = $numero;
		try 
		{
			$client = new SoapClient(Yii::app()->params['webServiceEmpleados'], array(
				   'exceptions' => 0,
                                   'encoding'=>'UTF-8',
				   'trace' => 1,
			   ));

			   $result = $client->__soapCall('ObtenerEmpleados', array('EmpleadosRequest'=>$empleadosRequest));
			   
			   utf8_encode(print_r($result));
		} 
		catch (SoapFault $e) 
		{
			$result = null;
		}
		return $result;
	}



As you can see, I put in the constructor the option 'enconding', and when i tried to print it i'm using utf8_enconde, but the value is always null.

Somebody knows how i can get this value?


¡Thanks a lot!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users