![]() |
|
Soap Web Service - Baskı Önizleme +- Delphi Can (https://www.delphican.com) +-- Forum: Delphi (https://www.delphican.com/forumdisplay.php?fid=3) +--- Forum: Genel Programlama (https://www.delphican.com/forumdisplay.php?fid=6) +--- Konu Başlığı: Soap Web Service (/showthread.php?tid=5900) |
Soap Web Service - abdullahBuyuk - 09-04-2021 Merhaba; Bir web servise bağlanmaya çalışıyorum. SoapUi ile başarılı bağlandım. Fakat SoapUI de yaptığım işlemleri Delphi de kodlayamıyorum. Aşağıdaki alıntı da SoapUI arayüzünde; oturum bilgilerinin properties olarak girildiğini ve servis metodunun aldığı parametreleri paylaşıyorum. [attachment=1714] Servis dökümanında security header aşağıdaki bloktaki gibi verilmiş. Kod: <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">Header bölümünü aşabilirsem servis metodunu kullanabilirim. Daha önce erişim sağladığım soap servislerden birinde HttpRio ile headers'a oturum bilgileri girerek bağlanabilmiştim. HttpRio := THTTPRIO.Create(self); HttpRio.HTTPWebNode.UserName := 'KULLANICI_ADI'; HttpRio.HTTPWebNode.Password := 'SIFRE'; Service :=WsService(False, '', HttpRio); Ama yukarıda paylaştığım servis için 'Nonce' ve 'Created' değerlerini httprio ile nasıl girebilirim? Veya bağlanmak için başka nasıl bir yol izleyebilirim? Yardımlarınızı rica ediyorum. Soap Web Service - mkysoft - 09-04-2021 HttpRio.HTTPWebNode uzerine atadiginiz kullanici adi / sifre Basic Authentication icin kullanilir. Paylastiginiz servis WSSE kullaniyor. WSSE'nin de bir cok turu var. HttpRio WSSE destekliyormu emin degilim. Surada daha once bir soruya cevap vermek icin epttavm icin WSSE ornegini hazirlamistim, bir inceleyin isterseniz. Cvp: Soap Web Service - umitsahin - 17-11-2021 (09-04-2021, Saat: 19:09)Bu konuda daha geniş kullanım örneği verebilirmisiniz mkysoft Adlı Kullanıcıdan Alıntı: HttpRio.HTTPWebNode uzerine atadiginiz kullanici adi / sifre Basic Authentication icin kullanilir. Paylastiginiz servis WSSE kullaniyor. WSSE'nin de bir cok turu var. HttpRio WSSE destekliyormu emin degilim. Surada daha once bir soruya cevap vermek icin epttavm icin WSSE ornegini hazirlamistim, bir inceleyin isterseniz. Soap Web Service - enigma - 17-11-2021 HttpReqResp komponetini kullanın. ÖRNEK: var Stream: TMemoryStream; StrStream: TStringStream; s: string; Stream := TMemoryStream.Create; StrStream := Tstringstream.Create(s); try HTTPReqResp1.InvokeOptions := [soIgnoreInvalidCerts]; HTTPReqresp1.URL := 'http://SREPSAPCL02.elifplastik.local:8001/sap/bc/srt/rfc/sap/zpp_ws_promosyon_kodu/300/zpp_ws_promosyon_kodu/zpp_ws_promosyon_kodu_binding'; HTTPReqResp1.ReceiveTimeout := 100000; HTTPReqResp1.UseUTF8InHeader := true; HTTPReqResp1.SoapAction := soap; HTTPReqResp1.UserName := Edit3.Text; // HTTPReqresp1.Password := Edit4.Text; // HTTPReqResp1.ConnectTimeout := 90000; T1 := Now; HTTPReqresp1.Execute(UTF8Encode(Memo1.Text), Stream); try StrStream.CopyFrom(Stream, 0); mmo2.Text := UTF8Decode(XMLDoc.FormatXMLData(StrStream.DataString)); // Cevap mmo2 alanına dönüyor. finally StrStream.Free; end; finally Stream.Destroy; end; Soap Web Service - enigma - 17-11-2021 Belirtmeyi unutmuşum, Memo1 alanına request olan XML verisini atayacaksınız. yani en baştaki ekrandaki SoapUI'deki istek XML'ini. Buaradaki HTTPReqresp1.Execute(UTF8Encode(Memo1.Text), Stream); komut ile isteği göndermiş oluyorsunuz. Akabinde, Stream içine cevam dönüyor. gelen cevabı da mmo2.text alanına atıyoruz. mmo2.Text := UTF8Decode(XMLDoc.FormatXMLData(StrStream.DataString)); |