HTTPS upload / download

Betrachter84Betrachter84 Member Posts: 62
Hi

I need to upload / downlad EDI (x12) text files via HTTPS. Is there some built in functionality in NAV? Could i still use the Automation Microsoft XML, v6.0'.XMLHTTP if i wasn't to transmitt a .xml but a .txt file with no xml structure?

By the way this is not a lanham implementation, we did it ourself.

Thanks for any tipps!

Comments

  • megawavezmegawavez Member Posts: 133
    No method that I know of in Nav Classic. An automation call is probably your best best.
  • Betrachter84Betrachter84 Member Posts: 62
    that's what i assumed...

    do you have any idea what automation i could look for, is there some windows built in service?
  • megawavezmegawavez Member Posts: 133
    that's what i assumed...

    do you have any idea what automation i could look for, is there some windows built in service?

    Unfortunately not - I'm sure it exists, but will probably take a little hunting. .NET? SOAP? A third party dll? I believe web services in 2009R2 has it, but you'd have to install a webservices instance.
  • koubekkoubek Member Posts: 84
    You can "throw away" HTTPS validation procedure by implementing "ServerCertificateValidationCallback" like this:
    System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
    
    I use it in case of calling NAV HTTPS web services from .NET and it works perfectly:
    WscService01.WSC wsc = new WscService01.WSC();
    wsc.Url = "https://servername:7047/DynamicsNAV/WS/CompanyName/Codeunit/WSName";
    wsc.UseDefaultCredentials = true;
    
    System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
    
    object retVal = wsc.AnyFunction(...params...);
    
    I suppose you can not implement directly a callback function in NAV using .Net interoperability so You have to create some simple COM component (Automation).
Sign In or Register to comment.