how to consume a webservice via ABAP proxy

馋奶兔 提交于 2019-11-27 15:58:01

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:

  1. 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:

  1. 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的原创文章,请关注公众号"汪子熙":

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!