本篇内容主要讲解“怎么在SAP C4C里使用ABSL消费第三方Restful API”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“怎么在SAP C4C里使用ABSL消费第三方Restful API”吧!
首先我们得有一个可以正常工作的Restful API:
然后在Cloud for Customer的Cloud Application Studio里创建Restful API的模型,把第一步可以正常工作的Restful API url填进模型里去:
然后在ABSL里使用如下代码进行消费:
import ABSL;if( this.OutboundDeliveryID.IsInitial() == false){ raise already_delivered.Create("E"); return;}var HttpMethod = "GET";var HttpResource = ""; // not requiredvar ContentType = ""; // not requiredvar Body = ""; // not requiredvar HeaderParameter : collectionof NameAndValue; // not requiredvar URLParameter : collectionof NameAndValue;var URLParameterEntry : NameAndValue;URLParameterEntry.Name = "SoID";URLParameterEntry.Value = this.ID.content;URLParameter.Add(URLParameterEntry);var response = WebServiceUtilities.ExecuteRESTService("JerryExternalService", "JerryExternal", HttpMethod, HttpResource,URLParameter, HeaderParameter,ContentType, Body);this.OutboundDeliveryID = response.Content;raise delivery_message.Create("S", this.OutboundDeliveryID);
到此,相信大家对“怎么在SAP C4C里使用ABSL消费第三方Restful API”有了更深的了解,不妨来实际操作一番吧!这里是编程网网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!