title: SoapClient php connect WCF services with x509 certificate
body: <p>I'm using SoapClient in PHP to connect WS .NET.
  Here is a part of wsdl :</p>
  
  <pre><code>&lt;wsa10:EndpointReference&gt;
  &lt;wsa10:Address&gt;-------------&lt;/wsa10:Address&gt;
  &lt;Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity"&gt;
   &lt;KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"&gt;
    &lt;X509Data&gt;
    &lt;X509Certificate&gt;
       hfWyLJxqZRtXrHw4slQBxEU8SGgHhQsYsRS...
    &lt;/X509Certificate&gt;
    &lt;/X509Data&gt;
   &lt;/KeyInfo&gt;
  &lt;/Identity&gt;
  &lt;/wsa10:EndpointReference&gt;
  </code></pre>
  
  <p>Here is my code to connect :</p>
  
  <pre><code>$client = new SoapClient($wsdl,  array('soap_version' =&gt; SOAP_1_2, 'login' =&gt; 'login', 'password'=&gt;'password' , 'trace' =&gt; 1));
  $auth = new stdClass();
  $auth-&gt;ecodedValue = $hash;
  $header = new SoapHeader('http://schemas.xmlsoap.org/ws/2006/02/addressingidentity', 'identity', $auth, false);
  $client-&gt;__setSoapHeaders($header);
  </code></pre>
  
  <p>and xml will be generated like that :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; 
  &lt;env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://tempuri.org/" xmlns:ns2="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity"&gt;
  &lt;env:Header&gt;
  &lt;ns2:identity&gt;
   &lt;encodedValue&gt;MIIEvjC&lt;/encodedValue&gt;  
  &lt;/ns2:identity&gt;
  &lt;/env:Header&gt;
  &lt;env:Body&gt;
  &lt;ns1:GetBalanceByPhoneNumber&gt; 
  &lt;ns1:phoneNumber&gt;------------&lt;/ns1:phoneNumber&gt;
  &lt;/ns1:GetBalanceByPhoneNumber&gt;
  &lt;/env:Body&gt;
  &lt;/env:Envelope&gt;
  </code></pre>
  
  <p>What format of xml should I generate to pass certificate of WS? I'm waiting for your help :(.Thanks!</p>