Can not Get Response from Web Service

yashina
Member Posts: 16


I send request to Web service from this code. Why I can not GET response from Web service ? What's wrong ?
OnRun()
CreateXML;
InvokeNavWS;
LOCAL InvokeNavWS()
CLEAR(xmlhttp);
CLEAR(xmldoc);
CLEAR(xmlnode);
CLEAR(xmlnodelist);
CLEAR(xmlattributes);
result := FALSE;
// Create XML Document
xmldoc :=xmldoc.XmlDocument;
xmldoc.Load(FileName);
// Create XMLHTTP and SEND
xmlhttp :=XmlHttpClass.XMLHTTPRequestClass;
xmlhttp.open('POST', 'http://de01-onec05.corp.111111.com/UT_111111-DEV/ws/Navision?wsdl', FALSE,'111111','111');
xmlhttp.setRequestHeader('Content-type', 'text/xml; charset=utf-8');
xmlhttp.setRequestHeader('SOAPAction', 'http://www.111111.com/Navision/package#Navision:CreateOrderToSupplier');
xmlhttp.send(xmldoc.ToString);
ResponseString := xmlhttp.responseText;
xmldoc.LoadXml(ResponseString);
// If status is OK - Get Result XML
IF xmlhttp.status=200 THEN
BEGIN
//xmldoc := xmlhttp.responseXML;
xmlnodelist := xmldoc.GetElementsByTagName('m:return');
Nodes := xmlnodelist.Count;
FOR i := 0 TO Nodes-1 DO BEGIN
xmlnode := xmlnodelist.ItemOf(i);
xmlattributes := xmlnode.Attributes;
xmlnode := xmlattributes.GetNamedItem('Error');
IF NOT ISNULL(xmlnode) THEN
errortxt := xmlnode.InnerText;
xmlnode := xmlattributes.GetNamedItem('Result');
IF NOT ISNULL(xmlnode) THEN
resulttxt := xmlnode.InnerText;
END;
END ELSE
result := TRUE;
xmldoc.Save('C:\Users\111111\Desktop\test50000_resp.xml');
CLEAR(xmlhttp);
CLEAR(xmldoc);
CLEAR(xmlnode);
CLEAR(xmlnodelist);
CLEAR(xmlattributes);
CreateXML()
CLEAR(TempBlob);
CLEAR(XMLStreamOut);
CLEAR(XMLStreamIn);
FileName := 'C:\Users\omegaplus\Desktop\test111111.xml';
ServerFileName := FileMgt.ServerTempFileName('xml');
XMLFile.CREATE(ServerFileName);
XMLFile.CREATEOUTSTREAM(XMLStreamOut);
XMLPORT.EXPORT(XMLPORT::TestSoap,XMLStreamOut);
XMLFile.CLOSE;
FileMgt.DownloadToFile(ServerFileName,FileName);
//MESSAGE('File Exported as: %1.', FileName);
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions