Answer the question
In order to leave comments, you need to log in
How to add xsi:nil='true' attribute to an element in SOAP in PHP?
Good afternoon!
I work with one service through soap wsdl. Everything goes smoothly, but when sending some data, I need every parameter in the data that receives the NULL value to be passed through the xsi:nil='true' attribute, and I don't know how to do this.
Simply put, I need the entry to be like this: <area_common_property xsi:nil="true"/>
And it's like this: <area_common_property >NULL</area_common_property>
How can I add the xsi:nil='true' attribute to an element in SOAP?
Answer the question
In order to leave comments, you need to log in
I understand that it's on time :), but for future generations of those who stick in, I post it.
When using wsdl, it is enough to add 'soap_version' => SOAP_1_2 to the SoapClient parameters.
After that, all parameters with the nillable="true" attribute, when set to NULL, will fly away with xsi:nil="true".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question