• 神奇的瘦身利器让你轻松瘦身,放心变美

免费webservice测试工具(java调用webservice接口)

原创投稿 wpadmin 2年前 (2022-02-12) 168次浏览 0个评论

一、发布webservice

1.se37 创建webservice服务

免费webservice测试工具(java调用webservice接口)

2.TCODE:SOAMANAGER

免费webservice测试工具(java调用webservice接口)

3.定义服务banding:

免费webservice测试工具(java调用webservice接口)
免费webservice测试工具(java调用webservice接口)
免费webservice测试工具(java调用webservice接口)

输入服务名称,点击下一步:

免费webservice测试工具(java调用webservice接口)
免费webservice测试工具(java调用webservice接口)
免费webservice测试工具(java调用webservice接口)
免费webservice测试工具(java调用webservice接口)
免费webservice测试工具(java调用webservice接口)

生成WSDL:

免费webservice测试工具(java调用webservice接口)
免费webservice测试工具(java调用webservice接口)
免费webservice测试工具(java调用webservice接口)

url输入浏览器和sap登录验证信息,测试wsdl:

免费webservice测试工具(java调用webservice接口)
免费webservice测试工具(java调用webservice接口)

至此,webservice发布完成。

二、调用webservice

创建webservice使用

免费webservice测试工具(java调用webservice接口)

选择Service Consumer

免费webservice测试工具(java调用webservice接口)
免费webservice测试工具(java调用webservice接口)
免费webservice测试工具(java调用webservice接口)
免费webservice测试工具(java调用webservice接口)

这里测试用配置个本地对象

免费webservice测试工具(java调用webservice接口)
免费webservice测试工具(java调用webservice接口)

生成代理类:

免费webservice测试工具(java调用webservice接口)

激活所有对象

免费webservice测试工具(java调用webservice接口)

Se80企业服务,可以看到代理类信息:

免费webservice测试工具(java调用webservice接口)

再次回到TCODE:SOAMANAGER,配置代理类的逻辑端口:

免费webservice测试工具(java调用webservice接口)

注意这次搜索”消费者代理”:

免费webservice测试工具(java调用webservice接口)

这里选择基于WSDL配置,后面步骤会比较多,(我测试过其他几个选项都不行):

免费webservice测试工具(java调用webservice接口)

逻辑端口:逻辑端口是指逻辑意义上用于区分服务的端口,如TCP/IP协议中的服务端口,端口号的范围从0到65535,比如用于浏览网页服务的80端口,用于FTP服务的21端口等。由于物理端口和逻辑端口数量较多,为了对端口进行区分,将每个端口进行了编号,这就是端口号。简单来说,ip地址是用来区分主机,端口号是用来区分主机上的不同服务

免费webservice测试工具(java调用webservice接口)
免费webservice测试工具(java调用webservice接口)
免费webservice测试工具(java调用webservice接口)

一直下一步直到完成

Ping web服务

免费webservice测试工具(java调用webservice接口)
免费webservice测试工具(java调用webservice接口)

程序中调用:

DATA:lo_cx_root TYPE REF TO cx_root.

DATA:l_prox_e TYPE REF TO zco_sap_service_port_type.

DATA:lo_sys_exception TYPE REF TO cx_ai_system_fault,

cx_ai_application_fault TYPE REF TO cx_ai_application_fault

IF l_prox_e IS INITIAL.

TRY.

CREATE OBJECT l_prox_e

EXPORTING

logical_port_name = ‘ZLP01’.

CATCH cx_ai_system_fault INTO lo_sys_exception.

IF lo_sys_exception->errortext IS NOT INITIAL.

output-msgty = ‘E’.

output-msgtx = lo_sys_exception->errortext.

APPEND output.CLEAR:output.

EXIT.

ENDIF.

CATCH cx_ai_application_fault INTO cx_ai_application_fault.

ENDTRY.

ENDIF.

invoke_flow_request-in0 = lv_json.

TRY.

CALL METHOD l_prox_e->invoke_flow

EXPORTING

invoke_flow_request = invoke_flow_request

IMPORTING

invoke_flow_response = invoke_flow_response.

CATCH cx_ai_system_fault INTO lo_sys_exception.

IF lo_sys_exception->errortext IS NOT INITIAL.

output-msgty = ‘E’.

output-msgtx = lo_sys_exception->errortext.

APPEND output.CLEAR:output.

EXIT.

ENDIF.

CATCH cx_ai_application_fault INTO cx_ai_application_fault.

ENDTRY.


有肥胖困扰?专业瘦身老师教你1天瘦1斤

添加微信咨询:A-noweixin (手机长按可复制,加好友)

免费webservice测试工具(java调用webservice接口)
已帮助30000+人成功瘦身
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址