Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   XML (https://www.delphipraxis.net/46-xml/)
-   -   Delphi SOAP Zeichen wird maskiert (https://www.delphipraxis.net/117405-soap-zeichen-wird-maskiert.html)

thomasch 17. Jul 2008 16:06


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:
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;
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:

Delphi-Quellcode:
<?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>
      &lt;1003&gt;
    </SOAP-ENV:xmlRequestDoc>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Ich vermute nun, dass der Server wegen der fehlenden spitzen Klammern den Input nicht als XML erkennt.

Kann ich irgendwo etwas einstellen, dass die Zeichen nicht maskiert werden?


Danke schonmal

Thomasch


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:24 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz