Vous êtes sur la page 1sur 6

Howto configure a SOAP Client using Web AS >= 6.

40
Prerequisites

A WSDL of the service ist availabel and valid.


To comunicate encrypted over SSL the SAP Cryptolib is required.

Importing of server certificate

Import with TCODE STRUST the given server certificate into the anonymous SSL-Client
trust store.

Attention: After the import it is necessary to restart the ICM to ensure the activation of
the new certificates.
Configuring RFC Destinations

TCOSE SM 59, ConnectionType G

Configure the use of the SSL-Client in the Folder Security.

Please set the timeout greater than 15 minutes.


Generate ABAP Client Proxy

TCODE SE80
In contextdialogue ( after creating of packages):

After choosing the source the proxy class will be generated.

Creating a logical port

TCODE LPCONFIG

Please mark it as default Port.

Configure in folder call parameters an reference to the HTTP destination.


See:
http://help.sap.com/saphelp_nw04/helpdata/en/16/285d32996b25428dc2eedf2b0eadd8/content.h
tm

Using of client proxy /Sample program


*&---------------------------------------------------------------------*
*& Report /SIE/CHCM_TESTCLIENT
*&
*&---------------------------------------------------------------------*
REPORT

/sie/chcm_testclient.

DATA: proxy TYPE REF TO /sie/co_ifo_hrmaster_data_xml .


TRY.
CREATE OBJECT proxy
EXPORTING
logical_port_name = '/SIE/PORT_TO_XQ1'.
.
CATCH cx_ai_system_fault .
MESSAGE 'Error when creating Web Service Client'
TYPE 'I' DISPLAY LIKE 'E'.
ENDTRY.
*------------------------------------------------------*
DATA: input TYPE /sie/p2_chcmmaster_data .
TRY.
PERFORM fill_input.
CALL METHOD proxy->ifo_hrmaster_data_xml
EXPORTING
input = input.
CATCH cx_ai_system_fault .
MESSAGE 'Error when creating Web Service Client'
TYPE 'I' DISPLAY LIKE 'E'.
CATCH cx_ai_application_fault .
MESSAGE 'Error when creating Web Service Client'
TYPE 'I' DISPLAY LIKE 'E'.
ENDTRY.
*&---------------------------------------------------------------------*
*&
Form fill_input
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM fill_input.
PERFORM fill_header.
PERFORM fill_master_data.
PERFORM fill_trailer.
ENDFORM.
"fill_input
*&---------------------------------------------------------------------*
*&
Form fill_header
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM fill_header.
input-chcmmaster_data-header-date = sy-datum.
input-chcmmaster_data-header-time = sy-uzeit.
input-chcmmaster_data-header-supplier_id = 'DE99'.
input-chcmmaster_data-header-version_number = '1.2'.
ENDFORM.
"fill_header
*&---------------------------------------------------------------------*
*&
Form fill_trailer
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM fill_trailer.
input-chcmmaster_data-trailer-number_of_records = sy-tabix.

ENDFORM.

"fill_trailer

*&---------------------------------------------------------------------*
*&
Form fill_master_data
*&---------------------------------------------------------------------*
FORM fill_master_data.
DATA: t_employee LIKE input-chcmmaster_data-employee_set-employee,
wa_employee LIKE LINE OF input-chcmmaster_data-employee_set-employee.
CLEAR wa_employee.
*------------------------*
wa_employee-sequential_number = '000001'.
*-----------person-------------*
wa_employee-person-personnel_number = '1234012'.
wa_employee-person-gid = 'Z3333333'.
wa_employee-person-sur_name = 'Tester'.
wa_employee-person-first_name = 'Heinrich'.
wa_employee-person-middle_initial = ''.
wa_employee-person-aristocratic_title = ''.
wa_employee-person-sur_name_prefix = ''.
wa_employee-person-sur_name_suffix = ''.
wa_employee-person-nick_name = ''.
wa_employee-person-sur_name2 = ''.
wa_employee-person-title = 'Dr.'.
wa_employee-person-gender = '1'.
wa_employee-person-date_of_birth = '19601224'.
wa_employee-person-nationality1 = 'DE'.
wa_employee-person-nationality2 = ''.
wa_employee-person-nationality3 = ''.
wa_employee-person-highest_education = '01'.
*-----------contract-------------*
wa_employee-contract-contract_type = 'p'.
wa_employee-contract-contract_status = '3'.
wa_employee-contract-position_level = '1'.
wa_employee-contract-weekly_working_time-contractual = '40.0'.
wa_employee-contract-weekly_working_time-standard = '50.0'.
*-----------job_history-------------*
wa_employee-job_history-hire-company_entry_date = '19800101'.
wa_employee-job_history-hire-service_date = '19800101'.
wa_employee-job_history-hire-entry_reason = '01'.
wa_employee-job_history-termination-company_exit_date = '99991231'.
wa_employee-job_history-termination-exit_reason = ''.
*--------------categorisation----------*
wa_employee-categorisation-job_family = '06'.
wa_employee-categorisation-employee_type = '1'.
wa_employee-categorisation-function_type = '1'.
wa_employee-categorisation-senior_management_type = '2'.
*-------------organisation -----------*
wa_employee-organisation-siemens_group_name = 'CIE'.
wa_employee-organisation-are = '7092'.
wa_employee-organisation-location = 'Mch W'.
wa_employee-organisation-department = 'SAG CIO'.
wa_employee-organisation-manager_gid = 'Z7777777'.
wa_employee-organisation-manager_gidplus_one = 'Z6666666'.
*------------------------*
APPEND wa_employee TO t_employee.
*------------------------*
input-chcmmaster_data-employee_set-employee = t_employee.
ENDFORM.

"fill_master_data

Vous aimerez peut-être aussi