Thema: Soap / WSDL

Einzelnen Beitrag anzeigen

Neumann

Registriert seit: 6. Feb 2006
Ort: Moers
529 Beiträge
 
Delphi 11 Alexandria
 
#1

Soap / WSDL

  Alt 11. Mär 2014, 12:44
Hallo,

habe eine WSDL-Datei erhalten; damit soll ein Zugriff auf eine MySQL-Datenbank realisiert werden. Versuche ich diese mit dem Assisten zu importieren, bekomme ich nur eine Procedure ohne Parameter wie unten. Die "richtige" Adresse habe ich hier immer durch xxx ersetzt, da ich sie aus Sicherheisgründen nicht veröffentlichen möchte.

Was mache ich falsch, oder was ist an der WSDL nicht ok; habe nicht so viel Erfahrung mit Webservices

Delphi-Quellcode:
unit soap_server;

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 sie sind in diesem Dokument nicht[!] deklariert. Die Typen aus letzterer Kategorie
  // sind in der Regel vordefinierten/bekannten XML- oder Embarcadero-Typen zugeordnet; sie könnten aber auf
  // ein inkorrektes WSDL-Dokument hinweisen, das einen Schematyp nicht deklariert oder importiert hat.
  // ************************************************************************ //
  // !:string - "http://www.w3.org/2001/XMLSchema"[!U][GblNlbl]
  // !:string - "http://www.w3.org/2001/XMLSchema"[!U][Gbl]

  Array_ = array of string; { "http://schema.example.com"[!U][GblCplx] }

  // ************************************************************************ //
  // Namespace : http://xxx/module/soapapi
  // Stil : ????
  // Verwenden von : ????
  // ************************************************************************ //
  getDataFromTable_PortType = interface(IInvokable)
  ['{D42CF480-9B63-2B10-B4F8-36D3F2E835C3}']
    procedure getDataFromTable; stdcall;
  end;



implementation
  uses SysUtils;

initialization
  { getDataFromTable_PortType }
  InvRegistry.RegisterInterface(TypeInfo(getDataFromTable_PortType), 'http://xxx/module/soapapi', 'UTF-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(getDataFromTable_PortType), '');
  RemClassRegistry.RegisterXSInfo(TypeInfo(Array_), 'http://schema.example.com', 'Array_', 'Array');

end.
WSDL
Delphi-Quellcode:
<?xml version ="1.0" encoding ="UTF-8" ?>

<definitions name="SoapWaWi"
 targetNamespace="http://xxx/module/soapapi"
 xmlns:tns=" http://xxx/module/soapapit"
 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
 xmlns="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
    <xsd:schema targetNamespace="http://schema.example.com">
      <xsd:complexType name="Array">
        <xsd:complexContent>
          <xsd:restriction base="SOAP-ENC:Array">
            <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]" />
          </xsd:restriction>
        </xsd:complexContent>
      </xsd:complexType>
    </xsd:schema>
</wsdl:types>
 <message name="getDataFromTableIn">
   <part name="apikey" type="xsd:string"/>
   <part name="table" type="xsd:string"/>
   <part name="fields" type="xsd:string"/>
   <part name="startlimit" type="xsd:int"/>
   <part name="endlimit" type="xsd:int"/>
   <part name="operator" type="xsd:int"/>
   <part name="conditions" type="xsd:string"/>
   <part name="order" type="xsd:string"/>
   <part name="group" type="xsd:string"/>
 </message>
<message name="getDataFromTableOut">
   <part name='results' type='xsd:Array'/>
</message>
<portType name="getDataFromTable_PortType">
   <operation name="getDataFromTable">
      <input message="tns:getDataFromTableIn"/>
      <output message="tns:getDataFromTableOut"/>
   </operation>
</portType>
<binding name="getDataFromTableBinding" type="tns:getDataFromTable_PortType">
   <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="getDataFromTable">
         <soap:operation soapAction="getDataFromTable"/>
         <input>
            <soap:body
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
            namespace="urn:thegeek-getpostsservice"
            use="encoded"/>
         </input>
         <output>
            <soap:body
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
            namespace="urn:thegeek-getpostsservice"
            use="encoded"/>
         </output>
      </operation>
   </binding>
 <service name="SoapWaWiService">
  <port name="SelectSingle" binding="getDataFromTableBinding">
   <soap:address location="http://xxx/module/soapapi/soap.php"/>
   </port>
 </service>

</definitions>
Ralf
Gruß vom Niederrhein
  Mit Zitat antworten Zitat