Einzelnen Beitrag anzeigen

CarstenH

Registriert seit: 18. Feb 2006
18 Beiträge
 
Delphi 7 Professional
 
#1

DHL-Webservice nutzen

  Alt 2. Nov 2015, 13:35
Ich versuche bislang vergeblich, den DHL-Webservice an den Start zu bekommen. Folgender Effekt: Wenn ich die Datei
https://cig.dhl.de/cig-wsdls/com/dpd...d-api-1.0.wsdl
ü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:
http://www.onlinedelphitraining.com/...ebservices.htm
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.
  Mit Zitat antworten Zitat