title: How can i import a https webservice (wcf) with Delphi 2010?
body: <p>I have a problem so i wanna help from you. 
  There is a webservice and it's url : <a href="https://kps.saglik.gov.tr/Services/KPSTestServices.svc" rel="nofollow">https://kps.saglik.gov.tr/Services/KPSTestServices.svc</a></p>
  
  <p>We can import this url on visual studio c# easily, but we couldn't import it on delphi 2010. </p>
  
  <p>Also we have a user id and password from saglik.gov.tr, but the result is same : can't import this service. What can we do now ? </p>
  
  <p>Thanks for any idea from at the moment.</p>
  
  <p>Visual Studio Sample : <a href="https://kps.saglik.gov.tr/kps_ornek1.zip" rel="nofollow">https://kps.saglik.gov.tr/kps_ornek1.zip</a></p>
  
  <hr>
  
  <p>I was able to import files to your local hard disk recording.</p>
  
  <ul>
  <li><a href="https://kps.saglik.gov.tr/Services/KPSTestServices.svc?wsdl" rel="nofollow">https://kps.saglik.gov.tr/Services/KPSTestServices.svc?wsdl</a> = services.wsdl</li>
  <li><a href="https://kps.saglik.gov.tr/Services/KPSTestServices.svc?wsdl=wsdl0" rel="nofollow">https://kps.saglik.gov.tr/Services/KPSTestServices.svc?wsdl=wsdl0</a> = secondry.wsdl</li>
  <li><a href="https://kps.saglik.gov.tr/Services/KPSTestServices.svc?xsd=xsd0" rel="nofollow">https://kps.saglik.gov.tr/Services/KPSTestServices.svc?xsd=xsd0</a> = xsd0.xsd</li>
  <li><a href="https://kps.saglik.gov.tr/Services/KPSTestServices.svc?xsd=xsd1" rel="nofollow">https://kps.saglik.gov.tr/Services/KPSTestServices.svc?xsd=xsd1</a> = xsd1.xsd</li>
  <li><a href="https://kps.saglik.gov.tr/Services/KPSTestServices.svc?xsd=xsd2" rel="nofollow">https://kps.saglik.gov.tr/Services/KPSTestServices.svc?xsd=xsd2</a> = xsd2.xsd</li>
  </ul>
  
  <p>When I call service , Now I get the https connection failed error.</p>
  
  <p><strong>Xml created by the WCFStorm</strong> 
  (http://www.wcfstorm.com/wcf/home.aspx) </p>
  
  <pre><code>Header 
  
  POST https://kps.saglik.gov.tr/Services/KPSTestServices.svc HTTP/1.1
  Content-Type: application/soap+xml; charset=utf-8
  Host: kps.saglik.gov.tr
  Content-Length: 1256
  Expect: 100-continue
  Connection: Keep-Alive
  
  
  &lt;s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt;&lt;s:Header&gt;&lt;a:Action s:mustUnderstand="1"&gt;http://www.saglik.gov.tr/KPS/2011/KPSServices/TcKimlikNoIleKisiSorgula&lt;/a:Action&gt;&lt;a:MessageID&gt;urn:uuid:b99c1ef4-9e44-42b9-ae1f-9844bfc0f997&lt;/a:MessageID&gt;&lt;a:ReplyTo&gt;&lt;a:Address&gt;http://www.w3.org/2005/08/addressing/anonymous&lt;/a:Address&gt;&lt;/a:ReplyTo&gt;&lt;a:To s:mustUnderstand="1"&gt;https://kps.saglik.gov.tr/Services/KPSTestServices.svc&lt;/a:To&gt;&lt;o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;&lt;u:Timestamp u:Id="_0"&gt;&lt;u:Created&gt;2011-09-13T11:17:27.234Z&lt;/u:Created&gt;&lt;u:Expires&gt;2011-09-13T11:22:27.234Z&lt;/u:Expires&gt;&lt;/u:Timestamp&gt;&lt;o:UsernameToken u:Id="uuid-d7a725d3-aa3c-4336-8651-304ecdb8d5e0-4"&gt;&lt;o:Username&gt;myUserName&lt;/o:Username&gt;&lt;o:Password o:Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"&gt;myPassword&lt;/o:Password&gt;&lt;/o:UsernameToken&gt;&lt;/o:Security&gt;&lt;/s:Header&gt;&lt;s:Body&gt;&lt;TcKimlikNoIleKisiSorgula xmlns="http://www.saglik.gov.tr/KPS/2011"&gt;&lt;tcNo&gt;1842715****&lt;/tcNo&gt;&lt;/TcKimlikNoIleKisiSorgula&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;
  </code></pre>
  
  <p><strong>Response XML</strong></p>
  
  <pre><code>Header
  HTTP/1.1 200 OK
  Cache-Control: private
  Content-Length: 1519
  Content-Type: application/soap+xml; charset=utf-8
  Server: Microsoft-IIS/7.5
  Set-Cookie: ASP.NET_SessionId=0vdbbkozgztz4falycku4gr0; path=/; HttpOnly
  X-AspNet-Version: 4.0.30319
  X-Powered-By: ASP.NET
  Date: Tue, 13 Sep 2011 11:19:40 GMT
  
  &lt;s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt;&lt;s:Header&gt;&lt;a:Action s:mustUnderstand="1"&gt;http://www.saglik.gov.tr/KPS/2011/KPSServices/TcKimlikNoIleKisiSorgulaResponse&lt;/a:Action&gt;&lt;a:RelatesTo&gt;urn:uuid:b99c1ef4-9e44-42b9-ae1f-9844bfc0f997&lt;/a:RelatesTo&gt;&lt;o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;&lt;u:Timestamp u:Id="_0"&gt;&lt;u:Created&gt;2011-09-13T11:19:41.255Z&lt;/u:Created&gt;&lt;u:Expires&gt;2011-09-13T11:24:41.255Z&lt;/u:Expires&gt;&lt;/u:Timestamp&gt;&lt;/o:Security&gt;&lt;/s:Header&gt;&lt;s:Body&gt;&lt;TcKimlikNoIleKisiSorgulaResponse xmlns="http://www.saglik.gov.tr/KPS/2011"&gt;&lt;TcKimlikNoIleKisiSorgulaResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;Hata i:nil="true"/&gt;&lt;Sonuc&gt;&lt;Ad&gt;MUSTAFA&lt;/Ad&gt;&lt;AileSiraNo&gt;12&lt;/AileSiraNo&gt;&lt;AnaAd&gt;LEYLA&lt;/AnaAd&gt;&lt;BabaAd&gt;OSMAN&lt;/BabaAd&gt;&lt;BireySiraNo&gt;*&lt;/BireySiraNo&gt;&lt;CiltAd&gt;-&lt;/CiltAd&gt;&lt;CiltKod&gt;-&lt;/CiltKod&gt;&lt;Cinsiyet&gt;Erkek&lt;/Cinsiyet&gt;&lt;Din i:nil="true"/&gt;&lt;DogumTarihi&gt;21.9.0000&lt;/DogumTarihi&gt;&lt;DogumYer&gt;*&lt;/DogumYer&gt;&lt;Durum&gt;Açık&lt;/Durum&gt;&lt;Hata i:nil="true"/&gt;&lt;IlAd&gt;*&lt;/IlAd&gt;&lt;IlKod&gt;*&lt;/IlKod&gt;&lt;IlceAd&gt;Abana&lt;/IlceAd&gt;&lt;IlceKod&gt;*&lt;/IlceKod&gt;&lt;MedeniHal&gt;Bekar&lt;/MedeniHal&gt;&lt;OlumTarih&gt;0.0.0&lt;/OlumTarih&gt;&lt;Soyad&gt;*&lt;/Soyad&gt;&lt;TCKimlikNo&gt;18427***&lt;/TCKimlikNo&gt;&lt;Yakinlik&gt;Kendisi&lt;/Yakinlik&gt;&lt;/Sonuc&gt;&lt;/TcKimlikNoIleKisiSorgulaResult&gt;&lt;/TcKimlikNoIleKisiSorgulaResponse&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;
  </code></pre>
  
  <p>Delphi 2010</p>
  
  <p><strong>My Request</strong></p>
  
  <pre><code>CONNECT kps.saglik.gov.tr:443 HTTP/1.0
  User-Agent: Borland SOAP 1.2
  Host: kps.saglik.gov.tr:443
  Content-Length: 0
  Proxy-Connection: Keep-Alive
  Pragma: no-cache
  </code></pre>
  
  <p>No XML</p>
  
  <p><strong>My Response</strong></p>
  
  <pre><code>Header 
  HTTP/1.1 502 Unable to Secure Connection
  Via: 1.1 SYSTMG07
  Connection: Keep-Alive
  Proxy-Connection: Keep-Alive
  </code></pre>
  
  <p>No XML</p>