While using many SOAP oriented webservices we need to alter the nuSOAP's defencoding, decode_utf8, etc. properties. Since the DrupalSoapClient does not provide an API to change such properties or calling the internal methods, we can make the $client public, so we can have:

  $soap_client['#return']->client->decode_utf8 = FALSE;
  $soap_client['#return']->client->defencoding = 'UTF-8';

Comments

skwashd’s picture

It should at least be protected. If you start defining private members you should really be defining the class as final.

Given that the soapclient is an abstraction layer so users can use nuSOAP or PHP5 SOAP, doing nuSOAP specific stuff kinda defeats the purpose of it, you might as well bundle nuSOAP with your module/project.

sanday’s picture

Hi body
In the newer version of Drupal soap client , we should set defencoding property as i say :

$soap_client['#return']->client->soap_defencoding = 'UTF-8';

to work with Persian (or other language witch work with UTF8) language properly .
It took me a lot of time to find it out .
There must be some way to do this without changing 'DrupalSoapClient' , I will be happy to know it .
Thanks .