Lost in getting data from soap XML answer

superbrugersuperbruger Member Posts: 41
Hello

I have this code:
XMLHttpConn.open('POST','http://server.name.de/soap.php HTTP/1.1',FALSE,'user','password');

//set some values in the request header depending on what the service requires
XMLHttpConn.setRequestHeader('Content-Type','text/xml;charset=UTF-8');
XMLHttpConn.setRequestHeader('SOAPAction','http://server.name.de/soap.php#getServerInfo');
XMLHttpConn.setRequestHeader('Authorization','something');
XMLHttpConn.setRequestHeader('Host','server.name.de');

//actually send the message
XMLHttpConn.send();

//get the response
IF ISCLEAR(XmlDoc) THEN
  CREATE(XmlDoc);

XmlDoc.load(XMLHttpConn.responseXML);

MESSAGE('Status %1 %2',XMLHttpConn.status,XMLHttpConn.statusText);

//this is for diagnostics only, so you can see what you got back
XmlDoc.save('T:\Temp\XMLResponse1.xml');

I get a message for the status as "200 OK"
But the file I save as XMLResponse1 is empty.

Can anybody please tell me, if I'm doing something wrong?


/Brian

Comments

  • GRIZZLYGRIZZLY Member Posts: 127
    If the message is quet small you could try:
    XmlDoc.loadXML(XMLHttpConn.responseText);
    
    Sincerely yours, GRIZZLY
    Follow my blog at http://x-dynamics.blogspot.com
  • superbrugersuperbruger Member Posts: 41
    Thank You, Grizzly, but the text is to long to be read this way.

    (Navision error)

    So that means, I think, there is some answer from the server.
    But then - how to read / save it?


    /Brian
Sign In or Register to comment.