cancel
Showing results for 
Search instead for 
Did you mean: 

How to see the content of an attachment in sxmb_moni

Former Member
0 Kudos

Hi all,

Does someone know how to see the actual content of an attachment in sxmb_moni?

If I look under Inbound Message (CENTRAL)/Payloads, I would see one node for MainDocument and another node with the name of the attachment.

When I click on the attachment name, a word document shows with one line in it. That line is just the name of the attachment and nothing else.

How can I see the actual content of that attachment?

Thank you. Points will be awarded to helpful answers.

Regards,

-Michelle

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thank you for your help, all of you.

Former Member
0 Kudos

Sorry, forgot to award points.

Former Member
0 Kudos

The coding is correct. The content sent is actually the file name in hex. So, what we see in the content is correct.

Thanks to Manfred Reinart who recognized the hex string as 'Shots_swcv.doc'.

-Michelle

Former Member
0 Kudos

Hi Michelle,

Probably the mime type of the attachment is application/xml, and then when you click on it the browser try to open it.

To see the content of the attachement you need to download it (Right click on the attachment name -> Download).

Hope this help

Francesco

Former Member
0 Kudos

Hi Francesco,

I checked the mime type, it is application/msword.

So, if the document's name is 'abc.doc'. When I click on the attachment node in sxmb_moni, Word opens a word document, which I don't think it's the original doc. The document that is opened has one line in it says 'abc.doc'.

Best regards,

-Michelle

Former Member
0 Kudos

Hello Michelle

could you please describe your scenario?

how the attachment is generated?

Which adapters are you using?

Best Regards,

Francesco

Former Member
0 Kudos

We are using XI adapter.

This is how the attachment is attached to the message in the backend before execute_synchronous is called:

* create an attachment protocol object from the proxy object
  DATA lo_attachment_protocol TYPE REF TO if_wsprotocol_attachments.
  lo_attachment_protocol ?= io_proxy->get_protocol(
                                      if_wsprotocol=>attachments ).

* create an attachment object from the importing content, type and name
  DATA lo_attachment TYPE REF TO if_ai_attachment.
  lo_attachment  = lo_attachment_protocol->get_attachment_from_binary(
                      data = iv_attachment_content
                      type = iv_attachment_mime_type
                      name = iv_attachment_name
                      ).

* set the attachment
  DATA lt_attachments TYPE prx_attach.
  APPEND lo_attachment TO lt_attachments.

  lo_attachment_protocol->set_attachments( lt_attachments ).

Former Member
0 Kudos

Hi Michelle.

are you sure that iv_attachment_content contains the correct data?

Best Regards,

Francesco

Former Member
0 Kudos

I debugged.

The field iv_attachment_content =

'00530068006F00740073005F0073007700630076002E0064006F0063002000200'.

This is a dummy value I assigned.

Best regards,

-Michelle

Former Member
0 Kudos

Michelle,

which is the system that you are monitoring with sxmb_moni?

The sender system or XI?

If you are looking at xi try to check the message in the sender system, and check if here the attachment is correct.

Best Regards,

Francesco

Former Member
0 Kudos

Francesco,

How do I check the message in the sender system? Through sxmb_moni?

I tried sxmb_moni in the sender system and I see no message.

Best regards,

-Michelle

Former Member
0 Kudos

Hi Michelle,

yes, you have to use sxmb_moni to see the message generated by the abap proxy in the sender system.

You don't see any message because probably the integration engine in the sender system is not configured to show synchronous messages.

If you have the rights add the following parameter in SXMB_ADM -> Integration Engine Configuration -> Specific Configuration:

Category: RUNTIME

Parameter: LOGGING_SYNC

Value: 1

In this way you will be able to see next synchronous messages in the sender system

Best Regards,

Francesco

Former Member
0 Kudos

Francesco,

I configured the IE as you mentioned and ran the scenario again.

ThenI looked at sxmb_moni and found my entry this time.

In the manifest, there are two payloads:

- <SAP:Payload xlink:href="cid:payload-46C2749A8A334C3CE10000000A4248DE@sap.com">
  <SAP:Name>Shots_swcv.doc</SAP:Name> 
  <SAP:Description /> 
  <SAP:Type>ApplicationAttachment</SAP:Type> 
  </SAP:Payload>
- <SAP:Payload xlink:href="cid:payload-46C2749B8A334C3CE10000000A4248DE@sap.com">
  <SAP:Name>MainDocument</SAP:Name> 
  <SAP:Description /> 
  <SAP:Type>Application</SAP:Type> 
  </SAP:Payload>

The top one is my attachment. When I click on the item "Shots_swcv.doc" on the Payload tree, the same thing happened as when I did this in XI system. Word opens a document with a sentence "Shots_swcv.doc". And, that is it.

Best regards,

-Michelle

Former Member
0 Kudos

Hi Michelle,

in my opinion this means that in the client proxy you are attaching a doc with inside that string.

I suggest you to check again your proxy code to really be sure you are loading and managing the correct document.

Best Regards,

Francesco

Former Member
0 Kudos

Francesco,

It seems that way to me too.

I will check my coding again, as you said and will get back to you if I still cannot find anything wrong with it.

Just one question: usually when one clicks the attachment node on the Payload tree, one should already see the content. Is this correct?

Best regards,

-Michelle

Former Member
0 Kudos

I checked my coding again in debug mode. I cannot find anything wrong.

I duplicate here my coding again.

*

   DATA lo_attachment TYPE REF TO if_ai_attachment.
  lo_attachment  = lo_attachment_protocol->get_attachment_from_binary(
                      data = iv_attachment_content
                      type = iv_attachment_mime_type
                      name = iv_attachment_name
                      ).

* set the attachment
  DATA lt_attachments TYPE prx_attach.
  APPEND lo_attachment TO lt_attachments.

  lo_attachment_protocol->set_attachments( lt_attachments ).

The local variable LT_ATTACHMENTS has field payload-resource with the following expected values --

KIND : B

TYPE : application/msword

BINDATA : 00530068006F00740073005F0073007700630076002E0064006F00630020002000

The BINDATA correctly contains the dummy data I assigned.

I must have missed something. Can someone help?

Best regards,

-Michelle

Former Member
0 Kudos

Can you not download the payload through SXMB_MONI from XI?

Former Member
0 Kudos

Yes, I can download or I can just display the file. No problem there.

The problem is with the content. Either I download or display, the file content is just the name of the file itself.

It seems the name of the file get put into the content. But, it is not obvious to me how it happened, as you can see from my coding.

Thank you,

-Michelle

Former Member
0 Kudos

Can someone help?

-Michelle