使用soapUI消费SAP Cloud for Customer的web service
Hello all,
I am really a newbie to Cloud for Customer world and this is my first blog, very simple but I hope it can help some other newbies just the same as me.
I have been working as an application developer in SAP CRM for 5 years, and in CRM we have dedicated work center to create web service based on CRM standard business object.
Just a quick glance at the modeling UI in CRM.
and now I have to do the same in C4C, let’s say I would like to query C4C Opportunity transaction data in my custom application using standard web service provided in C4C. In order to test this consumption, I choose SoapUI.
Here below is detailed step by step screenshot.
(1) Go to workcenter Administrator, then Input and Output management->Service Explorer, you can get a list of all standard inbound services here.
Download the WSDL for later use.
If you are working in 1605, you can find a list of all standard web services from SAP help:
Since I would like to query Opportunity data, I choose QueryOpportunityIn, and click “Show full documentation”:
The documentation tells me how to fill the request detail in SoapUI.
(2) Download and install SoapUI. Create a new SOAP project by loading the WSDL downloaded from previous step.
Suppose I would like to retrieve this opportunity data in my C4C system by querying its id:
Of source this example might not make much sense from business perspective as in real world we tend to use other criteria like customer name to query Opportunity.
Paste the following xml source code in request view to query on Opportunity 15360.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global" xmlns:zzz="http://sap.com/xi/AP/CustomerExtension/BYD/ZZZZZ">
<soapenv:Header/>
<soapenv:Body>
<glob:OpportunityByElementsQuery_sync_V1>
<!--Optional:-->
<OpportunitySelectionByElements>
<!--Zero or more repetitions:-->
<SelectionByIdentifier>
<!--Optional:-->
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<!--Optional:-->
<LowerBoundaryIdentifier>15360</LowerBoundaryIdentifier>
</SelectionByIdentifier>
</OpportunitySelectionByElements>
</glob:OpportunityByElementsQuery_sync_V1>
</soapenv:Body>
</soapenv:Envelope>
Execute this request, I meet with error message: 401 Unauthorized.
Then I manually maintained my business user and password in request property view:
You might also need to maintain proxy setting for SoapUI according to your network landscape.
Once you have finished all such settings, execute request again and now you can see response as expected:
Update 2017-11-29
In case you meet with error message “Authorization role missing” when consuming web service, you might refer to this blog for help: How to resolve error message when calling Web Service in SoapUI – Authorization role missing
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关文章
- 用 SAP UI5 Select 控件(下拉列表),来驱动表格控件(Table)刷新的一个实战例子试读版
- SAP Fiori 3 的 Quartz Theme 在 WebClient UI 和 SAPGUI 中的应用
- SAP UI5 SimpleForm 控件的 adjustLabelSpan 属性
- SAP UI5 自动化测试工具的 qunit-redirect.js
- SAP API 开发方法大全
- SAP Cloud for Customer最新版本2002 RUI如何启用adaptation模式
- SAP Cloud Platform API management Policy Editor的高级用法
- SAP ABAP bcset激活时,关联的数据库表条目是如何插入的
- SAP Commerce Cloud Spartacus UI 的高阶 reducer 设计
- SAP Commerce Cloud 的 build 过程
- SAP Commerce Cloud 新一代 UI Spartacus 和 Customer Data cloud 的集成
- SAP Cloud for Customer UI Designer里如何消费Object Value Selector(OVS)
- SAP Cloud for Customer Embedded report(嵌入式报表)使用介绍
- SAP Cloud for Customer的Data Source测试
- 如何将bing搜索页面以HTML Mashup的方式嵌入到SAP C4C页面
- SAP Cloud for Customer里Sales Order和Sales Quote的建模方式
- SAP Cloud for Customer的Contact和Account的从属关系
- SAP Cloud for Customer里如何根据产品ID拿到其UUID
- SAP Commerce Cloud Accelerator 的响应式 Theme 介绍
- SAP Commerce Cloud SmartEdit 的安装
- SAP Commerce Cloud WCMS 里的 home 页面和 SAP Spartacus Page API 返回的数据比较
- 如何阻止SAP CRM订单创建好之后,自动被置为传输状态这一行为
- Jerry做SAP CRM开发时写的一个工具类 ZCL_JERRY_TOOL
- SAP CRM Contact和Account的从属关系
- 如何使用SAP Analytics Cloud统计C4C系统每天新建的Lead个数和预测趋势
- 自开发Web应用和SAP Customer Data Cloud Identity服务的集成
- SAP Odata服务里filter的用法
- SAP UI5 初学者教程之三:开始接触第一个 SAP UI5 控件 试读版
- SAP Fiori Elements - Smart table add button debug 2 setDirty
- SAP Fiori globalization实现原理之Amount显示的截断原理
- SAP ABAP 服务器上OData Gateway 框架代码的单步调试