如何在SAP CRM裡建立和消費Web service
Created by Wang, Jerry, last modified on Dec 19, 2014
The following steps demonstrates how to expose a function module as a web service in CRM.
-
create a FM to return product description by given product ID.
Just use the following source code:
SELECT SINGLE A~short_text INTO rv_text FROM COMM_PRSHTEXT AS A INNER JOIN comm_product AS B ON B~product_id = iv_prod_id AND B~product_guid = A~product_guid.
Make sure the FM is marked as "Remote enabled".
-
start the web service creation wizard:
Just follow the wizard to finish creation. Choose the appropriate authentication approach according to your use case.
-
Once creation is finished, you would find your service definition as below:
click tab WSDL, write down your WSDL link:
-
tcode SOAMANAGER, click Web Service Configuration
you can find your service definition created just now:
click the hyperlink and create a new service:
Make sure you use SSL.
Otherwise, you will meet with the following error code in the runtime. This is simply because web service via HTTP protocal is set as forbidden in Suite landscape and all such communication will be redirected, as set up in SMICM.
click Finish button.
Now your web service is ready for consumer. click this icon:
write down this link for later usage:
How to consume web service in CRM
-
tcode SE80, create a new service consumer:
-
Choose external WSDL:
choose the url got from "how to create web service in CRM", step3
activate your consumer proxy and write down the ABAP class name.
-
go back to SOAMANAGER, find the consumer proxy created in step2:
create a new logical point:
-
Make sure you specify URL got from web service creation last step. If you just use the URL got from SE80 in tab "WSDL", you will meet with below error.
choose HTTPS:
-
consume the web service in ABAP report:
data: lr_proxy TYPE REF TO CO_ZPRODUCTDESCRIPTION4, input TYPE ZGET_PROD_DESCRIPTION, output TYPE ZGET_PROD_DESCRIPTION_RESPONSE. input-iv_prod_id = 'ARNO_TEST004'. CREATE OBJECT lr_proxy EXPORTING LOGICAL_PORT_NAME = 'ZLP_JERRY1'. CALL METHOD lr_proxy->ZGET_PROD_DESCRIPTION EXPORTING input = input IMPORTING output = output.
Now we get the web service execution result:
How to consume public web service in CRM
The steps to consume the public web service is almost exactly the same as consuming SAP internal web service.
Use the public web service
as example.
First it is necessary to verify whether this web service is working correctly for the time being - test it in soapUI:
Just test the consumer proxy class in class builder:
Specify request input just the same as in SoapUI:
Execution result is the same as what we get in SoapUI:
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2222389/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 最詳細的 SAP ABAP Web Service 建立和消費步驟講解Web
- SAP CRM如何建立支援Web Service的word模板Web
- SAP CRM如何建立支援Web Service的PDF模板Web
- 如何在 SAP BTP 平臺 ABAP 程式設計環境裡消費基於 SOAP 的 Web Service程式設計Web
- 如何在Web應用裡消費SAP Leonardo的機器學習APIWeb機器學習API
- 使用soapUI消費SAP Cloud for Customer的web serviceUICloudWeb
- 如何在SAP Server Side JavaScript裡消費destinationServerIDEJavaScript
- 使用nodejs消費SAP Cloud for Customer上的Web serviceNodeJSCloudWeb
- 如何處理消費SAP ABAP Web Service時遇到的Unauthorized錯誤WebZed
- 消費SAP C4C Web Service時遇到的Authorization role missing錯誤Web
- 如何在Kubernetes裡建立一個Nginx serviceNginx
- 如何在SAP C4C裡使用ABSL消費第三方Restful APIRESTAPI
- 使用SAP WebIDE消費API Portal裡建立的API時的錯誤訊息WebIDEAPI
- 在 SAP BAS 裡使用 SAP UI5 應用消費 OData 的 Create 和 Delete 操作UIdelete
- 如何在 SAP Hybris WCMS cockpit 裡建立新的 websiteKPIWeb
- 如何在SAP WebClient UI裡建立柱狀圖(bar chart)WebclientUI
- SAP CRM WebUI, CRM Fiori和C4C裡的Direct NavigationWebUINavigation
- 如何在SAP S4HANA Cloud系統裡建立employeeCloud
- 如何在Android平臺上建立自定義的Cordova外掛並使用SAP UI5消費AndroidUI
- 如何在SAP裡建立configurable material物料主資料
- SAP Gateway Service Builder 裡 Project 的概念GatewayUIProject
- 使用SAP雲平臺的destination消費Internet上的OData service
- 如何在 SAP 電商雲裡使用 Backoffice 和 Smart Edit 建立新的 Content Page
- 如何在 SAP BTP 上使用 Integration Suite 消費 S/4HANA Cloud APIUICloudAPI
- Hybris service layer和SAP CRM WebClient UI架構的橫向比較WebclientUI架構
- 如何處理SAP CRM Web Service錯誤 - Virtual Interface Method XXXX not supportedWeb
- 如何在SAP WebClient UI裡使用jChartFXWebclientUI
- 如何在SAP Cloud Platform ABAP程式設計環境裡建立一個employeeCloudPlatform程式設計
- MassTransit_消費者的建立
- 使用Excel消費C4C的OData serviceExcel
- SAP Cloud for Customer UI Designer裡如何消費Object Value Selector(OVS)CloudUIObject
- SAP QM 如何在SAP系統裡審批掛在Quality Notification裡的document?
- 如何在 WebClient UI 裡建立 Value HelpWebclientUI
- 如何在CRM WebClient UI裡使用HANA Live ReportWebclientUI
- SAP CRM裡Lead通過工作流自動建立Opportunity的原理講解Unity
- SAP Gateway Service Builder 裡的 OData Model 定義方式GatewayUI
- 淺談SAP CRM和Hybris Commerce裡的價格架構折扣架構
- SAP CRM One order裡user status和system status的mapping邏輯APP