Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
skwashd CreditAttribution: skwashd commentedIt 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.
Comment #2
sanday CreditAttribution: sanday commentedHi body
In the newer version of Drupal soap client , we should set defencoding property as i say :
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 .