This function sends an XML request to XML Easycom Server.
mixed i5_XmlExecRequest (string Input_Request [,resource Connection ])
Parameters
input_request |
Input_Request can be : • A string containing XML tags according to XML Easycom syntax. • A string containing a full path to an XML file in the IFS. This XML file contains XML Easycom requests. |
connection |
Easycom Connection - Result of i5_connect() or i5_pconnect(). |
Return
Function returns a string containing XML stream with Program return value and modified parameters.
In case of error, i5_XmlExecRequest() returns false. Call i5_XmlLastError() to retrieve error details.
Details
XML string is sent to XML Easycom Server, for execution. A resulting XML is returned back.
Examples
i5_XmlExecRequest() receives an XML string, and it returns an XML string.
// Define procedures
$XmlIn = '<?xml version="1.0" encoding="utf-8"'.'?'.'>'.
'<Easycom>'.
' <define>'.
' <file stmf="/tmp/sr/CUST_DIM.pcml" type="PCML" />'.
' </define>'.
'</Easycom>';
$XmlOut = i5_XmlExecRequest($XmlIn);
if (is_bool ( $XmlOut ) && $XmlOut == FALSE)
{
print_r("i5_XmlExecRequest error : ".i5_errormsg().'<br/>');
}
else
{
echo $XmlOut;
echo '<br/>';
// Effective Call
$CustId = "01551";
$XmlIn = '<?xml version="1.0" encoding="utf-8"'.'?'.'>'.
'<Easycom>'.
' <Program Name="CUST_DIM">'.
' <parameterList>'.
' <Toread>'."15".'</Toread>'.
' <IO>'."20".'</IO>'.
' <Term1>'.$CustId.'</Term1>'.
' </parameterList>'.
' </Program>'.
'</Easycom>';
$XmlOut = i5_XmlExecRequest($XmlIn);
if (is_bool ( $XmlOut ) && $XmlOut == FALSE)
{
print_r("i5_XmlExecRequest error : ".i5_errormsg().'<br/>');
}
else
{
echo $XmlOut;
echo '<br/>';
}
}
i5_XmlExecRequest() receives a path to a file in IFS, and it returns an XML string. IFS file contains XML Easycom requests.
$XMLStr = i5_XmlExecRequest("/tmp/sr/_define01.xml");
See also