none
APPC and C# RRS feed

  • Question

  • Does anyone have any sample C# code for interacting with APPC? Specifically, I am trying to make calls to the WinAsyncAPPC method. I am a newbie at this trying to help out some of my BizTalk coworkers. Any help is appreciated.

    Wednesday, January 5, 2011 2:57 PM

Answers

  • Andrew,

    Well, I am done with the code.  I will able to write the code in C#.  I found the CPI-C calls were the better calls.  I have to say that it wasn't as bad as I thought it was going to be.

    The only thing I wish they had done was write sample code the was a little newer the 1994.  I also would have liked to find away to change the LOCAL LU with a CPI-C call.

    I do have a the DLL soure if anyone would like it.

     

    Thanks,

    Frank.

    • Marked as answer by Charles Ezzell Wednesday, February 23, 2011 3:08 PM
    Tuesday, February 8, 2011 12:09 AM

All replies

  • Hi,

    Perhaps you're working with Frank Philips? If so, this question is discussed in this thread:

        http://social.technet.microsoft.com/Forums/en-US/biztalkhis/thread/a2d59b0c-9467-45d2-9965-4446465161a2

    The short answer: it won't work. You can't use your own WinAsyncAPPC calls as part of a TI Component.

    If you're *not* working on the same project as Frank ... well, yes; one can call Windows APPC functions from C#. But it's pretty ugly. You'd need to use P/Invoke. APPC functions work by building a block of parameters in memory, and then calling the function with a pointer to the memory block. So parameters are passed in memory, not on the stack, like with normal Win32 APIs. It is certainly possible to use APPC from C# but it is a challenging programming project for your best programmers. Because the code will be "unsafe" (in .NET terms), it might not be suitable for heavy online transaction processing applications. By far an easier and more robust technique will be to use Transaction Integrator (TI). This lets .NET programmers work in a normal (and "safe") C# environment on the Windowsa side, but still send APPC verbs to the partner app. TI is well-proven in very heavy-duty enterprise applications.

    Hope it helps,

    Andrew

    -- 

    amclar at optusnet dot com dot au

     

    Wednesday, January 5, 2011 9:56 PM
  • Andrew,

    You are right, however this project is one that we cannot in anyway change the interface that we are talking to on the mainframe.  We must call the mainframe with synclevel 1, send the data and breake the session all from one call.  This will generate a EIBCONF = 'FF' and a EIBFREE = 'FF' at the same time.  This cannot be done from TI.  This is why I must call APPC directlly.  The calls that need to be made are not EZ, but I will get it.

    I will keep you posted.

    Frank

    Tuesday, January 11, 2011 1:24 PM
  • Hi Frank

    Yeah, I understand (and sympathise!) with the constraints you're facing. I wish I had better advice for you. Maybe one of the other guys will have some ideas. Let us know how you get on.

    Cheers

    Andrew

    Tuesday, January 11, 2011 8:47 PM
  • Andrew,

    If I am going to build my own APPC send app, where do I get a list of what verbs in order that I have to use?

    Frank

    Thursday, January 13, 2011 1:19 PM
  • Hi Frank,

    The HIS Documentation includes the APPC Programmers' Guide:

        http://msdn.microsoft.com/en-US/library/aa705653(v=BTS.10).aspx

    and the APPC Programmers' Reference:

        http://msdn.microsoft.com/en-US/library/aa771668(v=BTS.10).aspx

    The APPC API provided in HIS closely follows the APPC implementation in the original IBM Comm Manager for OS/2, with a couple of additions for Windows-specific stuff. So at the code level, it is almost identical to the APPC API provided in the current IBM Comm Server for Windows and IBM Personal Communications products. In other words, HIS is very standard, as far as its APPC API goes; not some weird Microsoft implementation unlike any other.

    Generally, the HIS docs don't try to teach you how to program APPC; they kind of assume you already know how APPC works. They just describe the specific parameters and stuff for each verb.

    Hope it helps,

    Andrew

    -- 

    amclar at optusnet dot com dot au

    Friday, January 14, 2011 5:31 AM
  • Andrew,

    Well, I am done with the code.  I will able to write the code in C#.  I found the CPI-C calls were the better calls.  I have to say that it wasn't as bad as I thought it was going to be.

    The only thing I wish they had done was write sample code the was a little newer the 1994.  I also would have liked to find away to change the LOCAL LU with a CPI-C call.

    I do have a the DLL soure if anyone would like it.

     

    Thanks,

    Frank.

    • Marked as answer by Charles Ezzell Wednesday, February 23, 2011 3:08 PM
    Tuesday, February 8, 2011 12:09 AM
  • is it too late to request your dll? :)
    Tuesday, September 8, 2015 9:00 AM