title: php SOAP response encoding issue
body: <p>all I had to do was change the default charset in my php.ini file</p>
  
  <pre><code>default_charset = "UTF-8"
  </code></pre>
  
  <p><strike>
  I'm trying to create a SOAP client in PHP, but I'm having trouble with encoding. The $Response has words with incorrect characters like Ã¨ instead of è.</p>
  
  <p>When importing the WSDL file into <a href="http://www.soapui.org/" rel="nofollow">SoapUI</a> (a soap test suite) responses come back correctly encoded, so I don't think it has to do with the SOAP service. SoapUI indicates that it's using UTF-8. I've also tried a bunch of other <a href="http://php.net/manual/en/mbstring.supported-encodings.php" rel="nofollow">encodings</a>, but without success. </p>
  
  <p>All my php files are encoded in UTF-8.</p>
  
  <pre><code>$client = new SoapClient($wsdl_file, array('encoding'=&gt;'UTF-8'));
  $Response = $client-&gt;__soapCall('GetMemberDetails', array($request));
  debug($Response); die;
  </code></pre>
  
  <p>A sample response:</p>
  
  <pre><code>&lt;members xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
    &lt;UserInfo&gt;
      ...
      &lt;Status&gt;rÃ¨gle&lt;/Status&gt;
      ...
    &lt;/UserInfo&gt;
  &lt;/members&gt;
  </code></pre>
  
  <p>This is the raw request from SoapUI</p>
  
  <pre><code>POST http://test.app.com/WebServices/MemberService/MemberService.svc HTTP/1.1
  Accept-Encoding: gzip,deflate
  Content-Type: text/xml;charset=UTF-8
  SOAPAction: "http://test.org/MemberService/GetMemberDetails"
  Content-Length: 419
  Host: test.app.com
  Connection: Keep-Alive
  User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
  </code></pre>
  
  <p>is there a way to get the same kind of raw request from SoapClient in PHP?</p>
  
  <p>edit: I intercepted the request in __doRequest. Here are the differences between SoapClient and SoapUI</p>
  
  <p>SoapClient (receives encoding errors)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test.org/"&gt;
    &lt;SOAP-ENV:Body&gt;
      &lt;ns1:GetMemberDetails&gt;
        &lt;ns1:memberId&gt;123&lt;/ns1:memberId&gt;
      &lt;/ns1:GetMemberDetails&gt;
    &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>SoapUI (receives correct encoding)</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://test.org/"&gt;
     &lt;soapenv:Header/&gt;
     &lt;soapenv:Body&gt;
        &lt;tem:GetMemberDetails&gt;
           &lt;!--Optional:--&gt;
           &lt;tem:memberId&gt;123&lt;/tem:memberId&gt;
        &lt;/tem:GetMemberDetails&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p></strike></p>