Actions 抓不到

Last post 04-14-2008, 12:42 AM by johnny. 10 replies.
Sort Posts: Previous Next
  •  04-09-2008, 7:13 AM 23056

    Actions 抓不到

    使用 aspx 網頁透過 api 去取 WorklistItem

    其中 DataFileds都有抓到,但是Actions都是空的,在Workspace中也可看到 action

    不知有什要注意的?

     感謝您

  •  04-09-2008, 11:14 PM 23080 in reply to 23056

    Re: Actions 抓不到

    Actions是照着你的权限来取的。通常问题是应为:

    1. Developer的aspx网页是放在文件夹而不是IIS。Debug的时候,它会用VS2005的web listener来跑。这会使aspx网页认不到用户的帐号。试试把网页deploy给IIS,然后再测试。
    2. 在aspx网页的web.config,没有设置<identity impersonate=true />。
  •  04-10-2008, 1:41 AM 23084 in reply to 23080

    Re: Actions 抓不到

    Hi  johnny,

          您說的兩項我都有check過了,還是一樣的出不來?

    是否需要

    connection.Impersonateuser(xx)  or

    connnection.OpenWorklistItem(sn) 或 connnection.OpenWorklistItem(sn,"ASP",False)

    感謝您

  •  04-10-2008, 3:45 AM 23090 in reply to 23084

    Re: Actions 抓不到

    要确认的话,最简单是把K2 Server跑在Console mode。然后再测试多一次。从Console你可以看到客户是用什么帐号连到K2 Server。
  •  04-10-2008, 9:01 PM 23121 in reply to 23090

    Re: Actions 抓不到

    用 Impersonate 確實可將身分轉換,確實跟我在Destination User是同一個人,因為在Workspace也正常的出現

    只是透過 aspx 卻抓不出 Actions

     另外不知有人是否知道, client 在 connection 有設定字串可設,這樣可跟 windows 認證結合,不用作身分的轉換?

    這個 connectionSetup要如何下? 文件都找不到? Forums上有人Post SQLUM的方式

    3 Q ...

  •  04-10-2008, 11:02 PM 23124 in reply to 23121

    Re: Actions 抓不到

    在Workspace看到真确的帐号不代表你的aspx网页是一样。最准确还是看看K2 Server Console你的Open Connection是用什么帐号来开,因为Actions是从K2 Server取出来的。所以K2 Server所看到的身份是重点而不是Web Server看到的身份。

  •  04-11-2008, 1:31 AM 23128 in reply to 23124

    Re: Actions 抓不到

    感謝 johnny, 

    使用 impersonate 可以抓到 Actions 了

    不過如何使用 ConnectionSetup 或 其他方式  可用 Windows 認證去取資料呢?

     

  •  04-11-2008, 2:41 AM 23132 in reply to 23128

    Re: Actions 抓不到

    我看如果你有把帐号名跟密码保存在Session state。你可以直接把帐号名跟密码输入ConnectionSetup。看看以下的代码。

    SourceCode.Workflow.Client.Connection conn = null;
    conn = new SourceCode.Workflow.Client.Connection();
    SourceCode.Workflow.Client.ConnectionSetup connSetup = new SourceCode.Workflow.Client.ConnectionSetup();

    connSetup.ConnectionString = string.Format("Integrated=False;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host={0};Port=5252;SecurityLabelName=K2SQL;UserID={1};Password={2};", serverName, txtUserID.Text, txtPassword.Text);

    conn.Open(connSetup);

  •  04-13-2008, 8:13 PM 23157 in reply to 23132

    Re: Actions 抓不到

    Hi johnny,

    這看起來是 DB的認證方式?

    我想用的是 windows 的認證方式,是否把 SecurityLabelName換成 k2 , id password拿掉就可以呢?

    tkx

  •  04-14-2008, 12:42 AM 23163 in reply to 23157

    Re: Actions 抓不到

    基本上如果你用conn.Open("k2servername"),它是用Windows的认证方式。

    可是如果你是用ConnectionSetup的方式,你应该用“Integrated=True”。K2SecurityLabel应该是“K2”。

  •  04-14-2008, 12:42 AM 23164 in reply to 23157

    Re: Actions 抓不到

    基本上如果你用conn.Open("k2servername"),它是用Windows的认证方式。

    可是如果你是用ConnectionSetup的方式,你应该用“Integrated=True”。K2SecurityLabel应该是“K2”。

View as RSS news feed in XML