Hi Niks,
From your error, you are trying to return the WorklistItem type from WCF to the SourceCode.Workflow.Client's WorklistItem type, which are different. You need to use the WorklistItem type from the wcf object.
I'm not good with WCF, but here is an code example which configures pretty much everything in the code level.
Good luck.
JK.
// K2WCF is my service reference
public void OpenWorkListWCF()
{
Console.WriteLine("Executing OpenWorkListWCF");
BasicHttpBinding basicHttpBinding = new BasicHttpBinding();
basicHttpBinding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
basicHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
EndpointAddress endpoint = new EndpointAddress("http://k2.denallix.com/k2services/WCF.svc/Worklist");
K2WCF.WorklistNavigationServiceClient svc = new K2WCF.WorklistNavigationServiceClient(basicHttpBinding, endpoint);
svc.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
//svc.ChannelFactory.Credentials.Windows.ClientCredential = new System.Net.NetworkCredential(strLogin, strPassword, strDomain);
try
{
svc.Open();
/* actDataField = Activity level data field
* actXmlField = Activity level xml field
* piDataField = Process Instance level data field
* piXmlField = Process Instance level xml field
*/
K2WCF.WorklistItems] worklist = svc.OpenWorklist(false, false, false, false);
foreach (K2WCF.WorklistItem item in worklist)
{
Console.WriteLine("{0}, {1}, {2}", item.SerialNumber, item.ProcessInstance.Folio, item.Status.ToString());
}
}
catch (Exception ex)
{
svc.Abort();
throw ex;
}
finally
{
if (svc != null)
svc.Close();
}
}
Hi Jk,
Thanks for you reply. i will check and let you know.