The function module being exposed as web service looks like below:
wsdl: http://ldcix3d.wdf.sap.corp:50024/sap/bc/srt/wsdl/flv_10002A111AD1/bndg_url/sap/bc/srt/rfc/sap/zsd_add/700/zadd/zb_add?sap-client=700
SE80, click create button:
select “Service Consumer”:
input WSDL url:
There is a pop up window. Maintain user and password accordingly.
Activate the proxy class, the status should be Active:
- search the just created consumer proxy ZCO_ZSD_ADD in SOAMANAGER:
Create a new logical port:
Click the ping button to ensure the logical port works correctly:
- Create a test report like below:
REPORT ZJERRY_WS_TEST. DATA: LO_PROXY TYPE REF TO ZCO_ZSD_ADD, INPUT TYPE ZADD_OPERATION, OUTPUT TYPE ZADD_OPERATIONRESPONSE. CREATE OBJECT LO_PROXY EXPORTING LOGICAL_PORT_NAME = 'ZJERRY'. INPUT-IV_PARA1 = 1. INPUT-IV_PARA2 = 3. try. CALL METHOD LO_PROXY->ZADD_OPERATION EXPORTING INPUT = INPUT IMPORTING OUTPUT = OUTPUT. CATCH CX_ROOT into DATA(CX_ROOT). WRITE: / CX_ROOT->GET_TEXT( ). RETURN. endtry. WRITE: / 'result: ' , output-RV_RESULT.
Or you can directly test the ABAP consumer proxy class in SE24:
specify the default logical port, and click button “Create Instance”:
specify 3 and 4 as input para1 and input para2:
execute and get expected result 7:
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
来源:https://blog.csdn.net/i042416/article/details/99695085