cancel
Showing results for 
Search instead for 
Did you mean: 

Application Acknowledgment Error

Former Member
0 Kudos

Hi Gurus

I' m new at XI and webservices but we have set up a small asynchrone web service on provider and consumer side and we are trying to generate an application error. This is the code that we use. So we raise in all cases an application error.

DATA: l_standard_data TYPE ztestexchange_fault_data,
        l_standard      TYPE ztestexchange_fault_data,
        l_detail_data   type ztestexchange_log_data.

*/ Test 1: Raise an negative application acknowledgement
  l_standard_data-fault_text = 'No name was supplied'.

  l_detail_data-severity       = 'Error'.
  l_detail_data-text           = 'No user found in the incoming File'.
  l_detail_data-id             = '01'.
  l_detail_data-url            = 'Usernull'.

  APPEND l_detail_data TO l_standard-fault_detail.

  RAISE EXCEPTION TYPE ztestcx_ackt_test_fault_messag
    EXPORTING
*    TEXTID =
*    PREVIOUS =
*    AUTOMATIC_RETRY =
*    CONTROLLER =
*    NO_RETRY =
      standard = l_standard_data.

In the monitor sxmb_moni we see always the icon that says no erros is acknowledgment.

What are we doing wrong?

I have read this blog and we done exaclty the same:

Help is much appriciated!!

Kristof

Edited by: Kristof De Bruecker on Jul 17, 2008 9:02 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

In the below coding

l_detail_data-severity       = 'Error'.
  l_detail_data-text           = 'No user found in the incoming File'.
  l_detail_data-id             = '01'.
  l_detail_data-url            = 'Usernull'.
 
  APPEND l_detail_data TO *l_standard*-fault_detail.
 
  RAISE EXCEPTION TYPE ztestcx_ackt_test_fault_messag
    EXPORTING
*    TEXTID =
*    PREVIOUS =
*    AUTOMATIC_RETRY =
*    CONTROLLER =
*    NO_RETRY =
      *standard = l_standard_data.*

Change it to l_standard instead of l_standard_data in raise exception exporting parameters. Because you are appending to l_standard but you are passing l_standard_data.

That will help you

Thanks

Vikranth

Edited by: Khimavath Vikranth on Jul 17, 2008 9:14 AM

Former Member
0 Kudos

Hi Khimavath Vikranth

I have changed the l_standard instead of l_standard_data but the monitor still shown no errors in ack.

Best regards

Kristof

Former Member
0 Kudos

Hi all

We have found the problem.

Apparantly the queue of the providing system was hanging, so the application messages where not executed.

Kristof

Answers (1)

Answers (1)

Former Member
0 Kudos

Make sure you have used this code in Inbound Proxy.

Gaurav Jain

Former Member
0 Kudos

Hi

At consumer side, this is the code for the Acknowledgment:

TRY.
     CREATE OBJECT lo_clientproxy.
*
** get protocol for asynchronous messaging
      lo_async_messaging ?=
         lo_clientproxy->get_protocol( if_wsprotocol=>async_messaging ).

      lv_ack_request = if_wsprotocol_async_messaging=>co_complete_acknowledgment.

      CALL METHOD lo_async_messaging->set_acknowledgment_requested
        EXPORTING
          details = lv_ack_request.
      CALL METHOD lo_clientproxy->ACK_TEST_REQUEST_SAM_ACNT_OUT
        EXPORTING
          output = ls_out.

      lv_msg_id = lo_msg_id_protocol->get_message_id( ).

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait   = 'X'
        IMPORTING
          return = ls_bapiret2.

    CATCH cx_ai_application_fault INTO lo_appl_error.
      o_fct_error = abap_true.
      o_error_msg = lo_appl_error->if_message~get_longtext( ).
      EXIT.
    CATCH cx_ai_system_fault INTO lo_syst_error.
      o_error_msg = lo_syst_error->errortext.
      o_fct_error = abap_true.
      EXIT.
    CATCH cx_root INTO lo_root_error.
      o_tec_error = abap_true.
      o_error_msg = lo_root_error->if_message~get_longtext( ).
      EXIT.