Abap WebService , C# List type parameter method
Merhaba ,
C# webservice parametre olarak list tipi alması ve abap tarafında kullanımına dair örnek aşağıdaki gibidir.
Örnekteki servis metodu ;
List tipi için class tanımı
Metod
Web Service bağlantısından (tcod: se80 , Enterp. Services –> Service Consumer) sonra program kodları şu şekilde.
REPORT ztp_servis_list_parametre_gon.
DATA : BEGIN OF works_items OCCURS 0,
date_time TYPE string,
orderid TYPE i,
END OF works_items.
DATA proxy_test TYPE REF TO ztp_genel_wsco_web_service_soa.
DATA: exc TYPE REF TO cx_root.
DATA: msg TYPE string.
TRY.
“”””””””””””””””””””
CREATE OBJECT proxy_test
EXPORTING
logical_port_name = ‘DEFAULT’.
“”””””””””””””””
IF proxy_test IS NOT BOUND.
CREATE OBJECT proxy_test TYPE ztp_genel_wsco_web_service_soa.
ENDIF.
DATA: input TYPE ztp_genel_wslist_test_method_1,
output TYPE ztp_genel_wslist_test_method_s.
DATA : wa_input TYPE ztp_genel_wswork_orders.
works_items–date_time = sy–datum.
works_items–orderid = 1.
APPEND works_items.
works_items–date_time = sy–datum.
works_items–orderid = 2.
APPEND works_items.
LOOP AT works_items.
wa_input–date_time = works_items–date_time.
wa_input–orderid = works_items–orderid.
APPEND wa_input TO input–data–work_orders.
ENDLOOP.
CALL METHOD proxy_test->list_test_method ” Web Service Method Name
EXPORTING
input = input
IMPORTING
output = output.
FORMAT INVERSE ON.
WRITE :/ output–list_test_method_result.
CATCH cx_ai_system_fault INTO exc.
msg = exc->get_text( ).
WRITE:/ msg.
ENDTRY.