Skip to Content
avatar image
Former Member

Proxy SOAP Fault

Hi,

I have PROXY to SOAP Sync scenario where ECC calls the proxy via PI. On the other side Web Service ( WS) responds to request & ECC saves that response.

As per the WS standard followed by Client, the Web Service ( WS) has request, response & fault messaged.

If the operation is success it is in Response else it is in fault message.

I have WSDL imported from the Client & created the Data type & message type for ECC Proxy. Since there is fault message to be mapped for WS, Ii have created fault message for ECC side also. This fault is mapped to WS fault & assumption is ECC would get all the errors via this fault.

When the proxy gets generated, i see 3 messages on ECC. However when PI tries to send the fault, in ECC it goes to Standard fault message cx_ai_application_fault instead of custom fault. Due to whcih ECC is not able to get error data.

My question is How to pass the fault data to ECC considering this case does not work. Any other suggestion are also welcome to re design this interface.

PS: We have done the reverse of this ( SOAP to PROXY) and then we did that by passing

Thanks..!!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Feb 13, 2012 at 08:41 PM

    Are you raising exceptions referencing the fault message of proxy regenerated message? This is purely problem at the proxy coding side.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Well yes & No. I pass the fault message of WS to ECC. I can see that message is going to ECC>

      But once it comes to ECC, it become Std Fault, so wondering how to pass my own message.

  • Feb 13, 2012 at 08:43 PM

    Hi Harry,

    I haven't actually developed a scenario like yours, but from your description I can deduct that this cx_ai_application_fault standard exception class might be a superclass for your own one. In such case, try catching the exception of that type first, and then downcasting the exception object to an object of your particular exception type. Give it a try, from the ABAP point of view it should be fine. Example code:

    TRY.
        [call proxy method]
      CATCH cx_ai_application_fault INTO lo_exception.
        lo_yourexception ?= lo_exception.
        [further processing, as required]
    ENDTRY.
    

    Hope this helps,

    Greg

    Add comment
    10|10000 characters needed characters exceeded

  • May 22, 2013 at 09:04 PM

    Hello Harry,

    I read this post with much interest because I am having the same issue and I was wondering, if and how you were able to obtain your custom fault error message?

    Regards,

    Dave

    Add comment
    10|10000 characters needed characters exceeded

    • It's difficult for me to try this without trying to create an example but if you want to update your return table from the ( custom ) exception object, the following code could be used.

      IM_RF_EXCEPTION is the reference to exception object

      and rt_msgtab will be your return table.

      data: ls_bapi_message type bapiret2,
               lv_messag_var type string.

         field-symbols: <fs_attr_val> type any.

         ls_bapi_message-type = 'E'.
         ls_bapi_message-id = im_rf_exception->t100key-msgid.
         ls_bapi_message-number = im_rf_exception->t100key-msgno.
         ls_bapi_message-message = im_rf_exception->get_text( ).
      * Assign the value of message variables
         lv_messag_var = im_rf_exception->t100key-attr1.
         concatenate 'im_rf_exception->' lv_messag_var into lv_messag_var.
         assign  (lv_messag_var) to <fs_attr_val>.
         if <fs_attr_val> is assigned.
           ls_bapi_message-message_v1 = <fs_attr_val>.
         endif.

         lv_messag_var = im_rf_exception->t100key-attr2.
         concatenate 'im_rf_exception->' lv_messag_var into lv_messag_var.
         assign  (lv_messag_var) to <fs_attr_val>.
         if <fs_attr_val> is assigned.
           ls_bapi_message-message_v2 = <fs_attr_val>.
         endif.

         lv_messag_var = im_rf_exception->t100key-attr3.
         concatenate 'im_rf_exception->' lv_messag_var into lv_messag_var.
         assign  (lv_messag_var) to <fs_attr_val>.
         if <fs_attr_val> is assigned.
           ls_bapi_message-message_v3 = <fs_attr_val>.
         endif.

         lv_messag_var = im_rf_exception->t100key-attr4.
         concatenate 'im_rf_exception->' lv_messag_var into lv_messag_var.
         assign  (lv_messag_var) to <fs_attr_val>.
         if <fs_attr_val> is assigned.
           ls_bapi_message-message_v4 = <fs_attr_val>.
         endif.

         append ls_bapi_message to rt_msgtab[].

      Thanks,

      Vikas