实现效果:不用维护服务调用模板,减少重复开发工作,代码更加简洁清晰。

当前示例是基于.net core 6.0,Camstar版本为2310

需要根据Camstar的版本,替换InsiteXMLClient.dll,文件路径为Camstar安装目录/InSite XML Client,并且从.NET Framework转换为.NET Core

一、使用示例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

//为CamstarServiceClient配置CamstarAppServer信息
ServiceConfiguration.Host = "localhost";
ServiceConfiguration.Port =443;
ServiceConfiguration.DefaultPassword = "******";
ServiceConfiguration.DefaultUser = "CamstarAdmin";


Start start = new Start();
start.Details = new StartDetails();
start.Details.ContainerName = "20231201_P_02";
start.Details.StartReason = new StartReasonRef("StartReason_A");
start.Details.Product = new ProductRef("Product_A", null, true);
start.Details.Qty = 10;
start.Details.Level = new ContainerLevelRef("Lot");
start.CurrentStatusDetails = new CurrentStatusStartDetails();
start.CurrentStatusDetails.Workflow = new WorkflowRef("Workflow_A", "1", false);
start.Details.Owner = new OwnerRef("Owner_A");
var result = new ServiceClient("CamstarAdmin", "******").Submit(start);

二、项目地址

github:https://github.com/LicoCode/CamstarServiceClient 代码还在完善中。

git clone: https://github.com/LicoCode/CamstarServiceClient.git