Hi ,
I am calling an external webservice , from navision , while I call the SOAP URL in WSDL Browser and Insert the XML , its is working fine.
But while I call the Same XML request from Navision and hit the same SOAP URL then it gives this error
Microsoft Dynamics NAV
---------------------------
A call to System.Net.HttpWebRequest.GetResponse failed with this message: The remote server returned an error: (400) Bad Request.
---------------------------
OK
---------------------------
I am writing this Code
xml := xml.XmlDocument();
xml.Load('D:\'+'NewRequest3.XML');
XMLResponse := XMLResponse.XmlDocument();
CallShipmentRequest(xml,XMLResponse,'','');
XMLResponse.Save('D:\'+'Response.XML');
HttpWebRequest := HttpWebRequest.Create('netconnect.bluedart.com/.../WayBillGeneration.svc');
HttpWebRequest.UseDefaultCredentials := TRUE;
HttpWebRequest.Method := Method;
//HttpWebRequest.ContentType := TypeValue;
HttpWebRequest.ContentType := 'application/soap+xml; charset=utf-8'; //'text/xml; charset=utf-8'; //
//HttpWebRequest.Credentials
HttpWebRequest.PreAuthenticate := TRUE;
XMLRequest.Save(HttpWebRequest.GetRequestStream);
HttpWebResponse := HttpWebRequest.GetResponse;
IF HttpWebResponse.StatusCode = 200 THEN BEGIN
XMLResponse.Load(HttpWebResponse.GetResponseStream);
EXIT(TRUE);
END ELSE
XMLResponse.Load(HttpWebResponse.GetResponseStream);
EXIT(FALSE);
*This post is locked for comments