gpt4 book ai didi

wcf - 如何使用 Delphi 2010 导入 https webservice (wcf)?

转载 作者:行者123 更新时间:2023-12-03 15:57:18 24 4
gpt4 key购买 nike

我有一个问题,所以我想得到你的帮助。有一个网络服务,它的网址:https://kps.saglik.gov.tr/Services/KPSTestServices.svc

我们可以在 Visual Studio C# 上轻松导入此 URL,但无法在 Delphi 2010 上导入它。

我们还有来自 saglik.gov.tr 的用户 ID 和密码,但结果是相同的:无法导入此服务。我们现在能做什么 ?

感谢您目前的任何想法。

Visual Studio 示例:https://kps.saglik.gov.tr/kps_ornek1.zip

<小时/>

我能够将文件导入到您的本地硬盘录制中。

当我调用服务时,现在我收到 https 连接失败错误。

由 WCFStorm 创建的 Xml(http://www.wcfstorm.com/wcf/home.aspx)

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


<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"><s:Header><a:Action s:mustUnderstand="1">http://www.saglik.gov.tr/KPS/2011/KPSServices/TcKimlikNoIleKisiSorgula</a:Action><a:MessageID>urn:uuid:b99c1ef4-9e44-42b9-ae1f-9844bfc0f997</a:MessageID><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo><a:To s:mustUnderstand="1">https://kps.saglik.gov.tr/Services/KPSTestServices.svc</a:To><o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><u:Timestamp u:Id="_0"><u:Created>2011-09-13T11:17:27.234Z</u:Created><u:Expires>2011-09-13T11:22:27.234Z</u:Expires></u:Timestamp><o:UsernameToken u:Id="uuid-d7a725d3-aa3c-4336-8651-304ecdb8d5e0-4"><o:Username>myUserName</o:Username><o:Password o:Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">myPassword</o:Password></o:UsernameToken></o:Security></s:Header><s:Body><TcKimlikNoIleKisiSorgula xmlns="http://www.saglik.gov.tr/KPS/2011"><tcNo>1842715****</tcNo></TcKimlikNoIleKisiSorgula></s:Body></s:Envelope>

响应 XML

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

<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"><s:Header><a:Action s:mustUnderstand="1">http://www.saglik.gov.tr/KPS/2011/KPSServices/TcKimlikNoIleKisiSorgulaResponse</a:Action><a:RelatesTo>urn:uuid:b99c1ef4-9e44-42b9-ae1f-9844bfc0f997</a:RelatesTo><o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><u:Timestamp u:Id="_0"><u:Created>2011-09-13T11:19:41.255Z</u:Created><u:Expires>2011-09-13T11:24:41.255Z</u:Expires></u:Timestamp></o:Security></s:Header><s:Body><TcKimlikNoIleKisiSorgulaResponse xmlns="http://www.saglik.gov.tr/KPS/2011"><TcKimlikNoIleKisiSorgulaResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Hata i:nil="true"/><Sonuc><Ad>MUSTAFA</Ad><AileSiraNo>12</AileSiraNo><AnaAd>LEYLA</AnaAd><BabaAd>OSMAN</BabaAd><BireySiraNo>*</BireySiraNo><CiltAd>-</CiltAd><CiltKod>-</CiltKod><Cinsiyet>Erkek</Cinsiyet><Din i:nil="true"/><DogumTarihi>21.9.0000</DogumTarihi><DogumYer>*</DogumYer><Durum>Açık</Durum><Hata i:nil="true"/><IlAd>*</IlAd><IlKod>*</IlKod><IlceAd>Abana</IlceAd><IlceKod>*</IlceKod><MedeniHal>Bekar</MedeniHal><OlumTarih>0.0.0</OlumTarih><Soyad>*</Soyad><TCKimlikNo>18427***</TCKimlikNo><Yakinlik>Kendisi</Yakinlik></Sonuc></TcKimlikNoIleKisiSorgulaResult></TcKimlikNoIleKisiSorgulaResponse></s:Body></s:Envelope>

德尔福2010

我的请求

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

没有 XML

我的回应

Header 
HTTP/1.1 502 Unable to Secure Connection
Via: 1.1 SYSTMG07
Connection: Keep-Alive
Proxy-Connection: Keep-Alive

没有 XML

最佳答案

您需要将 delphi 指向服务的 WSDL。只需将 ?wsdl 附加到您提供的第一个 URL 的末尾: https://kps.saglik.gov.tr/Services/KPSTestServices.svc?wsdl并打开此网址。

将文件另存为 wsdl 文件并使用以下命令导入:文件 -> 新建 -> 其他 -> Delphi 项目 -> Web 服务 -> WSDL 导入器

请注意:当网络服务发生变化时,您需要重新导入。此外,以这种方式使用 Web 服务,您可能需要将 wsdl 与您的应用程序一起部署,具体取决于您在使用 Web 服务时是否使用 wsdl。

关于wcf - 如何使用 Delphi 2010 导入 https webservice (wcf)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7400593/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com