Is it normal that the response of the nusoap server is like this?
If not, how do i fix or remove the <
and >
and make it as <
and >
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:get_stocksResponse xmlns:ns1="VSR"><return xsi:type="xsd:string"><facilitator>
<stock_response>
<product>
<productid>1072722</productid>
<voorraad>888040</voorraad>
</product>
<product>
<productid>1072724</productid>
<voorraad>888603</voorraad>
</product>
</stock_response>
</facilitator>
</return></ns1:get_stocksResponse></SOAP-ENV:Body></SOAP-ENV:Envelope></code>
this is my register function in the server
$this->server->register('get_stocks', // method name
array('product' => 'xsd:int'), // input parameters
array('return' => 'xsd:string'), // output parameters
$this->_namespace, // namespace
'urn:'.$this->_namespace.'#get_stocks', // soapaction
'rpc', // style
'encoded', // use
'Get stocks of products' // documentation
);
and this is my return function
$xmlDoc = new DOMDocument('1.0', 'utf-8');
$xmlDoc->formatOutput = TRUE;
...etc
$nodes = $xmlDoc -> getElementsByTagName ('facilitator');
$node = $nodes -> item(0);
return $xmlDoc->saveXML($node);