最详细的使用 soapui 消费 SAP Cloud for Customer Web service 的教程
本文就以SAP Cloud for Customer的web service消費這個需求為例,來講解soapui這個工具的使用步驟。
使用soapui消費web service,最簡單的方式是在soapui里直接導入web service的WSDL文件。
為此,我們需要先拿到SAP C4C標準web service的WSDL文件。
在administator工作中心的input and output management里找到想消費的web service:
點擊超鏈接,把它的WSDL文件下載下來。
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.
下載安裝soapui,此處導入第一步下載的WSDL文件。
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.
把下列的XML字符串復制到soapui面板里:
<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>復制結束之后是這樣的:這段字符串是我給soapui發起的web service的請求負載:
Execute this request, I meet with error message: 401 Unauthorized.
執行soapui請求,遇到了401 錯誤,原來我忘記維護用戶名和密碼了。
Then I manually maintained my business user and password in request property view:
此處維護消費這個web service的用戶名和密碼:
You might also need to maintain proxy setting for SoapUI according to your network landscape.
如果在企業內網的防火墻里使用soapui,還需要在此處設置代理服務器:
Once you have finished all such settings, execute request again and now you can see response as expected:
一切就緒之后,使用soapui能看到web service執行的響應內容了:
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
總結
以上是生活随笔為你收集整理的最详细的使用 soapui 消费 SAP Cloud for Customer Web service 的教程的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SAP CRM configuratio
- 下一篇: 鲁班和孙尚香哪个厉害(鲁大师官方网站)