none
HIS 2010 Session Integrator - 3270 SDK sample code SessionDisplay.CurrentField throws exception - "The screen is unformatted, no field exists" RRS feed

  • 問題

  • Hello,

    I am new to HIS 2010 Session Integration (and .NET) development.  I have a few comments and questions.

    I have a 64-bit development environment that has BizTalk 2010, SharePoint Foundation 2010, and Host Integration Server 2010 installed. I have been working with our mainframe staff on configuring Host Integration Server 2010. I have successfully configured an IP-DLC Link Service, IP-DLC Connection, and and we have a 5 Display LUs assigned to this Connection. This is the critical element to this entire BizTalk initiative since we want to perform screen scraping utilizing the Session Integration component of HIS 2010. I have made several attempts working with the sample code from the SDK.

    Background - Using the HIS 2010 provided 3270 Client Tool:
    1) We would really like to connect via TN3270E since our mainframe team has provided this option through a <server>:23 server. Using the HIS 2010 provided 3270 Client Tool through this <server>:<port> works perfectly.  You would think that since this Client Tool is provided with the HIS 2010 suite, that it is built using the Microsoft.HostIntegration.SNA.Session library, but it is not!  Why would you not include the code in library form for such a great solution, and have developers avoid this complex configuration if they have the option, and do away with all the 'noise' surrounding this offering?!?!  I can only think that it is the justification for keeping the HIS product installations/licenses going.

    2) Using the 3270 Client Tool with a SNA connection from either a configured LU Pool, or individual Display LU, also works perfectly.

    ---------------------------------------

    Attempt 1:
    Create a connection using:
    m_Handler.Connect("TRANSPORT=SNA;LOGICALUNITNAME=" + LUName.Text);

    This appears to have succeeded, but I notice that an exception in the m_Handler.CurrentField property with:
    "The screen is unformatted, no field exists."

    Searching yields that Microsoft had a hotfix for HIS 2009 (http://support.microsoft.com/kb/2509870):
    FIX: Session Integrator returns a "The screen is unformatted, no field exists" exception when it processes an invalid 3270 control code in a Microsoft Host Integration Server 2009 environment.

    This fix would allow developers to add the following to resolve this problem:
    SessionConnectDisplay.InvalidCharacterSupport = InvalidCharacterAction.Allow;

    As I mentioned, I am running HIS 2010, so I would have thought that this fix (for HIS 2009) would have be included in the HIS 2010 product, but this is not the case, since SessionConnectDisplay.InvalidCharacterSupport does not exist as a property, and the InvalidCharacterAction Enum is not included in the library.  I checked the CU 1 listing for HIS 2010 (http://support.microsoft.com/default.aspx?scid=kb;EN-US;2533330), but it is not there.  So where is it?  I did see it in the HIS 2009 CU 1 listing (http://support.microsoft.com/kb/2587090).  Come on guys, help me out here!!!

    -----------------------------------------------------------------------------

    Attempt 2:
    Next, I tried to use the TN3270 Transport option in the sample code.  According to all of the documentation (as many have bemoaned, you guys really should be ashamed of how anemic it is) I have found on using the Microsoft.HostIntegration.SNA.Session.SessionConnectionDisplay class, you need to interact with a HIS TN3270 Service as opposed to simply providing an external server (e.g. tn3270serrvername:23).  So I have configured our HIS instance with Local and Remote APPC LUs (CICS), and again attempting to connect using the code below yields the same exception as above.

    SessionConnectionDisplay TNDisplay = new SessionConnectionDisplay();
    TNDisplay.DeviceType = TNDeviceType.IBM3279Model2;
    TNDisplay.Transport = SessionDisplayTransport.TN3270;
    TNDisplay.LogicalUnitName = LUName.Text;
    TNDisplay.TN3270Port = 2323;
    TNDisplay.TN3270Server = "myHISserver";

    m_Handler.Connect(TNDisplay);

    ---------------------------------------------------

    Attempt 3:

    SessionLU0 _session = new SessionLU0();
    _session.Connect("LogicalUnitName=" + LUName.Text, SessionLU0InitType.SSCP);

    // receive the logon screen
    SessionLU0Data receivedData = _session.Receive(20000, true);
    // trace out the received data
    //TraceData(false, receivedData.Data, receivedData.Indication);
    ScreenText.ResetText();
    String screen = screen = m_hostConverter.ConvertEbcdicToUnicode(receivedData.Data);

    This is the most successful attempt, as I was able to actually retrieve data from the mainframe - albeit not exactly formatted as I expected. And unfortunately, it is not the desired solution since it does not lend itself easily to the screen scraping / interactions as the 'by-design' SessionDisplay object.

    Thanks for any assistance / guidance.

    Keith


    • 已移動 Dare Obasanjo - MSFT 2011年12月8日 下午 06:45 (From:Live Connect)
    • 已編輯 JKeithK 2011年12月9日 下午 04:16 Solved
    2011年12月8日 下午 06:35

解答

  • Nevermind - I solved the problem.  Turns out I was in the SSCP state, and not in the InSession state.  There's a couple of other points to note here:

    - You need a 'good friend' on the mainframe side to set up the the LUs to respond as expected by the HIS code.

    - Next, understand the Connection's session states, and monitor whichever LU is assigned closely in the Server Admin Console using the Client Tool going against your configured Pool - You might see it go into 'SSCP' first, then you may need to send a logon applid('someAppName')<enter>, then  see it go to the 'InSession' state - at this point you should be ready to receive your sign-in screen.  And to be fair, give credit where credit is due - from the docs:

    LUA Access

    Logical unit application (LUA) is an application programming interface (API) that allows you to write customized applications to communicate with the host. LUA LUs enable programmable control over the SNA messages that are sent between the communications software and the host. LUA LUs can be used to communicate with LU types 0, 1, 2, or 3 at the host as long as the application sends the appropriate SNA messages required by the host.

    An LUA application uses a local LU, which uses Host Integration Server 2006 to communicate with the host system. When Host Integration Server 2006 connects to the host, there are three progressive sessions:

    1. The PU-SSCP between the Host Integration Server 2006 physical unit (PU) and the system services control point (SSCP) on the host.

    2. The SSCP-LU session between the LUA LU at the computer running the application and the SSCP.

    3. The LU-LU session between the LUA LU at the computer running the application and the host LU.

    But, there really ought to be some context for developers here - there is example code, just not associated to the appropriate doc areas.  A simple copy and paste in some critical areas of the docs would go so far to helping folks out there.  This is a developer's toolset!

    There was also confusion caused by the session 'wait' options, which meant not using the

    m_Handler.WaitForSession(

    SessionDisplayWaitType.PLUSLU, 5000); call

    rather, use the:

    m_Handler.WaitForContent("Some string on the welcome screen", 5000); call

    Hope that helps someone else out there.

    Keith


    Keith Knowles
    • 已標示為解答 JKeithK 2011年12月9日 下午 06:01
    2011年12月9日 下午 04:55