2016-08-25 15 views
0

どのようにphp2wsdl @ paramカーディナリティを指定しますか?私はSOAPUIのようにリクエストを模擬なるようWSDLを生成したいと思い

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="https://v121d164.prevnet/webservices/server.php"> 
    <soapenv:Header/> 
    <soapenv:Body> 
    <ser:myService soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
     <!--Zero or more repetitions:--> 
     <code xsi:type="xsd:string">?</code> 
    </ser:myService> 
    </soapenv:Body> 
</soapenv:Envelope> 

PHP2WSDLのドキュメントは、インスタンス変数の例があります。

/** 
* @var string 
* @maxOccurs 0 
*/ 

をしかし、それはのparamsについては何も言いません。 私は

/** 
* @param string 
* @maxOccurs 0 
*/ 

しかし、運を使用することを試みました。

答えて

0

クラスを作成し、メソッドのパラメータとして使用します。 @minOccursタグを使用して、そのクラスのプロパティのカーディナリティを定義できます。

Class MyServiceInput 
{ 
    /** 
    * @var string 
    * @minOccurs 0 
    */ 
    public $str; 
} 

class MyService 
{ 
    /** 
    * @soap 
    * @param MyServiceInput $inputParam 
    */ 
    public function myMethod($inputParam) 
    { 
    } 
} 
関連する問題