Dear all,
If I try to send an XML file to a webservice via HTTP it works fine.
If I try to do this via HTTPS then an DLL error pops up.
On sevrall threads I read that it should work with another DLL But Navision sends a message now that the XMLHTTP.SetRequestHeader('Content-Type: ',Vendor."XML Content Type"); Command can't be done
The OLe COMMAND gave an unknown message.
Instead of the WinHTTP services I used the Normal HTTP service which gave that previous DLL message wenn using HTTPS.
Who can Help? ](*,)
Name
XMLHTTP 'Microsoft WinHTTP Services, version 5.1'.WinHttpRequest
locautXmlDoc'Microsoft XML, v3.0'.DOMDocument30
Laut 'Windows Script Host Object Model'.WshShell
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');
XMLHTTP.Send(locautXmlDoc);
0
Comments
You'r not using a Client Certificate: Info
SetClientCertificate Method of the IWinHttpRequest Interface
SSL in WinHTTP
WinHttp Https Question
Let us know if this is the solution or not
Rvduuren
I received the client certificate, I installed it etc. I named it Certificate_test
But still that error message about the Next Line SetRequestHeader.
What am I doing wrong?
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.SetClientCertificate('LOCAL_MACHINE\\Personal\\Certificate_test');
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.ResponseText);
DO I forget something?
XMLHTTP.SetClientCertificate('LOCAL_MACHINE\\Personal\\Certificate_test');
XMLHTTP.Open('POST',Vendor."XML POST Commando",FALSE);
](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,)
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n