![]() |
Problem SOAP WebService "Invalid property element: 1&qu
Liste der Anhänge anzeigen (Anzahl: 1)
Hallöchen Community,
ich bräuchte mal wieder eure Hilfe bei einem Problem. Ich hab mir per PHP einen SOAP Webservice gebastelt und mir eine .wsdl selber erstellt. Wenn ich den Dienst mit der einen Function von einem PHP Client aufrufe ist alles korrekt und gibt alles richtig aus. Importiere ich die .wsdl Datei in delphi2005 und versuche dann auf das übergebene Array zuzugreifen kommt der Fehler Inavlid property element: 1. Ich selbst kann leider nichts entdecken, vielleicht könnt Ihr mir weiterhelfen.
Delphi-Quellcode:
Ich habe mich an der .wsdl Datei von Auctionweb orientiert, daher stehen dort noch die Auctionweb namen alles wichtige wie Namespace ... habe ich natürlich angepasst.
unit testserver;
interface uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns; type open_transaction = class; { "http://localhost/" } // ************************************************************************ // // Namespace : [url]http://localhost/[/url] // ************************************************************************ // open_transaction = class(TRemotable) private Fstatus: Boolean; Fnumber: Integer; Ftext: WideString; published property status: Boolean read Fstatus write Fstatus; property number: Integer read Fnumber write Fnumber; property text: WideString read Ftext write Ftext; end; open_transaction_array = array of open_transaction; { "http://localhost/" } AuctionWeb_WSPortType = interface(IInvokable) ['{8598A2F8-7696-EDA6-098A-72E1D099A7B4}'] function getOpenTransaction(const number_request: Integer): open_transaction_array; stdcall; end; function GetAuctionWeb_WSPortType(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): AuctionWeb_WSPortType; implementation function GetAuctionWeb_WSPortType(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): AuctionWeb_WSPortType; const defWSDL = 'http://localhost/NETshop-1/soap.wsdl'; defURL = 'http://localhost/NETshop-1/server.php'; defSvc = 'AuctionWeb-WS'; defPrt = 'AuctionWeb-WSPort'; 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 AuctionWeb_WSPortType); 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; initialization InvRegistry.RegisterInterface(TypeInfo(AuctionWeb_WSPortType), 'http://localhost/', 'ISO-8859-1', '', 'AuctionWeb-WSPortType'); InvRegistry.RegisterDefaultSOAPAction(TypeInfo(AuctionWeb_WSPortType), 'http://localhost/NETshop-1/server.php'); RemClassRegistry.RegisterXSClass(open_transaction, 'http://localhost/', 'open_transaction'); RemClassRegistry.RegisterXSInfo(TypeInfo(open_transaction_array), 'http://localhost/', 'open_transaction_array'); end. Eigentlich sollte ich folgendes Array erhalten array[0]['status'] = true; array[0]['number'] = 12; array[0]['text'] = 'Irgendwas sinnloses'; So greife ich darauf zu.
Delphi-Quellcode:
Wenn ich z.B. den Arrayteil 'status' im SOAP Server nicht mit eintrage, meckert Delphi das der 'status' fehlt genau so bei 'number' und 'text'. Daher gehe ich einmal davon aus, dass das Array bekommt und damit arbeiten kann. Vielleicht greife ich nur falsch darauf zu.
ShowMessage(GetAuctionWeb_WSPortType(true).getOpenTransaction(10)[0].text);
Bin für jede noch so kleine Hilfe dankbar. Anbei noch die .wsdl Datei, falls es jemanden interessiert. Aber da mein PHP Client alles richtig macht, sollte die eigentlich stimmen. MfG Primusio |
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:42 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