在SAP ABAP 里consume webservice的全过程

Web Service detail

可以跑通。

The function module being exposed as web service looks like below:

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

展开阅读全文
©️2020 CSDN 皮肤主题: 深蓝海洋 设计师: CSDN官方博客 返回首页
实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值