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

serdarulutas
Member Posts: 50
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!
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!
0
Answers
-
Does using CREATE(winhttp,FALSE,FALSE) and CREATE(xmldom,FALSE,FALSE) work? Otherwise convert it to DotNet.0
-
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.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