I'm creating SOAP web service using PHP.
Here is my code..
SoapServer.php
class server{
public function RegisterComplaint($strInputXml){
$str = "<RESULT><complaintNo>09865678</complaintNo></RESULT>";
$arr['RegisterComplaintResult'] = trim($str);
return $arr;
}
}
$custom_wsdl = 'custom.wsdl';
$server = new SoapServer($custom_wsdl);
$server->setClass('server');
$server->handle();
When I call RegisterComplaint using Wizdler(chrome extension) I get below result:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.Insurer.com/webservices/">
<SOAP-ENV:Body>
<ns1:RegisterComplaintResponse>
<ns1:RegisterComplaintResult><RESULT><complaintNo>09865678</complaintNo></RESULT></ns1:RegisterComplaintResult>
</ns1:RegisterComplaintResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Here I want result in below format(special characters to HTML entities):
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.Insurer.com/webservices/">
<SOAP-ENV:Body>
<ns1:RegisterComplaintResponse>
<ns1:RegisterComplaintResult><RESULT><complaintNo>09865678</complaintNo></RESULT></ns1:RegisterComplaintResult>
</ns1:RegisterComplaintResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Does any one know what I have to change for required output?
I tried html_entity_decode() & htmlspecialchars() on $str variable, but it's not working.