Error in FilterService.asmx web service

  • 18 October 2006
  • 3 replies
  • 1 view

Badge +1
Hi,

I've tried to use the FilterService included with the workspace. My problem is with the GetData method. When I execute this method I obtain the next error:

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Invalid column name 'UserName'. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at WorkSpaceService.FilterService.GetData(Int32 ReportID, Int32 TemplID, String UserName) --- End of inner exception stack trace

The sintax of the method is:

GetData(reportID, temlID, FQNuser);

Previous I use GetID and it run perfect.

I think the problem is with the k2log database.

Thanks.

Álvaro.

3 replies

Badge +11
Hi avaleros,

I saw the code you posted in the support ticket...
If you use the 'ProcessInstance' report as one of the parameters to the GetID method, you need to use the following overload of the GetData method:
GetData(ReportID, TemplateID, ParameterStr, UserName)

The ParameterStr argument should be in the following format:
UserName:[UserName]|ProcName:[Process Name]|Folder:[Folder]

Hope this helps,
Ockert
Badge +1
Thanks, it runs perfect. I've looked in the KB000021 there are information about this.

Another thing, the mission of this code is can access to the data of k2log, because I need show in a aspx page the state of the process and the history filter by originator. I think that this method is good, no? its better than direct access to k2 log, no?

If I use this method, what is the correct form?

Example: Set the credentials whit a admin user than he has access to the web service and then use the getdata method with a originator parameter for filter the reports. What is the meaning of the UserName parameter?

Thanks for all.

Álvaro.
Badge +11
This method is just fine - as long as it brings back the data you are looking for.

Remember...
1. The FilterService connects directly to the K2Log database.
2. If 'Impersonate Identity' is set to true in WorkspaceService's web.config, every user calling/accessing this report will need permissions on the K2Log database (If Windows Authentication is used in SQL)
3. If 'Impersonate Identity' is set to false in WorkspaceService's web.config, the AppPool ID user will need permissions on the K2Log database (once again if Windows Authentication is used in SQL).

As far as I know, the UserName parameter will NOT act as the 'Originator' filter you're looking for. This UserName is used to see whether the user you are working with has Admin, View or View Participate rights on the processes. If the user has not got any one of the above three permissions, he/she will not have access to any process instances.

You will pobably have to filter your dataset on the 'Originator' once it has been retrieved by the FilterService.

Hope this makes sense,
Ockert

Reply