UPS Tracking works on client side but Server side gives an error message

Curious if anybody has had such problem.

We have a routine that tracks UPS delivery data using "Microsoft XML, v6.0'.XMLHTTP60". When I send the request to https://wwwcie.ups.com/ups.app/xml/Track from NAV client, it works perfectly. When I trigger the request from Web Services, it errors out at send() function saying

"This message is for C/AL programmers: The call to member send failed: The system cannot locate the resource specified

."


It's the exact same code that I am running.


//tfile contains the UPS xml data that has two XML roots. That's why I use a temporary file.
//This code works perfectly on client but fails on server.

tFile.CREATEOUTSTREAM(vtVar);
IF ISCLEAR(winXMLHttp) THEN
CREATE(winXMLHttp);
winXMLHttp.open('POST',EndPointURL,0);

winXMLHttp.send(vtVar);
vtVar := winXMLHttp.responseStream;
CREATE(XMLDom);
XMLDom.load(vtVar);


I've tried changing the code and use "'Microsoft WinHTTP Services, version 5.1'.WinHttpRequest" instead. The client worked well again, but server side gave an error saying "This message is for C/AL programmers: The call to member Send failed: A connection with the server could not be established"

Code for this:

IF ISCLEAR(winhttp) THEN
CREATE(winhttp);
EndPointURL := 'https://wwwcie.ups.com/ups.app/xml/Track';
winhttp.Open('POST',EndPointURL,0);
winhttp.SetRequestHeader('Content-type','text/xml');
winhttp.SetTimeouts(1000,1000,1000,1000);
winhttp.Send(ReqText);
winhttp.WaitForResponse(2000);
IF ISCLEAR(XMLDom) THEN
CREATE(XMLDom);
XMLDom.load(winhttp.ResponseStream);
CLEAR(winhttp);


Any help is appreciated!

Answers

  • DuikmeesterDuikmeester Member Posts: 308
    Does using CREATE(winhttp,FALSE,FALSE) and CREATE(xmldom,FALSE,FALSE) work? Otherwise convert it to DotNet.
  • serdarulutasserdarulutas Member Posts: 50
    Just to inform readers, we pushed the tracker outside of NAV. It's done by web-services externally now and the results are fed into NAV by NAV web services.
Sign In or Register to comment.