I am trying to create a soap request and, I need to convert soap xml to a php array. but I am stuck in a position where I can't figure out how to set attributes to array properly. I am very new to soap and good explanation will be appreciated. Here is what I have done so far.
what i want to create
<arg0>
<ns2:coverType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ns2:FamilyCoverType">
<ns2:abc>1978-04-03</ns2:abc>
<ns2:def>1980-04-03</ns2:def>
<ns2:pqr>2016-04-10</ns2:pqr>
<ns2:xyz>2016-05-03</ns2:xyz>
</ns2:coverType>
</arg0>
My array
$data = array(
'arg0' => array(
'coverType' => array(
'abc' => $abc,
'def' => $def,
'pqr' => $pqr,
'xyz' => $xyz,
)
)
);
Everything is fine except
xsi:type="ns2:FamilyCoverType"
How can I set above attribute in my array?? Pls Help.