![]() |
SOAP Zeichen wird maskiert
Hallo,
ich beginne grade, mich in die Problematik SOAP und XML einzuarbeiten. Als erstes möchte ich einen Client schreiben, der in einem SOAP Request ein XML Dokument sendet. Die aus der WSDL gernierte unit sieht in etwa so aus:
Delphi-Quellcode:
Die Funktion GetInfo erwartet als Parameter ein XML Dokument. Dummerweise werden beim Transport zum Server die "<" als %lt; übertragen - in Wireshark sieht der Aufruf "getinfo(<1003>)" dann so aus:
type
xmlRequestDoc = type WideString; GetInfoResult = type WideString; pStrDialogID = type WideString; GetDialogRequestDocumentResult = type WideString; SetInfoResult = type WideString; CoreManagementSoap = interface(IInvokable) [...] // Entpackung nicht möglich: // - Name des Eingabeelement-Wrappers entspricht nicht dem Operationsnamen // - Das Ausgabe-Part ist kein komplexer Typ function GetInfo(const xmlRequestDoc: xmlRequestDoc): GetInfoResult; stdcall; [...] end; function GetCoreManagementSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): CoreManagementSoap; implementation uses SysUtils; function GetCoreManagementSoap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): CoreManagementSoap; const defWSDL = 'C:\...\core.wsdl'; defURL = 'http://.../index.asmx'; defSvc = 'CoreManagement'; defPrt = 'CoreManagementSoap'; 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 CoreManagementSoap); if UseWSDL then begin RIO.WSDLLocation := Addr; RIO.Service := defSvc; RIO.Port := defPrt; RIO.HTTPWebNode.UserName:='xxxx'; RIO.HTTPWebNode.Password:='yyyyy'; end else RIO.URL := Addr; finally if (Result = nil) and (HTTPRIO = nil) then RIO.Free; end; end;
Delphi-Quellcode:
Ich vermute nun, dass der Server wegen der fehlenden spitzen Klammern den Input nicht als XML erkennt.
<?xml
version="1.0" ?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <SOAP-ENV:xmlRequestDoc> <1003> </SOAP-ENV:xmlRequestDoc> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Kann ich irgendwo etwas einstellen, dass die Zeichen nicht maskiert werden? Danke schonmal Thomasch |
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:44 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