Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3523

SFTP to Proxy with attachment with combined zip.

$
0
0

Hello experts,

 

We have SFTP--->Proxy with attachment .

 

We have XML file which is being placed in SFTP server now we have to zip the XML file and send it as an attachment to proxy with the same name.

 

We have made javampping which will convert the XMl file to proxy attachment .

 

Please let me know the Payload zipbean parameters which i need to keep on sender SFTP adapter to zip the XMl file with the same name.

 

 

 

Below is the javmapping to convert xml to proxy attachment.

 

 

try{

    

      GlobalContainer globalContainer = container.getGlobalContainer();

 

   MappingTrace trace=container.getTrace();

    

      byte[]convertedInput=input.getBytes("UTF-8");

 

 

  

      OutputAttachments outputAttachments = globalContainer.getOutputAttachments();

 

      Attachment outputAttachment;

      String contentType="application/xml";//<could be changed>

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

 

 

     

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

 

 

      String fileName = (conf.get(key));

 

 

      trace.addInfo("filename used for attachment "+ fileName);

 

 

      outputAttachment = outputAttachments.create(fileName,contentType,convertedInput);

 

 

      outputAttachments.setAttachment(outputAttachment);

}

catch(UnsupportedEncodingException e) {

 

e.printStackTrace();

throw new StreamTransformationException(e.getMessage());

}

      return "";

 

 

Now can you please let me know what madification has to be done in abve javamapping to take input as zip file and create it as an proxy attachment with the same name.


Viewing all articles
Browse latest Browse all 3523

Trending Articles



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