2021 Jan 19 3:05 PM
I am triggering outbound proxy . It is getting triggered through Delivery output type .
Code related to proxy is getting executed but not sure why I do not see outboud proxy in SXMB_MONI.
I believe I am making some mistake while coding .
Since I am new to Proxy so need some guidance please .
I could not find particular solution in SCN how to debug this kind of proxy issue .
Please find the code below which is used to trigger proxy.
DATA: wa_pdf LIKE LINE OF li_pdf,
g_output TYPE string,
g_outputx TYPE xstring,
g_attach_xstring TYPE xstring,
attch_protocol TYPE REF TO if_wsprotocol_attachments,
zco_pi_object TYPE REF TO zco_si_out_descartes_invoice,
g_attachment TYPE REF TO if_ai_attachment,
g_attachments TYPE prx_attach,
* *Reference variables exception class
lo_sys_exception TYPE REF TO cx_ai_system_fault. "Internal table for attachment.
* * creating proxy object
CREATE OBJECT zco_pi_object.
IF li_pdf[] IS NOT INITIAL.
LOOP AT li_pdf INTO wa_pdf.
CONCATENATE g_output wa_pdf INTO g_output.
ENDLOOP.
ENDIF.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = g_output
* MIMETYPE = ' '
* ENCODING =
IMPORTING
buffer = g_outputx
* EXCEPTIONS
* FAILED = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CONCATENATE g_attach_xstring g_outputx INTO g_attach_xstring IN BYTE MODE.
TRY.
attch_protocol ?= zco_pi_object->get_protocol( if_wsprotocol=>attachments ).
g_attachment = attch_protocol->get_attachment_from_binary(
data = g_attach_xstring
type = if_ai_attachment=>c_mimetype_pdf
name = 'PDF Attachment' ). " Name of PDF to be uploaded
APPEND g_attachment TO g_attachments.
attch_protocol->set_attachments( g_attachments ).
CATCH cx_ai_system_fault INTO lo_sys_exception.
COMMIT WORK.
ENDTRY.
2021 Jan 28 2:47 PM
I am able to trigger the outbound proxy by calling the method created by outbound proxy class as there was no method named execute_asynchronous.
I am triggering outbound proxy . It is getting triggered through Delivery output type .
Code related to proxy is getting executed but not sure why I do not see outboud proxy in SXMB_MONI.
I believe I am making some mistake while coding .
Since I am new to Proxy so need some guidance please .
I could not find particular solution in SCN how to debug this kind of proxy issue .
Please find the code below which is used to trigger proxy.
DATA: wa_pdf LIKE LINE OF li_pdf,
g_output TYPE string,
g_outputx TYPE xstring,
g_attach_xstring TYPE xstring,
attch_protocol TYPE REF TO if_wsprotocol_attachments,
zco_pi_object TYPE REF TO zco_si_out_descartes_invoice,
g_attachment TYPE REF TO if_ai_attachment,
g_attachments TYPE prx_attach,
* *Reference variables exception class
lo_sys_exception TYPE REF TO cx_ai_system_fault. "Internal table for attachment.
* * creating proxy object
CREATE OBJECT zco_pi_object.
IF li_pdf[] IS NOT INITIAL.
LOOP AT li_pdf INTO wa_pdf.
CONCATENATE g_output wa_pdf INTO g_output.
ENDLOOP.
ENDIF.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = g_output
* MIMETYPE = ' '
* ENCODING =
IMPORTING
buffer = g_outputx
* EXCEPTIONS
* FAILED = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CONCATENATE g_attach_xstring g_outputx INTO g_attach_xstring IN BYTE MODE.
TRY.
attch_protocol ?= zco_pi_object->get_protocol( if_wsprotocol=>attachments ).
g_attachment = attch_protocol->get_attachment_from_binary(
data = g_attach_xstring
type = if_ai_attachment=>c_mimetype_pdf
name = 'PDF Attachment' ). " Name of PDF to be uploaded
APPEND g_attachment TO g_attachments.
attch_protocol->set_attachments( g_attachments ).
CATCH cx_ai_system_fault INTO lo_sys_exception.
COMMIT WORK.
ENDTRY.
2021 Jan 19 9:06 PM
??
CATCH cx_ai_system_fault INTO lo_sys_exception.
COMMIT WORK.
Are you sure you have verified that there's no exception at your side?
2021 Jan 20 5:31 AM
sandra.rossi During debugging I found that after the statement
attch_protocol->set_attachments( g_attachments )
Program control skips below catch statement
CATCH cx_ai_system_fault INTO lo_sys_exception.
COMMIT WORK.
I believe this is because there is no exception .
Not able to figure out if there is no exception then why proxy is not getting trigger .
2021 Jan 20 8:09 AM
Okay. By the way, you didn't post the call to the Web Service, you posted only the part where you add an attachment.
2021 Jan 20 11:04 AM
sandra.rossi actually I have not used any web service to send pdf data throgh proxy .
I have followed below link for the coding . Not sure if I am following the right way of coding for outbound proxy .
Kindly let me know if I need to make any correction in my code .
Thanks.
2021 Jan 20 12:32 PM
2021 Jan 20 12:47 PM
sandra.rossi
I thought EXECUTED_ASYNCHRONOUS is only required to send data and since I was only sending PDF file so I did not use this method in my code.
Also while calling method EXECUTED_ASYNCHRONOUS, I am getting error saying "Method EXECUTED_ASYNCHRONOUS is unknown or PROTECTED or PRIVATE" . That means the method is not available in proxy class created by PI .
Is it mandatory to use method EXECUTED_ASYNCHRONOUS , while sending PDF file through proxy ?
2021 Jan 20 1:09 PM
All other methods are used to prepare the request, EXECUTE* is to execute the request.
2021 Jan 20 1:38 PM
okay while calling the method I am getting below error so looks like Method EXECUTED_ASYNCHRONOUS is not available in proxy class .

let me know if you want to cross check anything regarding the above issue.
2021 Jan 28 2:47 PM
I am able to trigger the outbound proxy by calling the method created by outbound proxy class as there was no method named execute_asynchronous.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |