AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Problem SOAP WebService "Invalid property element: 1"
Thema durchsuchen
Ansicht
Themen-Optionen

Problem SOAP WebService "Invalid property element: 1"

Ein Thema von primusio · begonnen am 10. Sep 2005
Antwort Antwort
primusio

Registriert seit: 31. Jan 2004
19 Beiträge
 
#1

Problem SOAP WebService "Invalid property element: 1&qu

  Alt 10. Sep 2005, 11:47
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:
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.
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.

Eigentlich sollte ich folgendes Array erhalten
array[0]['status'] = true;
array[0]['number'] = 12;
array[0]['text'] = 'Irgendwas sinnloses';

So greife ich darauf zu.
ShowMessage(GetAuctionWeb_WSPortType(true).getOpenTransaction(10)[0].text); 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.

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
Angehängte Dateien
Dateityp: txt soap_210.txt (2,3 KB, 5x aufgerufen)
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:50 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