Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Soap EDomParseError 'Only one top level' (https://www.delphipraxis.net/205072-soap-edomparseerror-only-one-top-level.html)

luc.lacroix 29. Jul 2020 09:59

Soap EDomParseError 'Only one top level'
 
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 :wink:

Luc.

luc.lacroix 29. Jul 2020 10:23

AW: Soap EDomParseError 'Only one top level'
 
Delphi XE5

TiGü 29. Jul 2020 10:48

AW: Soap EDomParseError 'Only one top level'
 
Have you tried to open the URL in a normal browser?
https://www.qs-plattform.de//axis/services/rpcrouter

Zitat:

rpcrouter
Hi there, this is an AXIS service!

Perhaps there will be a form for invoking the service here...
Maybe the service is offline? Please contact the service provider for more information.

luc.lacroix 29. Jul 2020 14:29

AW: Soap EDomParseError 'Only one top level'
 
Hallo,

ja, ich hab es gemacht, und kommt so was :

Zitat:

rpcrouter
Hi there, this is an AXIS service!

Perhaps there will be a form for invoking the service here...

TiGü 29. Jul 2020 14:58

AW: Soap EDomParseError 'Only one top level'
 
Je suppose que vous parlez français ?

Je sais que cette nouvelle arrive, je l'ai fait citer dans mon post.
Il semble que le service web soit en panne en ce moment. La faute n'est donc pas de votre fait.

luc.lacroix 29. Jul 2020 19:36

AW: Soap EDomParseError 'Only one top level'
 
Vielen Dank Tigü ;-)

Merci beaucoup.


Alle Zeitangaben in WEZ +1. Es ist jetzt 16: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