I m trying to make a soal service and i face an issue with my wsdl
In my controller i have
public function actions()
{
return array_merge(parent::actions(), array(
'mapProcess' =>array(
'class'=>'CWebServiceAction',
'serviceOptions' =>
array('generatorConfig' =>
array(
'class' => 'CWsdlGenerator',
'bindingStyle' => 'lieteral'))
),
));
}
/**
* @param str/string the type of the map process
* @return string[] the ouput of the proceedure
* @soap
*/
public function actionMappings(){
$response = [];
$listofCategories = ["option1",
"option2",
"option3",
"option4",
"option5"];
foreach($listofCategories as $singleCategory){
$response[$singleCategory] = ($someCondition)?'Success':'Failure';
}
return ['actionMappingsResult' => $response];
}
the out come after calling the soap service is
<ns1:actionMappingsResponse xsi:type="ns1:RefreshMappingsResponse">
<actionMappingsResult SOAP-ENC:arrayType="xsd:string[15]" xsi:type="ns1:stringArray">
<item xsi:type="xsd:string">Success</item>
<item xsi:type="xsd:string">Success</item>
<item xsi:type="xsd:string">Success</item>
<item xsi:type="xsd:string">Success</item>
<item xsi:type="xsd:string">Success</item>
</actionMappingsResult>
</ns1:actionMappingsResponse>
However the desired result would be
<ns1:actionMappingsResponse xsi:type="ns1:RefreshMappingsResponse">
<actionMappingsResult SOAP-ENC:arrayType="xsd:string[15]" xsi:type="ns1:stringArray">
<option1 xsi:type="xsd:string">Success</option1>
<option2 xsi:type="xsd:string">Success</option2>
<option3 xsi:type="xsd:string">Success</option3>
<option4 xsi:type="xsd:string">Success</option4>
<option5 xsi:type="xsd:string">Success</option5>
</actionMappingsResult>
</ns1:actionMappingsResponse>
Is something wrong with my definitions? Is is possible what i am trying to do?