Options

HHTPS ERROR but HTTP works ??

wwestendorpwwestendorp Member Posts: 178
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);

Comments

  • Options
    rvduurenrvduuren Member Posts: 92
    Hello W. Westendorp,

    You'r not using a Client Certificate:
    XMLHTTP.SetClientCertificate('LOCAL_MACHINE\\Personal\\My Middle-Tier Certificate');
    
    Info
    SetClientCertificate Method of the IWinHttpRequest Interface
    SSL in WinHTTP
    WinHttp Https Question

    Let us know if this is the solution or not :)
    Met vriendelijke groet, best regards,

    Rvduuren
  • Options
    wwestendorpwwestendorp Member Posts: 178
    I'm sorry , I still receive the same message.
    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);
  • Options
    wwestendorpwwestendorp Member Posts: 178
    I tried it also the other way arround but still the same message.

    DO I forget something?

    XMLHTTP.SetClientCertificate('LOCAL_MACHINE\\Personal\\Certificate_test');

    XMLHTTP.Open('POST',Vendor."XML POST Commando",FALSE);

    ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,)
  • Options
    wwestendorpwwestendorp Member Posts: 178
    8-[ Anybody ? :cry:
  • Options
    ara3nara3n Member Posts: 9,256
    was this resolved?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.