HTTPS ERROR while HTTP works ?
wwestendorp
Member Posts: 178
I'm programming an Interface between 2 Systems using POST Kommendo for transmitting XML files.
I tested it succesfully with HTTP.
If I try to change the Kommando to HTTPS Nothing goes out and I receive the follwing error:
This message is for C/AL Programmers
The Call to the member send failed. msxml5.dll returned the following message:
The download of the specified resource failed.
I use following automation
'Microsoft XML, v5.0'.XMLHTTP50 = XMLHTTP Variable
I tried this with older ones but still the same.
If my Authorization wasn't correct I receive form the webservice an other message so something is not ok from Navision side.
Who could help me out there?
Navision prompt up the error at the last line here visable.
CLEAR(XMLHTTP);
CLEAR(locautXmlDoc);
CREATE(XMLHTTP);
CREATE(locautXmlDoc);
FileSize.OPEN(XMLsetup."XML Output Path");
FSize:=FileSize.LEN;
FileSize.CLOSE;
locautXmlDoc.async:=FALSE;
locautXmlDoc.load(XMLsetup."XML Output Path");
XMLHTTP.open('POST',Vendor."XML POST Commando",0);
XMLHTTP.setRequestHeader('Content-Type: ',Vendor."XML Content Type");
XMLHTTP.setRequestHeader('Authorization: ', Vendor."XML Auhorization");
XMLHTTP.setRequestHeader('User-Agent: ', Vendor."XML User Agent");
XMLHTTP.setRequestHeader('Host: ',Vendor."XML HOST" );
XMLHTTP.setRequestHeader('Content-Length: ', FORMAT(FSize));
XMLHTTP.setRequestHeader('Connection: ', 'Keep-Alive');
XMLHTTP.setRequestHeader('Cache-Control: ', 'no-cache');
XMLHTTP.send(locautXmlDoc);
locautXmlDoc.load(XMLHTTP.responseXML);
......
](*,)
William
I tested it succesfully with HTTP.
If I try to change the Kommando to HTTPS Nothing goes out and I receive the follwing error:
This message is for C/AL Programmers
The Call to the member send failed. msxml5.dll returned the following message:
The download of the specified resource failed.
I use following automation
'Microsoft XML, v5.0'.XMLHTTP50 = XMLHTTP Variable
I tried this with older ones but still the same.
If my Authorization wasn't correct I receive form the webservice an other message so something is not ok from Navision side.
Who could help me out there?
Navision prompt up the error at the last line here visable.
CLEAR(XMLHTTP);
CLEAR(locautXmlDoc);
CREATE(XMLHTTP);
CREATE(locautXmlDoc);
FileSize.OPEN(XMLsetup."XML Output Path");
FSize:=FileSize.LEN;
FileSize.CLOSE;
locautXmlDoc.async:=FALSE;
locautXmlDoc.load(XMLsetup."XML Output Path");
XMLHTTP.open('POST',Vendor."XML POST Commando",0);
XMLHTTP.setRequestHeader('Content-Type: ',Vendor."XML Content Type");
XMLHTTP.setRequestHeader('Authorization: ', Vendor."XML Auhorization");
XMLHTTP.setRequestHeader('User-Agent: ', Vendor."XML User Agent");
XMLHTTP.setRequestHeader('Host: ',Vendor."XML HOST" );
XMLHTTP.setRequestHeader('Content-Length: ', FORMAT(FSize));
XMLHTTP.setRequestHeader('Connection: ', 'Keep-Alive');
XMLHTTP.setRequestHeader('Cache-Control: ', 'no-cache');
XMLHTTP.send(locautXmlDoc);
locautXmlDoc.load(XMLHTTP.responseXML);
......
](*,)
William
0
Comments
-
Maybe if you try this:
Make this local variables:
Name DataType Subtype Length
lvar Variant
lis InStream
myXML Automation 'Microsoft XML, v4.0'.DOMDocument40
CREATE(myXML);
rest of your code here
....
SoapRequest.send(autXMLDom);
lvar := SoapRequest.responseStream;
lis := lvar;
IF NOT myXML.load(lis) THEN BEGIN
error('some error message')
END ELSE BEGIN
save your xml here or do something else
END;0 -
Sorry But I don't understand what the difference ist.
Here are my variables
XMLHTTP Automation 'Microsoft XML, v6.0'.XMLHTTP60
locautXmlDoc Automation 'Microsoft XML, v5.0'.DOMDocument50
FileSize File
FSize Integer
TestStream InStream
I'm missing how my could will look like if I follow your directions.0 -
No one had ever the same problems with HTTPS ?
I'm curious how you did solve this then: 8)0 -
CLEAR(XMLHTTP);
CLEAR(locautXmlDoc);
CREATE(XMLHTTP);
CREATE(locautXmlDoc);
FileSize.OPEN(XMLsetup."XML Output Path");
FSize:=FileSize.LEN;
FileSize.CLOSE;
locautXmlDoc.async:=FALSE;
locautXmlDoc.load(XMLsetup."XML Output Path");
XMLHTTP.open('POST',Vendor."XML POST Commando",0);
XMLHTTP.setRequestHeader('Content-Type: ',Vendor."XML Content Type");
XMLHTTP.setRequestHeader('Authorization: ', Vendor."XML Auhorization");
XMLHTTP.setRequestHeader('User-Agent: ', Vendor."XML User Agent");
XMLHTTP.setRequestHeader('Host: ',Vendor."XML HOST" );
XMLHTTP.setRequestHeader('Content-Length: ', FORMAT(FSize));
XMLHTTP.setRequestHeader('Connection: ', 'Keep-Alive');
XMLHTTP.setRequestHeader('Cache-Control: ', 'no-cache');
XMLHTTP.send(locautXmlDoc);
//locautXmlDoc.load(XMLHTTP.responseXML);
lvar := SoapRequest.responseStream;
lis := lvar;
IF NOT locautXmlDoc.load(lis) THEN BEGIN
error('some error message')
END ELSE BEGIN
locautXmlDoc.save('c:\temp');
END;
where lvar is a local variable form the type variant
and lis is a local variable from the type instream
I got the same error as you, i solved it by first
using a variant variable en then an instream.
maybe you also have to change this
XMLHTTP.open('POST',Vendor."XML POST Commando",0);
to -->
XMLHTTP.open('POST',Vendor."XML POST Commando",FALSE);0 -
Thanks Activ8 but what varable do you use for
SoapRequest.responseStream0 -
When dubugging Navision stops direct after this Kommand
XMLHTTP.send(locautXmlDoc);0 -
I changed the code and Now Navision crashes everytime I want to POST send the XML file via HTTPS
Name DataType Subtype Length
XMLsetup Record XML Setup
XMLHTTP Automation 'Microsoft XML, v6.0'.XMLHTTP60
locautXmlDoc Automation 'Microsoft XML, v5.0'.DOMDocument50
FileSize File
FSize Integer
TestStream InStream
TestFile File
IintWindowStyle Integer
IblnWaitForEndOfCommand Boolean
OintReturnValue Integer
Laut Automation 'Windows Script Host Object Model'.WshShell
lvar Variant
lis InStream
IF NOT XMLsetup.GET() THEN
MESSAGE('Bitte XML Setup einrichten');
Vendor.GET(PurchaseHeader."Buy-from Vendor No.");
IF PurchaseHeader.XMLStatus<>200 THEN
BEGIN
CLEAR(XMLHTTP);
CLEAR(locautXmlDoc);
CREATE(XMLHTTP);
CREATE(locautXmlDoc);
FileSize.OPEN(XMLsetup."XML Output Path");
FSize:=FileSize.LEN;
FileSize.CLOSE;
locautXmlDoc.async:=FALSE;
locautXmlDoc.load(XMLsetup."XML Output Path");
XMLHTTP.open('POST',Vendor."XML POST Commando",FALSE);
XMLHTTP.setRequestHeader('Content-Type: ',Vendor."XML Content Type");
XMLHTTP.setRequestHeader('Authorization: ', Vendor."XML Auhorization");
XMLHTTP.setRequestHeader('User-Agent: ', Vendor."XML User Agent");
XMLHTTP.setRequestHeader('Host: ',Vendor."XML HOST" );
XMLHTTP.setRequestHeader('Content-Length: ', FORMAT(FSize));
XMLHTTP.setRequestHeader('Connection: ', 'Keep-Alive');
XMLHTTP.setRequestHeader('Cache-Control: ', 'no-cache');
lvar:=XMLHTTP.responseXML;
lis:=lvar;
XMLHTTP.send(locautXmlDoc);
locautXmlDoc.load(lis);
IF XMLHTTP2.status=200 THEN
BEGIN
IF TestFile.OPEN(XMLsetup."XML Receive Path") THEN
TestFile.CLOSE;
IF EXISTS(XMLsetup."XML Receive Path") THEN
ERASE (XMLsetup."XML Receive Path");
locautXmlDoc.save(XMLsetup."XML Receive Path");
TestFile.OPEN(XMLsetup."XML Receive Path");
TestFile.READ(String);
IF STRPOS(String,'<GeneralException>') >0 THEN
BEGIN
TestFile.CREATEINSTREAM(TestStream);
XMLPORT.IMPORT(90002,TestStream);
TestFile.CLOSE;
END ELSE BEGIN
TestFile.CREATEINSTREAM(TestStream);
XMLPORT.IMPORT(90001,TestStream);
TestFile.CLOSE;
Respondsdata.FIND('+');
PurchaseHeader.XMLSalesOrder:=Respondsdata.XMLDocNr;
PurchaseHeader.XMLStatus:=XMLHTTP.status;
PurchaseHeader.XMLStatusDescription:=XMLHTTP.statusText;
PurchaseHeader.XMLDatumSend:=CURRENTDATETIME;
PurchaseHeader.MODIFY;
END;
END;
END ELSE BEGIN
MESSAGE('%1', 'Dies ist bereits geliefert');
END;
CLEAR(XMLHTTP);
CLEAR(locautXmlDoc);0 -
anyone?
iemand?
Jemandem? :roll:0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions