|
本帖最后由 dwjnhkbc123 于 2021-9-23 19:34 编辑
SAP S4 HANA 已经支持直接调用Socket,所以在调用农业银行,南京银行等Socket接口时无需再进行JAVA开发。
SAP EPIC 银企直连 农业银行 Socket 接口项目实践
WebSocket Communication with ABAP Push Channel using Text Messages
If the form field amc of the URL contains "x", an opened WebSocket receives text messages from the ABAP Messaging Channel DEMO_AMC.
Such messages are then sent in the APC handler class but can also be sent by program DEMO_SEND_AMC.
The program DEMO_RECEIVE_AMC can receive text messages sent by the APC handler class.
If you send the message get handle, you will receive the connection attach handle of the APC-server.
- DATA(event_handler) = NEW apc_handler( ).
-
- "Client
- DATA(client) = cl_apc_tcp_client_manager=>create(
- i_host = ip_adress
- i_port = port
- i_frame = VALUE apc_tcp_frame(
- frame_type =
- if_apc_tcp_frame_types=>co_frame_type_terminator
- terminator =
- terminator )
- i_event_handler = event_handler ).
-
- client->connect( ).
-
- "Send mesasage from client
- DATA(message_manager) = CAST if_apc_wsp_message_manager(
- client->get_message_manager( ) ).
- DATA(message) = CAST if_apc_wsp_message(
- message_manager->create_message( ) ).
- DATA(binary_terminator) = CONV xstring( terminator ).
- DATA(binary_msg) =
- cl_abap_conv_codepage=>create_out( )->convert( msg ).
- CONCATENATE binary_msg binary_terminator
- INTO binary_msg IN BYTE MODE.
- message->set_binary( binary_msg ).
- message_manager->send( message ).
-
- "Wait for a message from server
- CLEAR event_handler->message.
- WAIT FOR PUSH CHANNELS
- UNTIL event_handler->message IS NOT INITIAL
复制代码
|
|