![]() |
Delphi-Version: 7
HTTPRio + SSL
Guten Morgen miteinander,
ich versuche mich zur Zeit daran ein Soap Client (Hermes) zu erstellen. Jedoch erhalte ich immer eine Fehler Meldung: An error ocurred in the secure channel support - URL: ![]() Muss man bzgl. SSL und HTTPRio noch zusätzlich etwas einstellen? Ich erhalte vom Server keine Antwort, also muss das Problem ja schon bei mir hängen :? Schöne Grüße |
AW: HTTPRio + SSL
Zitat:
|
AW: HTTPRio + SSL
Hi,
schonmal Danke für die Antwort.
Code:
Den Request setze ich bei BeforeExecute manuell zusammen, da Delphi mir ansonsten den Header nie vernünftig hinzugefügt hat:
if not assigned(HTTPRio1_Stream) then
begin HTTPRio1_Stream := THTTPRio_Stream.Create(versandBrwFrm); end; HTTPRio1_Stream.WSDLLocation := 'C:\Dokumente und Einstellungen\user\Desktop\PriPS.xml'; HTTPRio1_Stream.Port := 'PriPSPort'; HTTPRio1_Stream.Service := 'PriPSService'; HTTPRio1_Stream.OnBeforeExecute := HTTPRIO1_StreamBeforeExecute; HTTPRio1_Stream.OnAfterExecute := HTTPRIO1_StreamAfterExecute; Service := HermesPriPS.GetPriPS(True,'',HTTPRio1_Stream); hdr := verifyingToken.Create; hdr.UserID := 'XXX'; hdr.UserPW := 'XXX'; HTTPRio1_Stream.SOAPHeaders.SetOwnsSentHeaders(true); HTTPRio1_Stream.SOAPHeaders.Send(hdr); Service.pripsCheckAvailability();
Code:
Der Request sieht auch meiner Meinung nach richtig aus, der ähnliche Weg funktioniert an anderer Stelle auch, nur hier isr keine SSL verschlüsselung vorhanden.
try
UebXml := TXMLDocument.Create(nil); UebXml.Active := True; UebXml.Version := '1.0'; UebXml.Encoding := 'UTF-8'; UebXml.Options := UebXml.Options + [doNodeAutoIndent]; UebXml.DocumentElement := UebXml.CreateNode('soapenv:Envelope', ntElement, ''); UebXml.DocumentElement.Attributes['xmlns:soapenv'] := 'http://schemas.xmlsoap.org/soap/envelope/'; UebXml.DocumentElement.Attributes['xmlns:wsse'] := 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd'; UebXml.DocumentElement.Attributes['xmlns:wsu'] := 'http://docs.oasisopen.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'; lXmlNode := UebXml.DocumentElement.AddChild('soapenv:Header').AddChild('wsse:Security'); lXmlNode.Attributes['soapenv:mustUnderstand'] := '1'; // lXmlNode.Attributes['xmlns:wsse'] := 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd'; // lXmlNode.Attributes['xmlns:wsu'] := 'http://docs.oasisopen.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'; lXmlNode := lXmlNode.AddChild('wsse:UsernameToken'); lXmlNode.Attributes['wsu:Id'] := 'UsernameToken-102'; lXmlNode.AddChild('wsse:Username').NodeValue := 'XXX'; lXmlNode := lXmlNode.AddChild('wsse:Password'); lXmlNode.Attributes['Type'] := 'http://docs.oasisopen.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'; lXmlNode.NodeValue := 'XXX'; lXmlNode := UebXml.DocumentElement.AddChild('soapenv:Body').AddChild('pripsCheckAvailability'); SOAPRequest.Size := 0; SOAPRequest.Position := 0; UebXml.Active := True; UebXml.Active := True; UebXml.SaveToStream(SOAPRequest); finally if assigned(UebXml) then begin UebXml.Active := false; UebXml := nil; end; end;
Code:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasisopen.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <soapenv:Header> <wsse:Security soapenv:mustUnderstand="1"> <wsse:UsernameToken wsu:Id="UsernameToken-102"> <wsse:Username>xxx</wsse:Username> <wsse:Password Type="http://docs.oasisopen.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxx</wsse:Password> </wsse:UsernameToken> </wsse:Security> </soapenv:Header> <soapenv:Body> <soapenv:pripsCheckAvailability/> </soapenv:Body> </soapenv:Envelope> |
AW: HTTPRio + SSL
Deine Anfrage ist auch richtig, konnte sie gerade ohne Probleme an
![]() |
AW: HTTPRio + SSL
In der WSDL-Datei ist https angegeben:
Code:
Importiert wurde diese auch korrekt:
<wsdl:service name="PriPSService">
<wsdl:port binding="tns:PriPSServiceSoapBinding" name="PriPSPort"> <soap:address location="https://hermesapisbx.hlg.de/hermes-api-prips-web/services/v15/PriPS"/> </wsdl:port> </wsdl:service>
Code:
Kann ich bei BeforeExecute nochmal prüfen, welche URL nun wirklich angeprochen wird?
function GetPriPS(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): PriPS;
const defWSDL = 'C:\Dokumente und Einstellungen\user\Desktop\PriPS.xml'; defURL = 'https://hermesapisbx.hlg.de/hermes-api-prips-web/services/v15/PriPS'; defSvc = 'PriPSService'; defPrt = 'PriPSPort'; var |
AW: HTTPRio + SSL
Ich hab das ganze schnell selber importiert und es geht ohne Probleme. Einfach WSDL-Import Wizard durchlaufen lassen.
Code:
Mit der Antwort
HTTPRio := THTTPRIO.Create(nil);
HTTPRio.OnBeforeExecute := BeforeExecute; HTTPRio.OnAfterExecute:= AfterExecute; FPriPS := GetPriPS(true,'',HTTPRio); FPriPS.pripsCheckAvailability;
Code:
Wo du jetzt die Zieladresse auslesen kannst weiß ich nicht, ich verwende dafür immer Wireshark, die ungeschönte Wahrheit.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Fault occurred while processing.</faultstring> <detail> <ns3:SecurityException xmlns:ns3="http://exception.common.service.hlg.de" xmlns:ns2="http://hermes_api.service.hlg.de"> <exceptionItems> <errorMessage>Die Consumer Authentifizierung ist fehlerhaft.</errorMessage> <errorCode>310023</errorCode> <errorType>B</errorType> </exceptionItems> </ns3:SecurityException> </detail> </soap:Fault> </soap:Body> </soap:Envelope> |
AW: HTTPRio + SSL
Wirklich noch Delphi 7?
AFAIK sind in dieser sehr alten Version noch einige (mehr) Mängel in der Implementierung vorhanden die in neueren Versionen schon gefixt wurden. |
AW: HTTPRio + SSL
Hi,
ja siehste mal, manche leben halt noch gern in der Vergangenheit:? Habe es nun mal auf einem anderen PC versucht -> kein WinXP:shock: Nun erhalte ich auch ein Response -> Zwar mit der Meldung
Code:
aber das ist ja schonmal ein Anfang.
<errorMessage>Die Consumer Authentifizierung ist fehlerhaft.</errorMessage>
<errorCode>310023</errorCode> <errorType>B</errorType> |
AW: HTTPRio + SSL
Zitat:
Da müsstest du schon ein Komponenten verwenden (ipworks?) welche alle modernen noch als sicher angesehen Verschlüsselungsmethoden selbst mitbringt. |
AW: HTTPRio + SSL
Soweit ich es überblicke bietet Hermes auch direkt einen REST Service an und da du bereits die halbe SOAP Message selber aufbaust, sehe ich keinen Sinn dahinter weiter auf SOAP zu setzen. Besser du verwendest REST über einen http Client. Wenn Delphi 7 die indy Komponenten nicht mitausliefert, kannst du die Nachinstallieren, das könnte auch die TLS Probleme gleich mitlösen.
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:15 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz