svc uzantılı webservis

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
yusuf
Üye
Mesajlar: 139
Kayıt: 20 Tem 2005 11:05
Konum: İSTANBUL

svc uzantılı webservis

Mesaj gönderen yusuf »

Merhaba arkadaşlar daha önce içişleri bakanlığının kimlik paylaşım sisteminin asmx olan servisi yeni düzenlemeye giderek kps.asmx?wsdl olan servis adı kps.svc?wsdl olarak değiştirilmiş. içişleri bakanlığı ile yapılan protokolde sizden bağlantı yapacağınız serverin Ip nosu talep ediliyor. yalnız o ıp üzerinden webservis e ulaşıp sorgu yapabiliyorsunuz bu noktada bir firmaya aracı bir webservis yaptırıp servere koyduk diğer bağlantı yapacak proğramlarda bu araca servis üzerinden kimlik sorgusu yapmaktaydık sorun şu içişleri bakanlığı tekrar bir değişikliğe gitti asmx uzantılı servisi svc uzantılı bir servise çevirdi biz tekrar aracı servis yaptırıp server koyduk fakat şimdi Delphi7 ile proğrama import ediyoruz fakat hata veriyor. acaba asmx ile svc arasındaki fark nedir nasıl düzeltme yapabilirim.


önceki servis şu şekilde idi

Kod: Tümünü seç

[code]/ ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : http://192.168.6.8/kbs/mernis/Service.asmx?wsdl
// Encoding : utf-8
// Version  : 1.0
// (16.10.2008 14:13:10 - 1.33.2.5)
// ************************************************************************ //

unit Service;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;

type

  // ************************************************************************ //
  // The following types, referred to in the WSDL document are not being represented
  // in this file. They are either aliases[@] of other types represented or were referred
  // to but never[!] declared in the document. The types from the latter category
  // typically map to predefined/known XML or Borland types; however, they could also 
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //
  // !:string          - "http://www.w3.org/2001/XMLSchema"
  // !:dateTime        - "http://www.w3.org/2001/XMLSchema"
  // !:int             - "http://www.w3.org/2001/XMLSchema"

  KisiVeri             = class;                 { "http://tempuri.org/" }



  // ************************************************************************ //
  // Namespace : http://tempuri.org/
  // ************************************************************************ //
  KisiVeri = class(TRemotable)
  private
    FgsAd: WideString;
    FgsSoyAd: WideString;
    FgsAnaAd: WideString;
    FgsAnaSoyAd: WideString;
    FgsBabaAd: WideString;
    FgsBabaSoyAd: WideString;
    FgsCinsiyet: WideString;
    FgtDogumTarih: TXSDateTime;
    FgsDogumYer: WideString;
    FgsKizlikSoyAd: WideString;
    FgiAileSiraNo: Integer;
    FgiBireySiraNo: Integer;
    FgsCiltAd: WideString;
    FgsCiltKod: Integer;
    FgsIlAd: WideString;
    FgsIlceAd: WideString;
    FgsIlceKod: Integer;
    FgsIlKod: Integer;
  public
    destructor Destroy; override;
  published
    property gsAd: WideString read FgsAd write FgsAd;
    property gsSoyAd: WideString read FgsSoyAd write FgsSoyAd;
    property gsAnaAd: WideString read FgsAnaAd write FgsAnaAd;
    property gsAnaSoyAd: WideString read FgsAnaSoyAd write FgsAnaSoyAd;
    property gsBabaAd: WideString read FgsBabaAd write FgsBabaAd;
    property gsBabaSoyAd: WideString read FgsBabaSoyAd write FgsBabaSoyAd;
    property gsCinsiyet: WideString read FgsCinsiyet write FgsCinsiyet;
    property gtDogumTarih: TXSDateTime read FgtDogumTarih write FgtDogumTarih;
    property gsDogumYer: WideString read FgsDogumYer write FgsDogumYer;
    property gsKizlikSoyAd: WideString read FgsKizlikSoyAd write FgsKizlikSoyAd;
    property giAileSiraNo: Integer read FgiAileSiraNo write FgiAileSiraNo;
    property giBireySiraNo: Integer read FgiBireySiraNo write FgiBireySiraNo;
    property gsCiltAd: WideString read FgsCiltAd write FgsCiltAd;
    property gsCiltKod: Integer read FgsCiltKod write FgsCiltKod;
    property gsIlAd: WideString read FgsIlAd write FgsIlAd;
    property gsIlceAd: WideString read FgsIlceAd write FgsIlceAd;
    property gsIlceKod: Integer read FgsIlceKod write FgsIlceKod;
    property gsIlKod: Integer read FgsIlKod write FgsIlKod;
  end;


  // ************************************************************************ //
  // Namespace : http://tempuri.org/
  // soapAction: http://tempuri.org/%operationName%
  // transport : http://schemas.xmlsoap.org/soap/http
  // binding   : ServiceSoap
  // service   : Service
  // port      : ServiceSoap
  // URL       : http://192.168.6.8/kbs/mernis/Service.asmx
  // ************************************************************************ //
  ServiceSoap = interface(IInvokable)
  ['{77573149-9C57-FA51-F11F-EFD527C91BD9}']
    function  BaglantiBilgi: WideString; stdcall;
    function  TckyaGoreKimlikBilgileriGetir(const sTckNo: WideString): KisiVeri; stdcall;
  end;

function GetServiceSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): ServiceSoap;


implementation

function GetServiceSoap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): ServiceSoap;
const
  defWSDL = 'http://192.168.6.8/kbs/mernis/Service.asmx?wsdl';
  defURL  = 'http://192.168.6.8/kbs/mernis/Service.asmx';
  defSvc  = 'Service';
  defPrt  = 'ServiceSoap';
var
  RIO: THTTPRIO;
begin
  Result := nil;
  if (Addr = '') then
  begin
    if UseWSDL then
      Addr := defWSDL
    else
      Addr := defURL;
  end;
  if HTTPRIO = nil then
    RIO := THTTPRIO.Create(nil)
  else
    RIO := HTTPRIO;
  try
    Result := (RIO as ServiceSoap);
    if UseWSDL then
    begin
      RIO.WSDLLocation := Addr;
      RIO.Service := defSvc;
      RIO.Port := defPrt;
    end else
      RIO.URL := Addr;
  finally
    if (Result = nil) and (HTTPRIO = nil) then
      RIO.Free;
  end;
end;


destructor KisiVeri.Destroy;
begin
  if Assigned(FgtDogumTarih) then
    FgtDogumTarih.Free;
  inherited Destroy;
end;

initialization
  InvRegistry.RegisterInterface(TypeInfo(ServiceSoap), 'http://tempuri.org/', 'utf-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(ServiceSoap), 'http://tempuri.org/%operationName%');
  RemClassRegistry.RegisterXSClass(KisiVeri, 'http://tempuri.org/', 'KisiVeri');
  InvRegistry.RegisterInvokeOptions(TypeInfo(ServiceSoap), ioDocument);

end. 
[/code]

yeni servis şu şekilde

Kod: Tümünü seç

// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : http://192.168.6.11/Mernis/Kps.svc?wsdl
// Encoding : utf-8
// Version  : 1.0
// (24.08.2011 16:07:59 - 1.33.2.5)
// ************************************************************************ //

unit Kps;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;

type

  // ************************************************************************ //
  // The following types, referred to in the WSDL document are not being represented
  // in this file. They are either aliases[@] of other types represented or were referred
  // to but never[!] declared in the document. The types from the latter category
  // typically map to predefined/known XML or Borland types; however, they could also 
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //
  // !:TcKimlikSorgula - "http://tempuri.org/"
  // !:TcKimlikSorgulaResponse - "http://tempuri.org/"
  // !:AdresSorgula    - "http://tempuri.org/"
  // !:AdresSorgulaResponse - "http://tempuri.org/"
  // !:CuzdanSorgula   - "http://tempuri.org/"
  // !:CuzdanSorgulaResponse - "http://tempuri.org/"


  // ************************************************************************ //
  // Namespace : http://tempuri.org/
  // soapAction: http://tempuri.org/IKps/%operationName%
  // transport : http://schemas.xmlsoap.org/soap/http
  // binding   : BasicHttpBinding_IKps
  // service   : Kps
  // port      : BasicHttpBinding_IKps
  // URL       : http://online/Mernis/Kps.svc
  // ************************************************************************ //
  IKps = interface(IInvokable)
  ['{58E8A5B6-BC21-E05A-C524-7AE11F257DFD}']
    function  TcKimlikSorgula(const parameters: TcKimlikSorgula): TcKimlikSorgulaResponse; stdcall;
    function  AdresSorgula(const parameters: AdresSorgula): AdresSorgulaResponse; stdcall;
    function  CuzdanSorgula(const parameters: CuzdanSorgula): CuzdanSorgulaResponse; stdcall;
  end;

function GetIKps(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): IKps;


implementation

function GetIKps(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): IKps;
const
  defWSDL = 'http://192.168.6.11/Mernis/Kps.svc?wsdl';
  defURL  = 'http://online/Mernis/Kps.svc';
  defSvc  = 'Kps';
  defPrt  = 'BasicHttpBinding_IKps';
var
  RIO: THTTPRIO;
begin
  Result := nil;
  if (Addr = '') then
  begin
    if UseWSDL then
      Addr := defWSDL
    else
      Addr := defURL;
  end;
  if HTTPRIO = nil then
    RIO := THTTPRIO.Create(nil)
  else
    RIO := HTTPRIO;
  try
    Result := (RIO as IKps);
    if UseWSDL then
    begin
      RIO.WSDLLocation := Addr;
      RIO.Service := defSvc;
      RIO.Port := defPrt;
    end else
      RIO.URL := Addr;
  finally
    if (Result = nil) and (HTTPRIO = nil) then
      RIO.Free;
  end;
end;


initialization
  InvRegistry.RegisterInterface(TypeInfo(IKps), 'http://tempuri.org/', 'utf-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(IKps), 'http://tempuri.org/IKps/%operationName%');
  InvRegistry.RegisterInvokeOptions(TypeInfo(IKps), ioLiteral);
  InvRegistry.RegisterInvokeOptions(TypeInfo(ServiceSoap), ioDocument);



verdiği hata tür tanımlaması hatası
orhancc
Üye
Mesajlar: 585
Kayıt: 24 Ağu 2010 02:14
Konum: İstanbul / Kadıköy
İletişim:

Re: svc uzantılı webservis

Mesaj gönderen orhancc »

SVC uzantısını .net WCF oluşturuyor. Visual Studio içerisinde direk eklenip kullanılabiliyor.
yusuf
Üye
Mesajlar: 139
Kayıt: 20 Tem 2005 11:05
Konum: İSTANBUL

Re: svc uzantılı webservis

Mesaj gönderen yusuf »

peki delphi7 de import edemiyormuyuz
orhancc
Üye
Mesajlar: 585
Kayıt: 24 Ağu 2010 02:14
Konum: İstanbul / Kadıköy
İletişim:

Re: svc uzantılı webservis

Mesaj gönderen orhancc »

Buraya bir bak uzunca anlatmışlar belki işini görür...

http://edn.embarcadero.com/article/36962
Kullanıcı avatarı
sadettinpolat
Moderator
Mesajlar: 2130
Kayıt: 07 Ara 2003 02:51
Konum: Ankara
İletişim:

Re: svc uzantılı webservis

Mesaj gönderen sadettinpolat »

https uzerinden servis sunulmaya baslanmis.
Delphi 2010 ile servis duzgun bir sekilde import edilemiyor. Nedeni wsdl in icerisinde atifta bulunulan xsd gibi sunucu uzerinde ki dosyalara wsdl importer erisemiyor. Bu dosyalar browser uzerinden gidilerek manuel olarak diske kaydedilip dosyalarda ki pathler diskte ki dosyalari gosterecek sekilde duzenlenirse import islemi yapilabilir.
"Sevmek, ne zaman vazgececegini bilmektir." dedi, bana.

---
http://sadettinpolat.blogspot.com/
fduman
Moderator
Mesajlar: 2749
Kayıt: 17 Ara 2004 12:02
Konum: Ankara

Re: svc uzantılı webservis

Mesaj gönderen fduman »

Kps yeni surumunde token based authentication kullanmaya basladi. Delphi 7 ile gerceklestirilebilir mi bilmiyorum. Ancak en alt seviyede soap xml yapisini kod ile olusturarak servis cagirilabilir. Bence daha kolayi, .net kullanilarak bir web service proxy hazirlanir (kps sitesinde. Net ile servisleri kullanma ornegi mevcut), Delphi 7 den bu proxy deki basic auth. destekleyen bir servis ile Kps kullanilabilir. Talep olursa alt seviye token destekli soap xml in hazirlanma yontemini aciklayabilirim.
Kullanıcı avatarı
lazymule
Üye
Mesajlar: 127
Kayıt: 16 Eki 2006 04:03
İletişim:

Re: svc uzantılı webservis

Mesaj gönderen lazymule »

@fduman
Talep olursa alt seviye token destekli soap xml in hazirlanma yontemini aciklayabilirim.
hocam vaktin varsa açıklarsan sevinirm sayende bizde öğreniriz.
Evrende Ulaşılamayacak Tepe Yoktur !!!!
Yeterki İnsan Ulaşmak İstesin !!!!
http://www.maxiteknik.com
yusuf
Üye
Mesajlar: 139
Kayıt: 20 Tem 2005 11:05
Konum: İSTANBUL

Re: svc uzantılı webservis

Mesaj gönderen yusuf »

Delphi2007 çare oluyo arkadaşlar
Kullanıcı avatarı
sadettinpolat
Moderator
Mesajlar: 2130
Kayıt: 07 Ara 2003 02:51
Konum: Ankara
İletişim:

Re: svc uzantılı webservis

Mesaj gönderen sadettinpolat »

Yeni KPS servisini Delphi XE2 dahil hicbir delphi surumu ile calistiramadim ben
"Sevmek, ne zaman vazgececegini bilmektir." dedi, bana.

---
http://sadettinpolat.blogspot.com/
fduman
Moderator
Mesajlar: 2749
Kayıt: 17 Ara 2004 12:02
Konum: Ankara

Re: svc uzantılı webservis

Mesaj gönderen fduman »

Dilim döndüğünce anlatmaya çalışacağım. Ancak üzgünüm, örnekler C# üstünden olacak. Ancak anlaşılmayacağını zannetmiyorum.

Burada önemli olan konular HMAC SHA-1 hesaplatmak ve XML canonicalize işlemleri. Bunları Delphi altında nasıl yaparsınız sizin araştırmanız gerekiyor (Google'da baktığımda birkaç bileşen gördüm). Önerklerde XML parsing ve XML oluşturma kısımları da olmayacak. Ben sadece mantığı anlatacağım.

Bunları denemek için KPSv2 sistemi veya test ortamına doğrudan erişiminiz ve yetkiniz olması gerekli. Sisteme IP kısıtlaması uygulanmakta ve kullanıcı adı/parola gerektirmekte.

https://kpsbasvuru.nvi.gov.tr/ adresinde sistemle ilgili teknik bilgiler mevcut. Kullanıcı adı ve parolanız da varsa örneklere (maalesef şu an için sadece .NET ve Java) ulaşabiliyorsunuz.

Sistem özetle, kullanıcı adı ve parolanızla https://kimlikdogrulama.nvi.gov.tr/serv ... IWSTrust13 adresindeki servisten "security token" alınıp, KPS istek mesajınız içerisine eklenerek, https://kpsv2.nvi.gov.tr/services/routingservice.svc adresindeki servis bacağına gönderilmesi ile çalışmakta. KPS servis bacağı sadece bir yönlendirme bacağı olduğundan buradan herhangi bir WSDL beklemeyin. Browser üzerinden ulaşmaya çalıştığınızda HTTP 400 hatası verecektir.

Öncelikle "kimlikdogrulama" servisinden, kullanıcı adı ve parolanızla, "Issue" metodunu çağırarak bir token isteyin. Servis burada iki Issue yöntemi destekler. Birisi WsTrust 1.3 standardı. Diğeri TrustFeb2005. Size, ekteki "STSResponse.xml" dosyasına benzer bir token dönmeli. Bu token 1 saat süre ile geçerlidir ve 1 saat süre içinde yaptığınız bütün KPS çağrılarında önbellekleyerek kullanabilirsiniz. Sürekli çağırarak token istemenize gerek yoktur!

Token'ımızı aldıktan sonra hesaplama işlemleri başlamakta. Burada KPS servisini çağırmak için gerekli olan XML'in elinizde olduğunu varsayıyorum.

- Kimlik doğrulamadan aldığımız token response içindeki “<trust:Binary Secret>” değeri alınır.

Kod: Tümünü seç

<trust:BinarySecret>iuSpOgUQ/CYKK43Rvjn58VpUnAPXw4hsjI/6ggipgBo=</trust:BinarySecret>
- Timestamp verisi önce canonicalize işlemine tabi tutulup, elde edilen değer, SHA1 ile hashlanir. Elde edilen değer Base64Encode edildiğinde “<DigestValue>” değeridir.

Kod: Tümünü seç

<u:Timestamp u:Id="_0"><u:Created>2011-01-25T08:20:02.054Z</u:Created><u:Expires>2011-01-25T08:25:02.054Z</u:Expires></u:Timestamp>
- <SignInfo> hazırlanır. <Reference URI="#_0"> değeri timestamp’in <u:Timestamp u:Id="_0"> değerine eşit olacak, digestvalue bir önceki maddede olduğu gibi setlenecek. Signature ve CanonicalizationMethod vs. değerleri setlenecek.

Kod: Tümünü seç

<SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/><Reference URI="#_0"><Transforms><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>LcOxmiRu6CqMcPN1E0+hQJ7Cogk=</DigestValue></Reference></SignedInfo>
- Bu yukarıdaki örneği, canonicalize işleminden geçirip, elde edilen değeri HMAC SHA-1 ‘e Binary Secret verilerek hash'i alınmalı ve base64 encode edilmelidir.
- Bütün bu işlemden sonra elimizde SignatureValue hazır oluyor ve bu signature değerini XML'de gerekli yere koymalıyız.

Yukarıda anlattığım işleri yapan örnek C# kodu:

Kod: Tümünü seç

using System;
using System.IO;
using System.Security.Cryptography;
using System.Security.Cryptography.Xml;
using System.Text;

namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            string referenceUri = "#_0";
            byte[] binarySecret = Convert.FromBase64String(@"iuSpOgUQ/CYKK43Rvjn58VpUnAPXw4hsjI/6ggipgBo=");

            byte[] timeStampCanonizedXml = GetCanonical("<u:Timestamp u:Id=\"_0\" xmlns:u=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><u:Created>2011-01-25T08:20:02.054Z</u:Created><u:Expires>2011-01-25T08:25:02.054Z</u:Expires></u:Timestamp>");
            SHA1 sha1 = SHA1Managed.Create();
            byte[] timestampDigest = sha1.ComputeHash(timeStampCanonizedXml);

            Console.WriteLine("Reference URI    : {0}", referenceUri);
            Console.WriteLine("Timestamp digest : {0}", Convert.ToBase64String(timestampDigest));
            Console.WriteLine("Binary secret    : {0}", Convert.ToBase64String(binarySecret));

            SignedInfo signedInfo = new SignedInfo();
            signedInfo.CanonicalizationMethod = SignedXml.XmlDsigExcC14NTransformUrl;
            signedInfo.SignatureMethod = SignedXml.XmlDsigHMACSHA1Url;

            Reference reference = new Reference();
            reference.DigestMethod = SignedXml.XmlDsigSHA1Url;
            reference.DigestValue = timestampDigest;
            reference.Uri = referenceUri;
            reference.TransformChain.Add(new XmlDsigExcC14NTransform());

            signedInfo.AddReference(reference);

            // Hack!!
            string signedInfoXml = signedInfo.GetXml().OuterXml.Replace(" />", "/>");

            byte[] signedInfoCanonizedXml = GetCanonical(signedInfoXml);

            HMACSHA1 hmac = new HMACSHA1(binarySecret, true);
            byte[] hmacResult = hmac.ComputeHash(signedInfoCanonizedXml);
            Console.WriteLine("Signature Value  : {0}", Convert.ToBase64String(hmacResult));
            Console.ReadLine();
            return;
        }

        static byte[] GetCanonical(string xmlData)
        {
            byte[] afterCanonBytes;
            XmlDsigExcC14NTransform c14n = new XmlDsigExcC14NTransform();
            byte[] xmlBytes = Encoding.UTF8.GetBytes(xmlData);
            using (MemoryStream beforeCanonicalization = new MemoryStream(xmlBytes))
            {
                c14n.LoadInput(beforeCanonicalization);
                Stream afterCanonicalization = c14n.GetOutput() as Stream;
                afterCanonBytes = new byte[afterCanonicalization.Length];
                afterCanonicalization.Read(afterCanonBytes, 0, (int)afterCanonicalization.Length);
            }

            return afterCanonBytes;
        }
    }
}
Bu işlemlerden sonra elimizde KPSRequest.XML'in benzeri olması gerekiyor. Eğer düzenleme yaptığımız kısımlar bire bir tutmazsa servis hata verecektir.

Dosyaları ekine ekleyemedim sanırım. Buraya atıyorum:

Kimlik doğrulama response: (STSResponse.XML, CipherValue kısaltıldı..)

Kod: Tümünü seç

<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://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTRC/IssueFinal</a:Action><a:RelatesTo>urn:uuid:f7e03134-cc3d-4ef3-b47d-b0b0a86289e6</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-01-25T08:18:56.267Z</u:Created><u:Expires>2011-01-25T08:23:56.267Z</u:Expires></u:Timestamp></o:Security></s:Header><s:Body><trust:RequestSecurityTokenResponseCollection xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512"><trust:RequestSecurityTokenResponse><trust:KeySize>256</trust:KeySize><trust:Lifetime><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2011-01-25T08:18:56.266Z</wsu:Created><wsu:Expires xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2011-01-25T13:18:56.266Z</wsu:Expires></trust:Lifetime><wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><a:EndpointReference><a:Address>https://kpsv2.nvi.gov.tr/services/routingservice.svc</a:Address></a:EndpointReference></wsp:AppliesTo><trust:RequestedSecurityToken><xenc:EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/><KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#"><e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/></e:EncryptionMethod><KeyInfo><o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><X509Data><X509IssuerSerial><X509IssuerName>C=TR, L=Ankara, O=Kale Yazilim San. ve Tic. Ltd. Sti., CN=Kale Yazilim Elektronik Sertifika Hizmetleri</X509IssuerName><X509SerialNumber>1033461495358811184</X509SerialNumber></X509IssuerSerial></X509Data></o:SecurityTokenReference></KeyInfo><e:CipherData><e:CipherValue>nVOBArld8FZcsTyf59J2AaFHPD97hZh/7khsXFpGwHocdfmELHb+k2CiqT/Con8WBn3xuhomNk6qxQHjqdH9A6e5z+PCLsAVaqdRN+EEiMvDsbYhHf4Lcaaze0L/vZmvgtrhipx4HzIPmwhtvMKBHtdQ88ulSlzxkktXqV73q3I=</e:CipherValue></e:CipherData></e:EncryptedKey></KeyInfo><xenc:CipherData><xenc:CipherValue>I9kO/y7LnObfqdMpbfNRSJu1ReJztJU5nugcKpz8skVSc3JaaY+..........</xenc:CipherValue></xenc:CipherData></xenc:EncryptedData></trust:RequestedSecurityToken><trust:RequestedProofToken><trust:BinarySecret>iuSpOgUQ/CYKK43Rvjn58VpUnAPXw4hsjI/6ggipgBo=</trust:BinarySecret></trust:RequestedProofToken><trust:RequestedAttachedReference><o:SecurityTokenReference k:TokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:k="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"><o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0#SAMLAssertionID">_6c0bb3f1-9074-4e8c-8765-e7e618d86570</o:KeyIdentifier></o:SecurityTokenReference></trust:RequestedAttachedReference><trust:RequestedUnattachedReference><o:SecurityTokenReference k:TokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:k="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"><o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0#SAMLAssertionID">_6c0bb3f1-9074-4e8c-8765-e7e618d86570</o:KeyIdentifier></o:SecurityTokenReference></trust:RequestedUnattachedReference><trust:TokenType>urn:oasis:names:tc:SAML:1.0:assertion</trust:TokenType><trust:RequestType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</trust:RequestType><trust:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/SymmetricKey</trust:KeyType></trust:RequestSecurityTokenResponse></trust:RequestSecurityTokenResponseCollection></s:Body></s:Envelope>
KPS Request: (KPSRequest.XML, içine token eklediğimiz ve SignatureValue hesapladığımız, CipherValue kısaltıldı..)

Kod: Tümünü seç

<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://kps.nvi.gov.tr/KisiSorgulaTCKimlikNoServis/ListeleCoklu</a:Action><a:MessageID>urn:uuid:03be9b19-4fb3-4096-97cd-3159de845376</a:MessageID><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo><VsDebuggerCausalityData xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink">uIDPo2thufruDdxDs2mQ3M8Scg8AAAAAnz8mpYsspkurOEpjYE6s6caoBkJ1c/NCgLwubx6lRFwACQAA</VsDebuggerCausalityData><a:To s:mustUnderstand="1">https://kpsv2.nvi.gov.tr/services/routingservice.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-01-25T08:20:02.054Z</u:Created><u:Expires>2011-01-25T08:25:02.054Z</u:Expires></u:Timestamp><xenc:EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/><KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#"><e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/></e:EncryptionMethod><KeyInfo><o:SecurityTokenReference><X509Data><X509IssuerSerial><X509IssuerName>C=TR, L=Ankara, O=Kale Yazilim San. ve Tic. Ltd. Sti., CN=Kale Yazilim Elektronik Sertifika Hizmetleri</X509IssuerName><X509SerialNumber>1033461495358811184</X509SerialNumber></X509IssuerSerial></X509Data></o:SecurityTokenReference></KeyInfo><e:CipherData><e:CipherValue>nVOBArld8FZcsTyf59J2AaFHPD97hZh/7khsXFpGwHocdfmELHb+k2CiqT/Con8WBn3xuhomNk6qxQHjqdH9A6e5z+PCLsAVaqdRN+EEiMvDsbYhHf4Lcaaze0L/vZmvgtrhipx4HzIPmwhtvMKBHtdQ88ulSlzxkktXqV73q3I=</e:CipherValue></e:CipherData></e:EncryptedKey></KeyInfo><xenc:CipherData><xenc:CipherValue>I9kO/y7LnObfqdMpbfNRSJu1ReJztJU5nugcKpz8skVSc3JaaY+...</xenc:CipherValue></xenc:CipherData></xenc:EncryptedData><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/><Reference URI="#_0"><Transforms><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>LcOxmiRu6CqMcPN1E0+hQJ7Cogk=</DigestValue></Reference></SignedInfo><SignatureValue>3NJrZzDKWVL2+tDpeIIyPR64Blo=</SignatureValue><KeyInfo><o:SecurityTokenReference k:TokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1" xmlns:k="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"><o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0#SAMLAssertionID">_6c0bb3f1-9074-4e8c-8765-e7e618d86570</o:KeyIdentifier></o:SecurityTokenReference></KeyInfo></Signature></o:Security></s:Header><s:Body><ListeleCoklu xmlns="http://kps.nvi.gov.tr"><criteriaList xmlns:b="http://schemas.datacontract.org/2004/07/Kps.Tipler" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><b:KisiSorgulaTCKimlikNoSorguKriteri><b:TCKimlikNo>10000000000</b:TCKimlikNo></b:KisiSorgulaTCKimlikNoSorguKriteri></criteriaList></ListeleCoklu></s:Body></s:Envelope>
Kullanıcı avatarı
sadettinpolat
Moderator
Mesajlar: 2130
Kayıt: 07 Ara 2003 02:51
Konum: Ankara
İletişim:

Re: svc uzantılı webservis

Mesaj gönderen sadettinpolat »

c#, WS-Addressing ve WS-Security standartlarini zaten destekliyor. C# ile neden boyle uzun bir yol tercih ettin ?

Delphi ise yukaridaki bu standartlari desteklemiyor.
https://forums.embarcadero.com/message. ... 7&tstart=0
"Sevmek, ne zaman vazgececegini bilmektir." dedi, bana.

---
http://sadettinpolat.blogspot.com/
Kullanıcı avatarı
Rew33
Üye
Mesajlar: 70
Kayıt: 10 Tem 2009 02:28

Re: svc uzantılı webservis

Mesaj gönderen Rew33 »

ben xe kullanıyorum,mevcut yeni servisleri delphiye import etmiştim ama kullanıcı adı ve şifresini gönderebileceğim bir metod bulamamıştım,birde Windows Identity Foundation dll'ini referans olarak istiyor.işler bu derece karışık olunca visual studio ile bir dll yazıp delphiden bu dll yi kullanmak inanın daha kolay.
Kimseye hiçbir şey öğretemem, sadece onların düşünmelerini sağlayabilirim.
SOKRATES
fduman
Moderator
Mesajlar: 2749
Kayıt: 17 Ara 2004 12:02
Konum: Ankara

Re: svc uzantılı webservis

Mesaj gönderen fduman »

sadettinpolat yazdı:c#, WS-Addressing ve WS-Security standartlarini zaten destekliyor. C# ile neden boyle uzun bir yol tercih ettin ?
C#'da zaten bunlara ihtiyaç yok. Bunu Python, PHP, Delphi vs. de bu standartları framework'ünde desteklemeyen diller için yazdım.
fduman
Moderator
Mesajlar: 2749
Kayıt: 17 Ara 2004 12:02
Konum: Ankara

Re: svc uzantılı webservis

Mesaj gönderen fduman »

Rew33 yazdı:ben xe kullanıyorum,mevcut yeni servisleri delphiye import etmiştim ama kullanıcı adı ve şifresini gönderebileceğim bir metod bulamamıştım,birde Windows Identity Foundation dll'ini referans olarak istiyor.işler bu derece karışık olunca visual studio ile bir dll yazıp delphiden bu dll yi kullanmak inanın daha kolay.
.NET ile oluşturmak ilk başta dediğim gibi çok kolay. Eğer anlattığım şekilde doğal olarak desteklemek istemiyorsanız. .NET ile bir web proxy hazırlayıp daha kolay kullanabilirsiniz.
Kullanıcı avatarı
Rew33
Üye
Mesajlar: 70
Kayıt: 10 Tem 2009 02:28

Re: svc uzantılı webservis

Mesaj gönderen Rew33 »

fduman yazdı:
Rew33 yazdı:ben xe kullanıyorum,mevcut yeni servisleri delphiye import etmiştim ama kullanıcı adı ve şifresini gönderebileceğim bir metod bulamamıştım,birde Windows Identity Foundation dll'ini referans olarak istiyor.işler bu derece karışık olunca visual studio ile bir dll yazıp delphiden bu dll yi kullanmak inanın daha kolay.
.NET ile oluşturmak ilk başta dediğim gibi çok kolay. Eğer anlattığım şekilde doğal olarak desteklemek istemiyorsanız. .NET ile bir web proxy hazırlayıp daha kolay kullanabilirsiniz.
ben sizin dediklerinize aynen katılıyorum.eğer zamanınız yoksa boşuna delphi ile uğraşmayın, visual studio ile daha hızlı sürede projeyi bitiriyorsunuz,sadece bunu vurgulamak istedim.boş bir zamanımda delphi ile tekrar deneyeceğim, zamınınız yoksa delphi ile uğraşmaya değmez.
Kimseye hiçbir şey öğretemem, sadece onların düşünmelerini sağlayabilirim.
SOKRATES
Cevapla