我正在尝试创建一种方法来使用核心服务发布和完成工作流活动。我收到编译错误。下面是我的代码。任何人都可以纠正我吗?这是一个紧急的。
public void PublishComponent(string WorkItemId)
{
var client = new SessionAwareCoreServiceClient();
var readoptions = new ReadOptions();
ComponentData component = (ComponentData)client.Read(new TcmUri(WorkItemId), readoptions) as ComponentData;
List<IdentifiableObjectData> ItemToPublish = new List<IdentifiableObjectData>();
ItemToPublish.Add(component);
PublishInstructionData instruction = new PublishInstructionData();
PublicationTargetData pubtarget = (PublicationTargetData)client.Read(new TcmUri("tcm: 0 - 21 - 65537"), readoptions) as PublicationTargetData;
List<PublicationTargetData> target = new List<PublicationTargetData>();
target.Add(pubtarget);
client.Publish(ItemToPublish, instruction, target, PublishPriority.Normal, readoptions);
WorkItemData workitem = new WorkItemData();
workitem.Id = new TcmUri(WorkItemId);
ActivityInstanceData currentactivity = new ActivityInstanceData();
ActivityFinishData finish = new ActivityFinishData();
finish.Message="Published";
client.FinishActivity(currentactivity, finish, readoptions);
}