0

我正在尝试连接 IBM 通信器 EHLLAPI (PCSHLL32.dll)。

我创建了 webAPI 来连接 IBM PCOMM windows communicator。在视觉工作室中,我能够与沟通者建立联系并且一切正常。但是,当我在 IIS 上部署时,我得到返回 1 作为响应,这意味着未与通信器建立连接或会话无效。

任何人都可以指导我在 IIS 级别上停留的位置。

因此,当我从 Visual Studio 调试时,此处连接获取值“0”,这意味着它已连接。但是当它托管在 IIS 上时,服务返回 1。

为什么我得到 1 而不是 0。

public class EhllapiFunc
{
    [DllImport("PCSHLL32.dll")]
    public static extern UInt32 hllapi(out UInt32 Func, 
      StringBuilder Data, out UInt32 Length, out UInt32 RetC);
}

public static UInt32 Connect(string sessionID) 
{ 
 StringBuilder Data = new StringBuilder(4);
 //Data will contain the ID code of Session

 Data.Append(sessionID);
 UInt32 rc=0;
 UInt32 f=HA_CONNECT_PS; //function code
 UInt32 l=4; //lenght of data parameter
 return  EhllapiFunc.hllapi(out f, Data, out l, out rc);
 //return error code
}

In web api controller 

 public IHttpActionResult Index()
{
var connect= EhllapiClass.Connect("A");
return OK(connect);
}
4

0 回答 0