WSDL - HTTP Fehler 406 - Verzweifle :(
-
Hallo zusammen!
Ich möchte mir für den WebService FootieFox einen eigenen Client bauen ...
Die WSDL datei liegt hier:
http://www9.hpi-web.de/footiefox/service.wsdl
Die WSDL habe ich bereits importiert!
Wenn ich jedoch irgendeine Methode aufrufe, bekomme ich eine exception mit dem HTTP Fehler 406 ...
Ich Programmiere eigentlich C++ (Borland C++), habs jetzt aber auch mal auf Delphi 7 Probiert, jedoch bei beiden der selbe Fehler ...
Wäre für eure Hilfe SUUUUUPER Dankbar!!
DANKE!
Hier der Aufruf:
void __fastcall TForm1::Button1Click(TObject *Sender) { _di_FootiefoxFootiefoxPort ffp; ffp = GetFootiefoxFootiefoxPort(true); ffp->Login(); TIntegerDynArray updateLeagues; updateLeagues.set_length(1); updateLeagues.operator [](0) = 4000; MatchDiffWSArray leagues = ffp->UpdateLeagues(updateLeagues); for (int i = 0; i < leagues.Length; i++) { ShowMessage(leagues.operator [](i)->matchId); } }
-
Die Funktionen scheinen die angegebene URL nicht zu akzeptieren.
Was soll eigentlich dieses operator[]()-Gewurschtel. Schreib da doch z.Bsp. einfach leagues[i]
-
Hi!
Komischerweise funktioniert [] nicht immer ...
Wie meinst du er akzeptiert die Url nicht?
Hier mal die service.cpp
// ************************************************************************ // // Die in dieser Datei deklarierten Typen wurden aus Daten generiert, die aus // unten beschriebener WSDL-Datei stammen: // WSDL : C:\Dokumente und Einstellungen\admmairph\Desktop\footiefox\service.wsdl // Codieren : UTF-8 // Codegen : [wfDebug,wfVerbose,wfSkipHttpBindings,wfSkipUnusedTypes] // Version : 1.0 // (21.06.2006 12:14:35 - $Revision: 1.0.1.0.1.82 $) // ************************************************************************ // #include <vcl.h> #pragma hdrstop #if !defined(serviceH) #include "service.h" #endif namespace NS_service { _di_FootiefoxFootiefoxPort GetFootiefoxFootiefoxPort(bool useWSDL, AnsiString addr) { static const char* defWSDL= "service.wsdl"; static const char* defURL = "http://www9.hpi.uni-potsdam.de/"; static const char* defSvc = "FootiefoxService"; static const char* defPrt = "FootiefoxFootiefoxPort"; if (addr=="") addr = useWSDL ? defWSDL : defURL; THTTPRIO* rio = new THTTPRIO(0); rio->HTTPWebNode->UseUTF8InHeader = true; rio->HTTPWebNode->Agent = "Firefox/1.5.0.4"; if (useWSDL) { rio->WSDLLocation = addr; rio->Service = defSvc; rio->Port = defPrt; } else { rio->URL = addr; } _di_FootiefoxFootiefoxPort service; rio->QueryInterface(service); if (!service) delete rio; return service; } __fastcall MessageWS::~MessageWS() { delete Ftime; } __fastcall MatchWS::~MatchWS() { delete FstartTime; } __fastcall LeagueWS::~LeagueWS() { delete Ftimestamp; for(int i=0; i<Fmatches.Length; i++) if (Fmatches[i]) delete Fmatches[i]; } __fastcall LoginPackageWS::~LoginPackageWS() { delete FteamsListTimestamp; delete FleaguesListTimestamp; for(int i=0; i<Fmessages.Length; i++) if (Fmessages[i]) delete Fmessages[i]; for(int i=0; i<Fleagues.Length; i++) if (Fleagues[i]) delete Fleagues[i]; } // ************************************************************************ // // Diese Routine registriert die Interfaces und Typen, die vom // SOAP-Service aufgerufen werden. // ************************************************************************ // static void RegTypes() { /* FootiefoxFootiefoxPort */ InvRegistry()->RegisterInterface(__interfaceTypeinfo(FootiefoxFootiefoxPort), L"urn:ActionWebService", L"UTF-8"); InvRegistry()->RegisterDefaultSOAPAction(__interfaceTypeinfo(FootiefoxFootiefoxPort), L"/footiefox/api/%operationName%"); RemClassRegistry()->RegisterXSInfo(__arrayTypeinfo(DateTimeArray), L"urn:ActionWebService", L"DateTimeArray"); /* MessageWS */ RemClassRegistry()->RegisterXSClass(__classid(MessageWS), L"urn:ActionWebService", L"MessageWS"); RemClassRegistry()->RegisterXSInfo(__arrayTypeinfo(MessageWSArray), L"urn:ActionWebService", L"MessageWSArray"); /* MatchWS */ RemClassRegistry()->RegisterXSClass(__classid(MatchWS), L"urn:ActionWebService", L"MatchWS"); /* MatchDiffWS */ RemClassRegistry()->RegisterXSClass(__classid(MatchDiffWS), L"urn:ActionWebService", L"MatchDiffWS"); RemClassRegistry()->RegisterXSInfo(__arrayTypeinfo(MatchDiffWSArray), L"urn:ActionWebService", L"MatchDiffWSArray"); RemClassRegistry()->RegisterXSInfo(__arrayTypeinfo(IntegerArray), L"urn:ActionWebService", L"IntegerArray"); RemClassRegistry()->RegisterXSInfo(__arrayTypeinfo(MatchWSArray), L"urn:ActionWebService", L"MatchWSArray"); /* LeagueWS */ RemClassRegistry()->RegisterXSClass(__classid(LeagueWS), L"urn:ActionWebService", L"LeagueWS"); RemClassRegistry()->RegisterXSInfo(__arrayTypeinfo(LeagueWSArray), L"urn:ActionWebService", L"LeagueWSArray"); /* LoginPackageWS */ RemClassRegistry()->RegisterXSClass(__classid(LoginPackageWS), L"urn:ActionWebService", L"LoginPackageWS"); } #pragma startup RegTypes 32 }; // NS_serviceund hier die service.h
// ************************************************************************ // // Die in dieser Datei deklarierten Typen wurden aus Daten generiert, die aus // unten beschriebener WSDL-Datei stammen: // WSDL : C:\Dokumente und Einstellungen\admmairph\Desktop\footiefox\service.wsdl // Codieren : UTF-8 // Codegen : [wfDebug,wfVerbose,wfSkipHttpBindings,wfSkipUnusedTypes] // Version : 1.0 // (21.06.2006 12:14:35 - $Revision: 1.0.1.0.1.82 $) // ************************************************************************ // #ifndef serviceH #define serviceH #include <System.hpp> #include <InvokeRegistry.hpp> #include <XSBuiltIns.hpp> #include <SoapHTTPClient.hpp> namespace NS_service { class MessageWS; class MatchWS; class MatchDiffWS; class LeagueWS; class LoginPackageWS; typedef DynamicArray<TXSDateTime*> DateTimeArray; // ************************************************************************ // // Namespace : urn:ActionWebService // ************************************************************************ // class MessageWS : public TRemotable { private: TXSDateTime* Ftime; AnsiString Flinkurl; AnsiString Flinktext; AnsiString Furl; public: __fastcall ~MessageWS(); __published: __property TXSDateTime* time = { read=Ftime, write=Ftime }; __property AnsiString linkurl = { read=Flinkurl, write=Flinkurl }; __property AnsiString linktext = { read=Flinktext, write=Flinktext }; __property AnsiString url = { read=Furl, write=Furl }; }; typedef DynamicArray<MessageWS*> MessageWSArray; // ************************************************************************ // // Namespace : urn:ActionWebService // ************************************************************************ // class MatchWS : public TRemotable { private: AnsiString Fteam1Title; AnsiString Fstatus; int Fteam2Score; int Fteam1Score; int FmatchID; TXSDateTime* FstartTime; int Fteam2Id; int Fteam1Id; AnsiString Furl; AnsiString Fteam2Title; public: __fastcall ~MatchWS(); __published: __property AnsiString team1Title = { read=Fteam1Title, write=Fteam1Title }; __property AnsiString status = { read=Fstatus, write=Fstatus }; __property int team2Score = { read=Fteam2Score, write=Fteam2Score }; __property int team1Score = { read=Fteam1Score, write=Fteam1Score }; __property int matchID = { read=FmatchID, write=FmatchID }; __property TXSDateTime* startTime = { read=FstartTime, write=FstartTime }; __property int team2Id = { read=Fteam2Id, write=Fteam2Id }; __property int team1Id = { read=Fteam1Id, write=Fteam1Id }; __property AnsiString url = { read=Furl, write=Furl }; __property AnsiString team2Title = { read=Fteam2Title, write=Fteam2Title }; }; // ************************************************************************ // // Namespace : urn:ActionWebService // ************************************************************************ // class MatchDiffWS : public TRemotable { private: AnsiString Fstatus; int Fteam2Score; int Fteam1Score; int FmatchId; public: __published: __property AnsiString status = { read=Fstatus, write=Fstatus }; __property int team2Score = { read=Fteam2Score, write=Fteam2Score }; __property int team1Score = { read=Fteam1Score, write=Fteam1Score }; __property int matchId = { read=FmatchId, write=FmatchId }; }; typedef DynamicArray<MatchDiffWS*> MatchDiffWSArray; typedef DynamicArray<int> IntegerArray; typedef DynamicArray<MatchWS*> MatchWSArray; // ************************************************************************ // // Namespace : urn:ActionWebService // ************************************************************************ // class LeagueWS : public TRemotable { private: TXSDateTime* Ftimestamp; int FleagueID; MatchWSArray Fmatches; public: __fastcall ~LeagueWS(); __published: __property TXSDateTime* timestamp = { read=Ftimestamp, write=Ftimestamp }; __property int leagueID = { read=FleagueID, write=FleagueID }; __property MatchWSArray matches = { read=Fmatches, write=Fmatches }; }; typedef DynamicArray<LeagueWS*> LeagueWSArray; // ************************************************************************ // // Namespace : urn:ActionWebService // ************************************************************************ // class LoginPackageWS : public TRemotable { private: MessageWSArray Fmessages; int FupdateInterval; TXSDateTime* FteamsListTimestamp; TXSDateTime* FleaguesListTimestamp; LeagueWSArray Fleagues; public: __fastcall ~LoginPackageWS(); __published: __property MessageWSArray messages = { read=Fmessages, write=Fmessages }; __property int updateInterval = { read=FupdateInterval, write=FupdateInterval }; __property TXSDateTime* teamsListTimestamp = { read=FteamsListTimestamp, write=FteamsListTimestamp }; __property TXSDateTime* leaguesListTimestamp = { read=FleaguesListTimestamp, write=FleaguesListTimestamp }; __property LeagueWSArray leagues = { read=Fleagues, write=Fleagues }; }; // ************************************************************************ // // Namespace : urn:ActionWebService // soapAction: /footiefox/api/%operationName% // Transport : http://schemas.xmlsoap.org/soap/http // Stil : rpc // binding : FootiefoxFootiefoxBinding // Service : FootiefoxService // Port : FootiefoxFootiefoxPort // URL : http://www9.hpi-web.de/footiefox/api // ************************************************************************ // __interface INTERFACE_UUID("{B6E89CC8-2B4F-9680-F5C4-3B20AF93DA72}") FootiefoxFootiefoxPort : public IInvokable { public: virtual bool Login() = 0; virtual MatchDiffWSArray WhatsOnUpdate(const IntegerArray param0) = 0; virtual AnsiString GetAd() = 0; virtual DateTimeArray LeaguesLastTimestamp(const IntegerArray param0) = 0; virtual LoginPackageWS* WhatsOn(const IntegerArray param0, const IntegerArray param1) = 0; virtual MatchDiffWSArray UpdateLeagues(const IntegerArray param0) = 0; virtual TXSDateTime* AdLastModified() = 0; }; typedef DelphiInterface<FootiefoxFootiefoxPort> _di_FootiefoxFootiefoxPort; _di_FootiefoxFootiefoxPort GetFootiefoxFootiefoxPort(bool useWSDL=false, AnsiString addr=""); #endif // __service_h__ }; // NS_service #if !defined(NO_IMPLICIT_NAMESPACE_USE) using namespace NS_service; #endif