Options

Request xml with XMLHTTP. Problem

PIBETRONPIBETRON Member Posts: 2
edited 2005-05-06 in Navision Financials
Hi all,
I'm trying to request information using XMLHTTP object from Navision Financials version ES 2.60.A.
I can connect correctly with the xml server but when i want to show the returned xml i find internal error.
The source i'm using is:
Local Variables:
Name DataType Subtype Length
conexion Automation 'Microsoft XML, v3.0'.XMLHTTP
url Text 250
user Text 30
pwd Text 30
xml_texto Text 250
documento Automation 'Microsoft XML, v3.0'.DOMDocument30

Source code:
// Start testing XML conecton with the server.
url := 'http://xml.serverRequest'; // Ficticial url
user := 'user';
pwd := 'password';
CREATE(conexion);
CREATE(documento);
conexion.open('POST', url, TRUE, user, pwd);
xml_texto := '<?xml version="1.0"?>' +
'<ASC_JOB_REQUEST>' +
'<JOB_REQUEST>' +
'<COMPANY>C470</COMPANY>' +
'<JOB_TYPE>SRA</JOB_TYPE>' +
'<REQUESTER>735192</REQUESTER>' +
'<TR_NO></TR_NO>' +
'<JOB_NO></JOB_NO>' +
'</JOB_REQUEST>' +
'</ASC_JOB_REQUEST>';
conexion.setRequestHeader('Content-Type','text/xml');
conexion.setRequestHeader('Cache-Control','no-cache');
conexion.setRequestHeader('Content-Length', FORMAT(STRLEN(xml_texto)));
conexion.send(xml_texto);
WHILE (conexion.readyState <> 4) DO
YIELD;

// The information is returned correctly.
MESSAGE(FORMAT(conexion.readyState) + ', ' + FORMAT(conexion.status) + ', ' + conexion.statusText);
{
Message show:
readyState = 4
status = 200
statusText = OK
}

documento.load(conexion.responseXML());
MESSAGE(documento.xml); // Show internal error 11 module 45

documento.loadXML(conexion.responseText());
MESSAGE(documento.xml);
{
Show error:
Error on responseText.msxml3.dll
Returned error: System Error = -1072896658
}

MESSAGE(conexion.responseText());
{
Show the same previous error
}

OS Version:
Windows 2000 Professional / Windows XP Professional
Navision Financials version ES 2.60.A. (with Microsoft SQL Server Option for Navision Financials)

Some suggestion about this problem?


Thanks,
Julian Ramiro
Sign In or Register to comment.