The following steps demonstrates how to expose a function module as a web service in CRM.
Just follow the wizard to finish creation. Choose the appropriate authentication approach according to your use case.
http://jerry.sap.corp:50056/sap/bc/srt/wsdl/flv_10002P111AD1/sdef_url/ZPRODUCTDESCRIPTION3?sap-client=001 click tab WSDL, write down your WSDL link:
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
choose the url got from “how to create web service in CRM”, step3
activate your consumer proxy and write down the ABAP class name.
create a new logical point:
choose HTTPS:
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:
The steps to consume the public web service is almost exactly the same as consuming SAP internal web service. Use the public web service http://www.webservicex.com/FinanceService.asmx?WSDL 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: