Delphi WSDL importer issue

I am trying to import WSDL provided by a third party. In one of the methods (get_orders), looking at WSDL, it can return multiple records ( <part name="orders" type="tns:order" xsi:minOccurs="0" xsi:maxOccurs="unbounded"/>

), but Delphi creates a function that returns one object when I believe it should be an array. Am I doing something wrong?

WSDL file

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:WashOut" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="integration" targetNamespace="urn:WashOut">
    <types>
        <schema targetNamespace="urn:WashOut" xmlns="http://www.w3.org/2001/XMLSchema">
            <xsd:complexType name="order">
                <xsd:sequence>
                    <xsd:element name="number" type="xsd:string"/>
                    <xsd:element name="total" type="xsd:decimal"/>
                </xsd:sequence>
            </xsd:complexType>
        </schema>
    </types>
    <message name="get_orders">
  </message>
    <message name="get_orders_response">
        <part name="orders" type="tns:order" xsi:minOccurs="0"     xsi:maxOccurs="unbounded"/>
    </message>
    <portType name="integration_port">
        <operation name="get_orders">
            <input message="tns:get_orders"/>
            <output message="tns:get_orders_response"/>
        </operation>
    </portType>
    <binding name="integration_binding" type="tns:integration_port">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="get_orders">
            <soap:operation soapAction="get_orders"/>
            <input>
                <soap:body use="encoded"     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:WashOut"/>
            </input>
            <output>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:WashOut"/>
            </output>
        </operation>
    </binding>
    <service name="service">
        <port name="integration_port" binding="tns:integration_binding">
            <soap:address location="http://www.url.com/integration/action"/>
        </port>
    </service>
</definitions>

      

Function created by delphi

function  get_orders: order; stdcall;  

      

Update 25/05/2015

The webservice returns something like this:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="urn:WashOut">
  <soap:Body>
    <tns:get_orders_response>
      <orders xsi:type="tns:orders">
        <number xsi:type="xsd:string">565474258</number>
        <total xsi:type="xsd:decimal">0.0</total>
      </orders>
      <orders xsi:type="tns:orders">
        <number xsi:type="xsd:string">519301205</number>
        <total xsi:type="xsd:decimal">0.0</total>
      </orders>
      <orders xsi:type="tns:orders">
        <number xsi:type="xsd:string">619118175</number>
        <total xsi:type="xsd:decimal">347.33</total>
      </orders>
      <orders xsi:type="tns:orders">
        <number xsi:type="xsd:string">105590906</number>
        <total xsi:type="xsd:decimal">127.74</total>
      </orders>
    </tns:get_orders_response>
  </soap:Body>
</soap:Envelope>

      

So, I may be asking the wrong question. How can I iterate over the "orders" returned from the web service using a block generated by the WSDL importer?

+3


source to share





All Articles