需求:在C4C UI里创建web service(maintain ticket),然后通过ABSL代码消费。
1. 创建一个新的Communication Arrangement
基于Manage Tickets这个标准的Communication Scenario创建一个Communication Arrangement:
因为我是在当前C4C系统上的ABSL里调用当前C4C系统提供的Web Service,所以Communication System选择Local:
当然这个Local的communication system也是需要在这个地方自己创建一个的:
Authentication method可以维护成"User ID and Password", 给该创建的arrangement维护communication user的password:
将该Arrangement的WSDL下载到本地。
2. 在Cloud Studio里创建一个新的External Web Service Integration:
将第一步下载的WSDL文件夹加载进去:
点击finish,在Studio里能看到自动生成了两个文件。
双击.csd(communication scenario definition), 将Communication Type改为A2X改为:
切换到Services tab, 选择Custom Outbound Services->JerryTicket2->MaintainBundle
激活之后,在Communication Scenario的列表里也能看到JerryTicket2这个communication scenario了。
3. 基于前一步创建的communication scenario JerryTicket2创建一个Communication arrangement。至此C4C配置完成。
ABSL代码如下:
import ABSL;
import AP.CRM.Global;
import AP.Common.GDT;
var ticketReq: JerryTicket2.MaintainBundle.Request;
var SerReq : JerryTicket2.MaintainBundle.Request.ServiceRequestBundleMaintainRequest2_sync.ServiceRequest ;
var SrvReqItem : JerryTicket2.MaintainBundle.Request.ServiceRequestBundleMaintainRequest2_sync.ServiceRequest.Item;
SerReq.actionCode = "06";
SerReq.ID = this.ID;
var counter = 0;
while(counter < 500)
{
SrvReqItem.actionCode = "01"; //Create Item
SrvReqItem.Description.content = "Add item from WS" ;
SrvReqItem.ProductID.content = "P120100";
SrvReqItem.RequestedQuantity.content = 1.0;
SrvReqItem.RequestedQuantity.unitCode = "EA";
SrvReqItem.UserServiceTransactionProcessingTypeCode = "SRP0";
SerReq.Item.Add(SrvReqItem);
counter = counter + 1;
}
ticketReq.ServiceRequestBundleMaintainRequest2_sync.ServiceRequest.Add(SerReq);
var response = Library::JerryTicket2.MaintainBundle(ticketReq,"","JerryTicket2");