Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9069

Re: Exception Caught!! payloadName Error!!

$
0
0

Hi Everyone/ Hi Praveen,

 

     Initially i have provided the setting same as your post. But I am facing the msgkey error. So as a trial and error i just have given the above setting. Here are the below details of my communication channel setting, UDF used in mapping, and module code and error screen shot.

 

Communication Channel Setting:



Module Code:

try

             {          

             //Custom Adapter module  : Module called

            //Reading file name from message header

            attName = moduleContext.getContextData("AttachmentName");

            Payload payload = msg.getAttachment(attName);                  

            MessagePropertyKey fileKey = new MessagePropertyKey("FileName","http://sap.com/xi/XI/System/Mail");

            targetFileName = fileKey.getPropertyName();

           payload.setName(targetFileName);

}


UDF used in the mapping:

 

MappingTrace objTrace = container.getTrace();

DynamicConfiguration objDynConfig;

DynamicConfigurationKey objDCKey;

String Fname = FileName;

objTrace.addInfo(Fname);

final String NAMESPACE = "http://sap.com/xi/XI/System/Mail";

final String ATTRIBUTE1 = "THeaderTO";  //Recipients TO List

final String ATTRIBUTE2 = "THeaderSUBJECT"; // Subject of The Email

//final String ATTRIBUTE3 = "XHeaderName3"; //ContentDisposition

//final String ATTRIBUTE4 = "XHeaderName1";  //ContentType

//final String ATTRIBUTE5 = "XHeaderName2"; //ContentDescription

final String ATTRIBUTE6 = "THeaderCC";  //Recipients BCC List

try

{

objDynConfig = (DynamicConfiguration) container.getTransformationParameters().

get(StreamTransformationConstants.DYNAMIC_CONFIGURATION );

container.setParameter(StreamTransformationConstants.DYNAMIC_CONFIGURATION, objDynConfig);

objDCKey = DynamicConfigurationKey.create(NAMESPACE, ATTRIBUTE1);

objDynConfig.put(objDCKey, ZEmail);

objDCKey = DynamicConfigurationKey.create(NAMESPACE, ATTRIBUTE2);

objDynConfig.put(objDCKey, Subject);

objDCKey = DynamicConfigurationKey.create(NAMESPACE, ATTRIBUTE6);

objDynConfig.put(objDCKey, ZEmailCC);

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

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

conf.put(key,FileName);

}

catch (Exception objException)

{

objTrace.addWarning(objException.getMessage());

}

return "";

 

Error In the Message Log:


 

Also as per your previous reply please confirm whether i need to change the module code to

targetFileName = msg.getMessageProperty(fileKey)  instead of  targetFileName = fileKey.getPropertyName(); or include both.

Kindly help on the same!!!


Viewing all articles
Browse latest Browse all 9069

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>