cancel
Showing results for 
Search instead for 
Did you mean: 

sending file name to proxy XML using ASMA??

Former Member
0 Kudos

Hello Expert,

i have a requirement, i need to send sender side file name into proxy payload.

i can used dynamic configuration to fetch the file name, but its not available in ECC proxy payload.

AS proxy receiver adapter doesn't support ASMA.

how to embedded the file name into payload of proxy.

regards,

Phani

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi China

In your proxy structure, add a field for file name ( for example ) fname. Then map the field fname woth the below UDF

String FileName_input = "";

try
{

DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey Filekey = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

FileName_input=conf.get(Filekey);


return FileName_input;

}

catch (Exception e)
{

}

Make sure that you have choosen the ASMA attribute ( filename)  in sender file adapter .

Answers (1)

Answers (1)

santosh_k3
Active Participant
0 Kudos

Hi,

Use dynamic configuration and get the file name and assign it to the target field of receiver interface.

then you will get the file name in the proxy payload.

Regards,

Sai

Former Member
0 Kudos

Hi,

i have done the same and got below mapping error.

<SAP:Error SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

<SAP:Category>Application</SAP:Category>

<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>

<SAP:P1>com/sap/xi/tf/_MM_Invoice_Img_</SAP:P1>

<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException:</SAP:P2>

<SAP:P3>Content is not allowed in prolog.</SAP:P3>

<SAP:P4 />

<SAP:AdditionalText />

<SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_MM_Invoice_Img_; com.sap.aii.utilxi.misc.api.BaseRuntimeException:Content is not allowed in prolog.</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

santosh_k3
Active Participant
0 Kudos

Hi,

Can you paste the mapping which you have done for the target field along with the UDF?

Regards,

Sai

Former Member
0 Kudos
Former Member
0 Kudos

Hi China

Change your return statement inside the udf. Use

return filename;