Options

Error handling on outmsg.getstream?

claras2005claras2005 Member Posts: 17
Hi

I am currently programming a system where I can send orders from Navision Attain 3.70 to a linux server via sockets.

I am using the Attain communication components and everything is working fine. I can send the order and get the return message from the server. So fare so good.

But because the system is going to run “automated” in a job scheduler I would like to make it a little more stable towards potential errors. So the first thing I tried was to stop the socket server. And there my problem start. I get a windows error when I do the

OutS := Outmsg.GetStream;

Call.

Are there any way to check that the socket connection is running and catch that status in C/AL code so that I can make my system more stable?

I thought I could you the win socket ocx but when I try to use it from Navision I get a message that I need to use a developer license for the ocx?? Anybody know how I get this?

Comments

  • Options
    claras2005claras2005 Member Posts: 17
    Ok found a dirty solution.

    I created a codeunit that calls my socket logic with and if around the run.

    Now I can catch that there is an error (just not the details about what the error is).

    I would still like info why winsocket don't work from within C/AL if anybody knows the answer.
  • Options
    DenSterDenSter Member Posts: 8,304
    I'm afraid I am not the world's best resource for socket programming, but as far as I understand it, the only parts of socket connection that is exposed in Navision is the 'fire and forget' part.

    There is nothing in the standard Navision objects that allows you to open a continuous socket connection. We had to write our own .NET component to monitor a socket connection and 'convert' the process into something that Navision would understand (we use MSMQ for that part).
  • Options
    claras2005claras2005 Member Posts: 17
    thx for the input.

    I think that my dirty solution will do the job, else you are right then I will have to program my own dll to do the job.

    Wierd that navision only make such a light implementation of a interface, I would have thought that all people need some kind of error handling in their code.
  • Options
    DenSterDenSter Member Posts: 8,304
    Yes you and me both. The limited exposure of commonly used external interface components has been a sore spot for many of us.

    The way I see it... if you're going to expose an object, expose the entire thing. Instead, Navision esposes only parts of them, and sometimes even changes the interface as well.
Sign In or Register to comment.