Einzelnen Beitrag anzeigen

luc.lacroix

Registriert seit: 17. Jan 2012
Ort: Luxembourg
4 Beiträge
 
Delphi 10.3 Rio
 
#1

Soap EDomParseError 'Only one top level'

  Alt 29. Jul 2020, 09:59
Hallo,

ich versuche einen soap service zu benützen.

Hier ist ein teil von der wsdl generiert datei :
Delphi-Quellcode:
  // ************************************************************************ //
  // Namespace : urn:qs-stadat
  // transport : http://schemas.xmlsoap.org/soap/http
  // style : rpc
  // use : encoded
  // binding : rpcrouterSoapBinding
  // service : QSv2MsgProcessorService
  // port : rpcrouter
  // URL : http://www.qs-plattform.de/axis/services/rpcrouter
  // ************************************************************************ //
  QSv2MsgProcessor = interface(IInvokable)
  ['{EDBD273B-FDF7-0127-4901-233D0EA6904F}']
    function selectStandard(const in0: QSExtLocationBtartStandardQuery): QSExtLocationBtartQueryStandardReply; overload; stdcall;
    function selectStandard(const in0: QSExtLocationStandardQuery): QSExtLocationQueryStandardReply; overload; stdcall;
    function select(const in0: QSExtLocationBtartQuery): QSExtLocationBtartQueryReply; overload; stdcall;
    function select(const in0: QSExtLocationQuery): QSExtLocationQueryReply; overload; stdcall;
    function select(const in0: QSExtLocationStandardQuery): QSExtLocationFreeRangeQueryReply; overload; stdcall;
    function selectQSTW(const in0: QSExtLocationStandardQuery): QSExtLocationQSTWReply; stdcall;
  end;

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


implementation
  uses SysUtils;

function GetQSv2MsgProcessor(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): QSv2MsgProcessor;
const
  defWSDL = 'https://www.qs-plattform.de/axis/services/rpcrouter?wsdl';
  defURL = 'http://www.qs-plattform.de/axis/services/rpcrouter';
  defSvc = 'QSv2MsgProcessorService';
  defPrt = 'rpcrouter';
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 QSv2MsgProcessor);
    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;
Hier ist mein code zum testen :
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
  service: QSv2MsgProcessor;
  query: QSExtLocationBtartStandardQuery;
  response: QSExtLocationBtartQueryStandardReply;
begin
  service := GetQSv2MsgProcessor(True);
  query := QSExtLocationBtartStandardQuery.Create;
  try
    query.locationId := Edit1.Text;
    query.btartId := StrToInt(Edit2.Text);
    try
      response := nil;
      response := service.selectStandard(query); // <----- JETZT PASSIERT DEN FEHLER
      Edit4.Text := response.certifiedLocation.ToString;
    except
      Edit4.Text := 'ERROR';
    end;
  finally
    query.Free;
  end;
end;
Und hier ist das felhler dialogbox.
Code:
---------------------------
Debugger Exception Notification
---------------------------
Project testQS.exe raised exception class EDOMParseError with message 'Only one top level element is allowed in an XML document.

Line: 2
<p>Hi there, this is an AXIS service!</p'.
Ich hab schon viel auf google gesucht, aber nichts gefunden.

Ich danke euch im voraus, und sorry for my poor German

Luc.
Luc Lacroix
  Mit Zitat antworten Zitat