![]() |
DHL-Webservice nutzen
Ich versuche bislang vergeblich, den DHL-Webservice an den Start zu bekommen. Folgender Effekt: Wenn ich die Datei
![]() über der WSDL-Import importiere, kennt Delphi danach diverse Typen nicht, z.B. CreateShipmentTDRequest. Mir ist jetzt nicht klar, wie ich mich dem Problem nähern kann. brauch ich evtl. ein neueres Delphi (7 Prof. ist am Start) oder sind es Einstellungsfragen oder bekomm ich die Typdeklarationen woanders her? Ich hab auch mal dieses Beispiel durchgespielt: ![]() Es kompiliert, liefert aber bei der Abfrage des Webservice auch Fehler, auch wenn ich nur die mitgelieferten Originalquellcodes kompiliere. Carsten
Delphi-Quellcode:
// ************************************************************************ //
// Die in dieser Datei deklarierten Typen wurden aus Daten generiert, die aus // unten beschriebener WSDL-Datei stammen: // WSDL : https://cig.dhl.de/cig-wsdls/com/dpdhl/wsdl/geschaeftskundenversand-api/1.0/geschaeftskundenversand-api-1.0.wsdl // Codierung : UTF-8 // Codegen : [wfDebug,wfServer,wfUseSerializerClassForAttrs,wfGenTrueGUIDs] // Version : 1.0 // (01.11.2015 23:14:55 - 1.33.2.5) // ************************************************************************ // unit geschaeftskundenversand_api_dhl; interface uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns; type // ************************************************************************ // // Die folgenden Typen, auf die im WSDL-Dokument Bezug genommen wird, sind in dieser Datei // nicht repräsentiert. Sie sind entweder Aliase(@) anderer repräsentierter Typen oder auf sie wurde Bezug genommen, // aber in diesem Dokument nicht deklariert (!). Die Typen aus letzterer Kategorie // sind normalerweise mit vordefinierten/bekannten XML- oder Borland-Typen verbunden; sie könnten aber auch ein Anzeichen // für ein falsches WSDL-Dokument sein, das einen Schema-Typ nicht deklariert oder importiert.. // ************************************************************************ // // !:CreateShipmentTDRequest - "http://de.ws.intraship" // !:CreateShipmentResponse - "http://de.ws.intraship" // !:Authentification - "http://dhl.de/webservice/cisbase" // !:CreateShipmentDDRequest - "http://de.ws.intraship" // !:DeleteShipmentTDRequest - "http://de.ws.intraship" // !:DeleteShipmentResponse - "http://de.ws.intraship" // !:DeleteShipmentDDRequest - "http://de.ws.intraship" // !:DoManifestTDRequest - "http://de.ws.intraship" // !:DoManifestResponse - "http://de.ws.intraship" // !:DoManifestDDRequest - "http://de.ws.intraship" // !:GetLabelTDRequest - "http://de.ws.intraship" // !:GetLabelResponse - "http://de.ws.intraship" // !:GetLabelDDRequest - "http://de.ws.intraship" // !:BookPickupRequest - "http://de.ws.intraship" // !:BookPickupResponse - "http://de.ws.intraship" // !:CancelPickupRequest - "http://de.ws.intraship" // !:CancelPickupResponse - "http://de.ws.intraship" // !:Version - "http://dhl.de/webservice/cisbase" // !:GetVersionResponse - "http://de.ws.intraship" // !:GetExportDocTDRequest - "http://de.ws.intraship" // !:GetExportDocResponse - "http://de.ws.intraship" // !:GetExportDocDDRequest - "http://de.ws.intraship" // !:GetManifestDDRequest - "http://de.ws.intraship" // !:GetManifestDDResponse - "http://de.ws.intraship" // !:UpdateShipmentDDRequest - "http://de.ws.intraship" // !:UpdateShipmentResponse - "http://de.ws.intraship" // ************************************************************************ // // Namespace : http://de.ws.intrashipservice // soapAction: urn:%operationName% // Transport : http://schemas.xmlsoap.org/soap/http // Stil : document // Bindung : ShipmentServiceSOAP11Binding // Service : ISService_1_0_de // Port : ShipmentServiceSOAP11port0 // URL : https://cig.dhl.de/services/production/soap // ************************************************************************ // ISWSServicePortType = interface(IInvokable) ['{35DA55F0-0197-EA24-95BA-6A40B3CBB3F7}'] function createShipmentTD(const part1: CreateShipmentTDRequest): CreateShipmentResponse; stdcall; function createShipmentDD(const part1: CreateShipmentDDRequest): CreateShipmentResponse; stdcall; function deleteShipmentTD(const part1: DeleteShipmentTDRequest): DeleteShipmentResponse; stdcall; function deleteShipmentDD(const part1: DeleteShipmentDDRequest): DeleteShipmentResponse; stdcall; function doManifestTD(const part1: DoManifestTDRequest): DoManifestResponse; stdcall; function doManifestDD(const part1: DoManifestDDRequest): DoManifestResponse; stdcall; function getLabelTD(const part1: GetLabelTDRequest): GetLabelResponse; stdcall; function getLabelDD(const part1: GetLabelDDRequest): GetLabelResponse; stdcall; function bookPickup(const part1: BookPickupRequest): BookPickupResponse; stdcall; function cancelPickup(const part1: CancelPickupRequest): CancelPickupResponse; stdcall; function getVersion(const part1: Version): GetVersionResponse; stdcall; function getExportDocTD(const part1: GetExportDocTDRequest): GetExportDocResponse; stdcall; function getExportDocDD(const part1: GetExportDocDDRequest): GetExportDocResponse; stdcall; function getManifestDD(const part1: GetManifestDDRequest): GetManifestDDResponse; stdcall; function updateShipmentDD(const part1: UpdateShipmentDDRequest): UpdateShipmentResponse; stdcall; end; implementation type ISWSServicePortTypeImpl = class(TInvokableClass, ISWSServicePortType) public { ISWSServicePortType } function createShipmentTD(const part1: CreateShipmentTDRequest): CreateShipmentResponse; stdcall; function createShipmentDD(const part1: CreateShipmentDDRequest): CreateShipmentResponse; stdcall; function deleteShipmentTD(const part1: DeleteShipmentTDRequest): DeleteShipmentResponse; stdcall; function deleteShipmentDD(const part1: DeleteShipmentDDRequest): DeleteShipmentResponse; stdcall; function doManifestTD(const part1: DoManifestTDRequest): DoManifestResponse; stdcall; function doManifestDD(const part1: DoManifestDDRequest): DoManifestResponse; stdcall; function getLabelTD(const part1: GetLabelTDRequest): GetLabelResponse; stdcall; function getLabelDD(const part1: GetLabelDDRequest): GetLabelResponse; stdcall; function bookPickup(const part1: BookPickupRequest): BookPickupResponse; stdcall; function cancelPickup(const part1: CancelPickupRequest): CancelPickupResponse; stdcall; function getVersion(const part1: Version): GetVersionResponse; stdcall; function getExportDocTD(const part1: GetExportDocTDRequest): GetExportDocResponse; stdcall; function getExportDocDD(const part1: GetExportDocDDRequest): GetExportDocResponse; stdcall; function getManifestDD(const part1: GetManifestDDRequest): GetManifestDDResponse; stdcall; function updateShipmentDD(const part1: UpdateShipmentDDRequest): UpdateShipmentResponse; stdcall; end; function ISWSServicePortTypeImpl.createShipmentTD(const part1: CreateShipmentTDRequest): CreateShipmentResponse; begin { TODO - Implement method createShipmentTD } end; function ISWSServicePortTypeImpl.createShipmentDD(const part1: CreateShipmentDDRequest): CreateShipmentResponse; begin { TODO - Implement method createShipmentDD } end; function ISWSServicePortTypeImpl.deleteShipmentTD(const part1: DeleteShipmentTDRequest): DeleteShipmentResponse; begin { TODO - Implement method deleteShipmentTD } end; function ISWSServicePortTypeImpl.deleteShipmentDD(const part1: DeleteShipmentDDRequest): DeleteShipmentResponse; begin { TODO - Implement method deleteShipmentDD } end; function ISWSServicePortTypeImpl.doManifestTD(const part1: DoManifestTDRequest): DoManifestResponse; begin { TODO - Implement method doManifestTD } end; function ISWSServicePortTypeImpl.doManifestDD(const part1: DoManifestDDRequest): DoManifestResponse; begin { TODO - Implement method doManifestDD } end; function ISWSServicePortTypeImpl.getLabelTD(const part1: GetLabelTDRequest): GetLabelResponse; begin { TODO - Implement method getLabelTD } end; function ISWSServicePortTypeImpl.getLabelDD(const part1: GetLabelDDRequest): GetLabelResponse; begin { TODO - Implement method getLabelDD } end; function ISWSServicePortTypeImpl.bookPickup(const part1: BookPickupRequest): BookPickupResponse; begin { TODO - Implement method bookPickup } end; function ISWSServicePortTypeImpl.cancelPickup(const part1: CancelPickupRequest): CancelPickupResponse; begin { TODO - Implement method cancelPickup } end; function ISWSServicePortTypeImpl.getVersion(const part1: Version): GetVersionResponse; begin { TODO - Implement method getVersion } end; function ISWSServicePortTypeImpl.getExportDocTD(const part1: GetExportDocTDRequest): GetExportDocResponse; begin { TODO - Implement method getExportDocTD } end; function ISWSServicePortTypeImpl.getExportDocDD(const part1: GetExportDocDDRequest): GetExportDocResponse; begin { TODO - Implement method getExportDocDD } end; function ISWSServicePortTypeImpl.getManifestDD(const part1: GetManifestDDRequest): GetManifestDDResponse; begin { TODO - Implement method getManifestDD } end; function ISWSServicePortTypeImpl.updateShipmentDD(const part1: UpdateShipmentDDRequest): UpdateShipmentResponse; begin { TODO - Implement method updateShipmentDD } end; initialization InvRegistry.RegisterInterface(TypeInfo(ISWSServicePortType), 'http://de.ws.intrashipservice', 'UTF-8'); InvRegistry.RegisterInvokableClass(ISWSServicePortTypeImpl); InvRegistry.RegisterHeaderClass(TypeInfo(ISWSServicePortType), Authentification, hmtAll, False); InvRegistry.RegisterHeaderMethod(TypeInfo(ISWSServicePortType), Authentification, 'createShipmentTD', hmtRequest, False); InvRegistry.RegisterHeaderMethod(TypeInfo(ISWSServicePortType), Authentification, 'createShipmentDD', hmtRequest, False); InvRegistry.RegisterHeaderMethod(TypeInfo(ISWSServicePortType), Authentification, 'deleteShipmentTD', hmtRequest, False); InvRegistry.RegisterHeaderMethod(TypeInfo(ISWSServicePortType), Authentification, 'deleteShipmentDD', hmtRequest, False); InvRegistry.RegisterHeaderMethod(TypeInfo(ISWSServicePortType), Authentification, 'doManifestTD', hmtRequest, False); InvRegistry.RegisterHeaderMethod(TypeInfo(ISWSServicePortType), Authentification, 'doManifestDD', hmtRequest, False); InvRegistry.RegisterHeaderMethod(TypeInfo(ISWSServicePortType), Authentification, 'getLabelTD', hmtRequest, False); InvRegistry.RegisterHeaderMethod(TypeInfo(ISWSServicePortType), Authentification, 'getLabelDD', hmtRequest, False); InvRegistry.RegisterHeaderMethod(TypeInfo(ISWSServicePortType), Authentification, 'bookPickup', hmtRequest, False); InvRegistry.RegisterHeaderMethod(TypeInfo(ISWSServicePortType), Authentification, 'cancelPickup', hmtRequest, False); InvRegistry.RegisterHeaderMethod(TypeInfo(ISWSServicePortType), Authentification, 'getExportDocTD', hmtRequest, False); InvRegistry.RegisterHeaderMethod(TypeInfo(ISWSServicePortType), Authentification, 'getExportDocDD', hmtRequest, False); InvRegistry.RegisterHeaderMethod(TypeInfo(ISWSServicePortType), Authentification, 'getManifestDD', hmtRequest, False); InvRegistry.RegisterHeaderMethod(TypeInfo(ISWSServicePortType), Authentification, 'updateShipmentDD', hmtRequest, False); end. |
AW: DHL-Webservice nutzen
D7?Kannst du auch gegen eine neue Delphi-version prüfen? Altere Versionn winf nicht dafür bekannt problemlos zu funkionieren
|
AW: DHL-Webservice nutzen
2005 hat jemand für mich getestet, gleicher Befund.
carsten |
AW: DHL-Webservice nutzen
2005 kann man aber nicht mehr als neue Version bezeichnen. Afaike gab es erst später eine neuimplementierung der webservice-schnittstelle
|
AW: DHL-Webservice nutzen
Hat die vielleicht einer der Mitleser und könnte einmal
![]() durchlaufen lassen? Carsten |
AW: DHL-Webservice nutzen
Liste der Anhänge anzeigen (Anzahl: 1)
Moin,
habe es mit der neusten Delphi Version importiert. Gruß Matze |
AW: DHL-Webservice nutzen
Das kompiliert nach ein paar formalen Anpassungen.
Nur mit SCOPEDENUMS kann Delphi 7 nichts anfangen. Hab die doppelten erstmal umbenannt, mir aber noch nicht weiter angeschaut, welche Konsequenzen das hat. Besten Dank erstmal! Carsten |
AW: DHL-Webservice nutzen
Liste der Anhänge anzeigen (Anzahl: 1)
Ich beiße mir an dem Thema weiter die Zähne aus. Habe jetzt die Testversion des neusten Delphi installiert. Dann hat mir jemand aus der DHL-C#-Demo ein Miniprogramm gebaut, das auch funktioniert. Ich hab Fiddler installiert, um zu schauen, was dort genau zum Server geht (im Bild unten die linke Seite). Hab dann versucht, das in Delphi umzusetzen, es kommt aber nur der rechts zu sehende Teil an.
Wie kann man sich dem problem nähern? Carsten |
AW: DHL-Webservice nutzen
Es gibt da Situationen, wo man einfach von Delphi über eine C#-DLL auf den SOAP-Service zugreift.
Da stellen sich erheblich schneller funktionierende Resultate ein. :stupid: |
AW: DHL-Webservice nutzen
Das hab ich auch schon überlegt...kann nur kein C# und hab eigentlich keine Lust mich extra dafür mit C# zu bewaffnen.
Carsten |
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:22 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