2016-11-22 2 views
0

こんにちは、私は引数として入力と3引数を出力としてWSDLを持っています。PHP SOAPサーバー - 関数がすべての要素を取得しない

しかし、クライアントを使用すると、引数は1つしかありません。

ここに私のWSDL:

<?xml version="1.0" encoding="UTF-8"?> 
<definitions name="gestioneAssistitiDefinitions" targetNamespace="http://test.it/test/soapServer/" xmlns:tns="http://test.it/test/soapServer/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/"> 
<types> 
    <xsd:schema elementFormDefault="qualified"> 
     <xsd:complexType name="assistito"> 
      <xsd:all>   
       <xsd:element name="cognome" type="xsd:string" /> 
       <xsd:element name="nome" type="xsd:string" /> 
       <xsd:element name="codiceFiscale" type="xsd:string" /> 
      </xsd:all> 
     </xsd:complexType> 
    </xsd:schema>  
</types> 
<message name="gestioneAssistiti"> 
    <part name="codFiscale" type="xsd:string" /> 
</message> 
<message name="gestioneAssistitiRisposta"> 
    <part name="assistito" type="tns:assistito" /> 
</message> 
<portType name="gestioneAssistitiPortType"> 
    <operation name="gestioneAssistiti"> 
    <documentation>Ottiene i dati dell'assitito partendo dal codice fiscale</documentation> 
    <input message="tns:gestioneAssistiti"/> 
    <output message="tns:gestioneAssistitiRisposta"/> 
    </operation> 
</portType> 
<binding name="gestioneAssistitiBinding" type="tns:gestioneAssistitiPortType"> 
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> 
    <operation name="gestioneAssistiti"> 
    <soap:operation soapAction="ottieniAssistito" style="rpc"/> 
    <input><soap:body use="encoded" namespace="http://test.it/test/soapServer/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input> 
    <output><soap:body use="encoded" namespace="http://test.it/test/soapServer/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output> 
    </operation> 
</binding> 
<service name="gestioneAssistiti"> 
    <port name="gestioneAssistitiPort" binding="tns:gestioneAssistitiBinding"> 
    <soap:address location="http://test.it/test/soapServer/richiesta.php"/> 
    </port> 
</service> 
</definitions> 

ここに私のPHPサーバ機能:

$server= new SoapServer("server.wsdl", array('soap_version' => SOAP_1_2)); 
$server->addFunction("gestioneAssistiti"); 
$server->handle(); 

function gestioneAssistiti($codFiscale){ 

    $variabili = array(
     'cognome' => 'Test', 
     'nome' => 'Stefano', 
     'codiceFiscale' => $codFiscale 
    ); 



    return $variabili; 
} 

そして最後に私の唯一の結果の引数は次のとおりです。 "ノーム"。

なぜですか?間違いはどこですか?

答えて

0

私のエラーは、PHPの部分にあった... クラスを使用して、それは動作します! :)

$oggetto = new stdClass(); 

$oggetto->cognome = 'Venneri'; 
$oggetto->nome = 'Stefano'; 
$oggetto->codiceFiscale = $codFiscale; 

return $oggetto; 
関連する問題