2017-01-09 1 views
0

PHP nusoap 응답을 구현하는 데 도움이 필요합니다. 여기NuSoap 복잡한 유형의 계산 + 결과 배열

내 기능

Array 
(
    [total] => 8177 
    [results] => Array 
     (
      [0] => Array 
       (
        [id] => 340 
        [name] => Hamburg 
       ) 

      [1] => Array 
       (
        [id] => 344 
        [name] => Fos 
       ) 
     ) 
) 

지금 내가 XML로 반환이 필요 반환 것입니다. 또한 <item xsi:type="xsd:"> 내 모든 항목이 문자열/문자열 유형이 있습니다 : 당신이 SOAP-ENC:arrayType=":[1000]"> (빈 전에)를 볼 수에 상관없이 내가 (기본적으로 추측) 시도 어떻게 내가

<total xsi:type="xsd:int">8177</total> 
    <results xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType=":[1000]"> 
     <item xsi:type="xsd:"> 
      <id xsi:type="xsd:string">340</id> 
      <name xsi:type="xsd:string">Hamburg</name> 
     </item> 

를 얻을 수 없습니다.

여기까지 제 코드를 게시하여 누군가가 문제를 발견 할 수 있기를 바랍니다. 다시 시간과 앞으로 내가 올바른 응답을 추측 관리 후, 내가 여기에 게시 할 경우 다른 사람이 nusoap 복잡한 유형

$server->register("tankerPortsSearch", [ 
     'name' => 'xsd:string', 
     'step' => 'xsd:int', 
     'page' => 'xsd:int', 
    ], [ 
     'total' => 'xsd:int', 
     'results' => 'tns:responceArray' 
    ], 'urn:tankerPortsSearch', 'urn:tankerZonesTraffic#tankerPortsSearch', 'rpc', 'encoded', 'Tanker Ports Search'); 


$server->wsdl->addComplexType('responceArrayData', 'complexType', 'struct', '', '', [ 
    'id' => array('name' => 'id', 'type' => 'xsd:int'), 
    'name' => array('name' => 'name', 'type' => 'xsd:string') 
]); 
// ************************************************************************* 

// Complex Array ++++++++++++++++++++++++++++++++++++++++++ 
$server->wsdl->addComplexType('responceArray', 'complexType', 'array', '', '', [], [ 
    [ 
     'ref'   => 'SOAP-ENC:arrayType', 
     'wsdl:arrayType' => 'tns:responceArrayData[]', 
    ] 
], 'tns:responceArrayData'); 

에 붙어 있도록

$server->register(
       "tankerPortsSearch", 
       [ 
        'name' => 'xsd:string', 
        'step' => 'xsd:int', 
        'page' => 'xsd:int', 
       ], 
       [ 
        'total' => 'xsd:int', 
        'results' => 'tns:responceArray' 
       ], 
       'urn:tankerPortsSearch', 
       'urn:tankerZonesTraffic#tankerPortsSearch', 
       'rpc', 
       'encoded', 
       'Tanker Ports Search' 
      ); 


      $server->wsdl->addComplexType('responceArrayData', 'complexType', 'struct', '', 'SOAP-ENC:Array', [ 
       'id' => array('name' => 'id', 'type' => 'xsd:int'), 
       'name' => array('name' => 'name', 'type' => 'xsd:string') 
      ]); 
      // ************************************************************************* 

      // Complex Array ++++++++++++++++++++++++++++++++++++++++++ 
      $server->wsdl->addComplexType('responceArray', 'complexType', 'array', 'squence', '', [], [ 
       [ 
        'ref'   => 'SOAP-ENC:arrayType', 
        'wsdl:arrayType' => 'tns:responceArrayData[]' 
       ] 
      ]); 

답변

0

가 좋아 다행스럽게도 필자는 도움 관리 어떤 사람.

건배