| Associated methods | Associated properties |
|---|---|
|
Attach (System.String,System.NET.IPEndPoint,System.Boolean bUseCluster)
Attach (System.String,System.NET.IPEndPoint)
Close
Connect (System.String,System.String,System.NET.IPEndPoint,System.Boolean bUseCluster)
Connect (System.NET.IPEndPoint)
Connect (System.NET.IPEndPoint, System.Boolean)
Connect (System.String,System.String,System.NET.IPEndPoint)
Detach
GetConnectionInfo
IsConnected
PushKey (HostFront.EAI.Key,System.Int32)
PushKey (HostFront.EAI.Key,HostFront.EAI.ScreenIdentifierSystem.Int32)
PushKey (HostFront.EAI.Key,HostFront.EAI.ScreenIdentifier)
PushKey (HostFront.EAI.Key)
PushKey (System.Int32,System.Int32)
PushKey (System.Int32,HostFront.EAI.ScreenIdentifier,System.Int32)
PushKey (System.Int32,HostFront.EAI.ScreenIdentifier)
PushKey (System.Int32)
ReceiveTimeOut
SendTimeOut
TcpLink (HostFront.EAI.Emulation)
|
IsConnected
ReceiveTimeout
SendTimeout
|
| • | 20 — The provided session ID is unknown, meaning that either the session has been disconnected (by the backend host or for any other reason) or that the provided session ID is a wrong one. |
| • | 21 — The session exists but is already attached. |
| • | 20 — The session could not connect to the backend host. Check the event log on the HostFront server. |
| • | 24 — The session did connect but was disconnected either by the backend host or by the HostFront server. Check the event log on the HostFront server. |
| 1. | Impersonating in Web Service: In the Web.config file (in the project of Web Service) add:
<authentication mode="Windows" /> <identity impersonate="true"/> |
| 2. | Setting of IIS: At the virtual directory of the Web Service project, uncheck “Enable anonymous access” and check “Integrated Windows authentication”
|
| 3. | Setting of IE: IE à Tools à Internet Options à Advanced à Security à check “Enable Integrated Windows Authentication (requires restart)”
|
| 4. | Code snippet of impersonation in Web Service:[WebMethod]
public string TestTCP2(string sServer, string sPort)
{
System.Security.Principal.WindowsImpersonationContext ctxt = null;
try
{
//impersonating
System.Security.Principal.WindowsIdentity identity =
(System.Security.Principal.WindowsIdentity)User.Identity;
ctxt = identity.Impersonate();
string s = WindowsIdentity.GetCurrent().Name;
//sServer = Cluser Service ip, sPort = Cluster Service port
HostFront.EAI.TcpLink hostFront = new HostFront.EAI.TcpLink(HostFront.EAI.Emulation.HFM3270);
IPEndPoint end = new IPEndPoint(System.Net.IPAddress.Parse(sServer), Int32.Parse(sPort));
//connect to hostfront by specifing impersonation
hostFront.Connect(end,true);
if(hostFront.IsConnected)
{
return hostFront.ScreenToString();
}
else
{
return hostFront.ErrorMessage;
}
}
catch(Exception ex)
{
return ex.ToString();
}
finally
{
ctxt.Undo();
}
}
|
| 5. | Code snippet of Client of Web Service:EAI.Service1 ws = new EAI.Service1();
ws.Credentials = new System.Net.NetworkCredential(this.txtName.Text,
this.txtPSW.Text);
ws.PreAuthenticate = true;
this.listBox1.Items.Add(ws.TestTCP2(this.textBox1.Text));
|
| • | 20 — The session could not connect to the backend host. Check the event log on the HostFront server. |
| • | 24 — The session did connect but was disconnected either by the backend host or by the HostFront server. Check the event log on the HostFront server. |