4

私の wsdl コードでは、整数を取得し、結果を配列で返したいと考えています。私のphp関数では、クライアントが選択した整数からデータベースから情報を返したいので、なぜ私の入力には整数が1つしかなく、配列の結果が必要なのですか。

例、私のクライアントは 1 を送信します。私の php では、DB の "1" から "ID (int)","Name(string)","Number1(int)","Number2(int)"," として情報を取得します。実際のクライアント需要の日時 « YYYY-MM-DD hh:mm:hh » (??)"

どうすればこれを行うことができますか?

ありがとう、

これは、1 つの整数の入力と 1 つの整数の出力を持つ私の実際の wsdl です。

<message name='getResultRequest'> 
  <part name='numeropark' type='xsd:int'/>
</message> 
<message name='getResultResponse'> 
  <part name='result' type='xsd:string'/> 
</message> 

<portType name='getResultPortType'> 
  <operation name='getResult'> 
    <input message='tns:getResultRequest'/> 
    <output message='tns:getResultResponse'/> 
  </operation> 
</portType> 

<binding name='getResultBinding' type='tns:getResultPortType'> 
  <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> 
  <operation name='getResult'> 
    <soap:operation soapAction='urn:xmethods-delayed-quotes#getResult'/> 
    <input> 
      <soap:body use='encoded' namespace='urn:xmethods-delayed-calcul' 
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
    </input> 
    <output> 
      <soap:body use='encoded' namespace='urn:xmethods-delayed-calcul' 
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
    </output> 
  </operation> 
</binding> 

<service name='getResultService'> 
  <port name='getResultPort' binding='getResultBinding'> 
    <soap:address location='http://XXX.XXXX.com/soap/soap-server.php'/> 
  </port> 
</service> 

4

1 に答える 1

6

配列を返すには、complexType を定義する必要があります。たとえば、文字列の配列を返したい場合は、WSDL に次の部分を含める必要があります。

<wsdl:types>
    <xsd:schema targetNamespace="http://schema.example.com">
      <xsd:complexType name="resultArray">
        <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='getResultRequest'> 
  <part name='numeropark' type='xsd:int'/>
</message> 
<message name='getResultResponse'> 
  <part name='result' type='tns:resultArray'/> 
</message>

また、任意の WSDL ジェネレーターを使用して記述ファイルを作成することをお勧めします。

于 2013-04-16T20:40:07.710 に答える