Skip to Content
author's profile photo Former Member
Former Member

Extract fields from the SOAP body during mapping

Hi all,

I have an Abap Proxy to SOAP scenario with a main payload and an attachment. During mapping I need the reference of the attachment to store the reference in the main payload. I don't need the attachment itself.


  <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
- <!--  Eingangs-Message 
- <SAP:Manifest xmlns:SAP="" xmlns:xlink="" xmlns:wsu="" wsu:Id="wsuid-manifest-5CABE13F5C59AB7FE10000000A1551F7">
- <SAP:Payload xlink:href="cid:payload-E742FF47D930DE5CE1000000C107826A">
  <SAP:Description /> 
- <SAP:Payload xlink:href="cid:payload-EE42FF47D930DE5CE1000000C107826A">
  <SAP:Description /> 

I need the attachment reference as string inside my main payload: cid:payload-EE42FF47D930DE5CE1000000C107826A

I wrote an user defined function to select the MessageId, but the MessageId is only part of the reference to the main payload.

String constant;
java.util.Map map;
map = container.getTransformationParameters();

constant = (String) map.get(StreamTransformationConstants.MESSAGE_ID); 
return constant;

Has anybody an idea to get the reference of the attachment from the SOAP body with an user defined function or an adapter module?

Thanks and kind regards


Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 18, 2008 at 07:03 AM


    You can use Dynamic Cofiguration in UDF to accessthese parameters.

    Thanks & Regards,


    • Reward points if find useful.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 21, 2008 at 07:06 AM


    You will try with the "PayloadSwapBean " and "MessageTransformBean"...

    It will work with your requirement.....





    Add comment
    10|10000 characters needed characters exceeded

    • Former Member


      thank you all for the information. I found a solution for my problem on the sender side. I wrote an own helper class with the method create_attach_from_txt_withref. This method build an attachment with an own reference and write the reference back to the payload.

      This reference will not be changed within the execute_asynchronous method of the proxy.

      Method parameters:

      P_DATA        Importing   Type     STRING
      P_TYPE        Importing   Type     STRING
      P_NAME        Importing   Type     STRING
      P_ATTACHMENT  Exporting   Type Ref IF_AI_ATTACHMENT
      P_AREF        Exporting   Type     STRING

      Method coding:

      METHOD create_attach_from_txt_withref.
        DATA: lo_attachment TYPE REF TO cl_ai_attachment,
              l_payload     TYPE REF TO if_xms_payload,
              l_pref        TYPE        sxms_mf_s,
              l_guid        TYPE        guid_32,
              l_aref        TYPE        string.
        CLASS cl_ai_factory DEFINITION LOAD.
      " create the attachment
        p_attachment = cl_ai_factory=>create_attachment_from_text(
                      p_data = p_data             " attachment data
                      p_type = p_type             " attachment type
                      p_name = p_name ).          " attachment name
      " we need an implementing class of the interface if_ai_attachment
        lo_attachment ?= p_attachment.
      " get the new payload
        l_payload = lo_attachment->get_payload( ).
      " get the reference of the payload
        l_pref = l_payload->getreference( ).
      " build an own reference
            ev_guid_32 = l_guid.
        CONCATENATE 'payload-' l_guid '' INTO l_aref.
        CONCATENATE 'cid:'     l_aref            INTO l_pref-href.
      " set our own reference
        l_payload->setreference( reference = l_pref ).
      " write back the modified payload
        lo_attachment->set_payload( p_payload = l_payload ).
      " return of the reference
        p_aref = l_aref.

      If anybody has an idea how to read the soap body within an adapter module please let me know.