on 02-02-2011 4:45 AM
Hi Experts,
How to convert the Base-64 format to binary for a file to proxy scenario, where input file is in the doc format.
Is there any code for the custom adaper module?
Please suggest.
Thanks,
Sushama
Hello,
Please check the below mentioned thread:
I guess, you need to modify the java mapping code as per your requirement.
Also check the blog:
/people/farooq.farooqui3/blog/2008/05/22/decode-base64-incoming-encoded-information-in-sap-xipi-using-java-mapping
-Rahul
Edited by: Rahul Kothari on Feb 2, 2011 12:46 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
You can use the logic in your module code, which is provided in the java mapping.
Please find below the document for creating adapter module:
-Rahul
Hello,
I guess no need to implement Stream transformation.
For Module code you only implement SessionBean and Module , as mentioned in the How To...document.
You just need to try to convert the logic mentioned in java mapping as per the Module code.
For adapter module you need to place the logic under ModuleData method.
Please refer to different module blogs:
/people/ganesh.karicharla2/blog/2008/02/20/adapter-module-development-module-configuration
/people/rinku.gangwani/blog/2008/07/16/customized-adapter-module
/people/rinku.gangwani/blog/2008/07/16/customized-sender-adapter-module
-Rahul
Hi Rahul,
Thanks.
I have changed the code. But, seems there's some problem(esp in the decoding part)
import com.sap.aii.af.mp.module.*;
import com.sap.aii.af.ra.ms.api.*;
import com.sap.aii.af.service.auditlog.*;
import com.sap.aii.af.service.cpa.BinaryData;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Hashtable;
import java.util.Iterator;
import javax.ejb.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import sun.misc.BASE64Decoder;
import java.lang.String;
import java.nio.ByteBuffer;
public class CreateAttachmentBean
implements SessionBean
{
private SessionContext myContext;
public CreateAttachmentBean()
{
}
public void ejbRemove()
{
}
public void ejbActivate()
{
}
public void ejbPassivate()
{
}
public void setSessionContext(SessionContext context)
{
myContext = context;
}
public void ejbCreate()
throws CreateException
{
}
public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData)
throws ModuleException
{
Object obj = null;
Message msg = null;
String msgType = null;
String nameSpace = null;
String msgDesc = null;
String FileNameSrc = null;
String contentDesc = null;
String filePath = null;
String fileName = null;
String fileType = null;
int count = 0;
Iterator it = null;
ModuleData outputModuleData = null;
Message MsgNew = null;
XMLPayload xmlpayloadNew = null;
Payload attach_msg = null;
Object objAtt_msg = null;
String attName = null;
Payload plAtt_msg = null;
AuditMessageKey amk = null;
String auditStr = "Inbound Doc";
try
{
obj = inputModuleData.getPrincipalData();
msg = (Message)obj;
msgType = moduleContext.getContextData("msgType");
nameSpace = moduleContext.getContextData("nameSpace");
FileNameSrc = moduleContext.getContextData("FileNameSrc");
Hashtable mp = (Hashtable)inputModuleData.getSupplementalData("module.parameters");
if(msg.getMessageDirection() == MessageDirection.INBOUND)
{
amk = new AuditMessageKey(msg.getMessageId(), AuditDirection.INBOUND);
} else
{
amk = new AuditMessageKey(msg.getMessageId(), AuditDirection.OUTBOUND);
}
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Inbound DocObject created successfully");
try
{
filePath = (String)mp.get("FileName");
int lastInd = filePath.lastIndexOf("
");
lastInd++;
fileName = filePath.substring(lastInd);
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Inbound DocFile Name" + fileName);
}
catch(Exception e)
{
fileName = "Error in File name";
}
XMLPayload xmlpayload = msg.getDocument();
it = msg.getAttachmentIterator();
msgDesc = msg.getDescription();
String xmlDesc = null;
String xmlCont = null;
String xmlName = null;
xmlDesc = xmlpayload.getDescription();
xmlCont = xmlpayload.getContentType();
xmlName = xmlpayload.getName();
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, msgDesc + "mesg Desc");
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, xmlDesc + "xml Desc");
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, xmlCont + "xml Cont");
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, xmlName + "XML name");
if(xmlpayload != null)
{
try
{
Context ctx = new InitialContext();
ConnectionFactory cf = (ConnectionFactory)ctx.lookup("MessagingConnectionFactory");
MessageFactory factory = cf.createMessageFactory("XI");
Message msgnew = factory.createMessage(msg.getFromParty(), msg.getToParty(), msg.getFromService(), msg.getToService(), msg.getAction());
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Inbound Doc New Message msgnew " + msgnew.getProfile());
msgnew.setConversationId(msg.getConversationId());
msgnew.setDeliverySemantics(DeliverySemantics.ExactlyOnce);
xmlpayloadNew = msgnew.createXMLPayload();
xmlpayloadNew.setContent(convertToBase64(xmlpayload, msgType, nameSpace, fileName, count, it, FileNameSrc));
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Inbound DocNew Message xmlpayloadNew " + xmlpayloadNew.getName());
msgnew.setDocument(xmlpayloadNew);
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Inbound DocxmlpayloadNew in msgNew" + msgnew.getMessageId());
inputModuleData.setPrincipalData(msgnew);
}
catch(Exception e)
{
Audit.addAuditLogEntry(amk, AuditLogStatus.ERROR, "Inbound DocError in New Message " + ex2str(e));
}
}
}
catch(Exception exception) { }
return inputModuleData;
}
private byte[] convertToBase64(XMLPayload xmlpayload, String msgType, String nameSpace, String fileName, int count, Iterator it, String FileNameSrc)
throws Exception
{
String ContentType = null;
String ContentDesc = null;
String contentName = null;
String textData = null;
String FileMainName = null;
String encoding = null;
int startPage = 1;
int endPage = 0x7fffffff;
String retXMLData = null;
byte a[] = (byte[])null;
byte binbyt[] = (byte[])null;
String empty = null;
String Att = null;
Payload attach = null;
byte ByteAtt[] = (byte[])null;
XMLPayload xmlpayload1 = null;
String nextStr = null;
Object objAtt = null;
Payload plAtt = null;
String retAttData = null;
String finalAttData = null;
String fileNameAtt = null;
String fileTypeAtt = null;
a = xmlpayload.getContent();
ContentType = xmlpayload.getContentType();
ContentDesc = xmlpayload.getDescription();
contentName = xmlpayload.getName();
//BinaryData b = new BinaryData(a);
//textData = b.toBase64EncodedString();
BASE64Decoder decoder = new BASE64Decoder();
try
{
while(it.hasNext())
{
objAtt = it.next();
attach = (Payload)objAtt;
ByteAtt = attach.getContent();
//
//BinaryData binAttach = new BinaryData(ByteAtt);
Byte b[] = decoder.decodeBuffer(ByteAtt);
//Att = binAttach.toBase64EncodedString();
if(FileNameSrc.compareToIgnoreCase("contentType") == 0)
{
fileNameAtt = attach.getContentType();
} else
if(FileNameSrc.compareToIgnoreCase("contentDesc") == 0)
{
fileNameAtt = attach.getDescription();
}
retAttData = "<Attachment><FileName>" + fileNameAtt + "</FileName>\n" + "<FileType>" + fileTypeAtt + "</FileType>\n" + "<Base64>" + Att + "</Base64>\n" + "</Attachment>\n";
finalAttData = finalAttData + retAttData;
}
}
catch(Exception exception) { }
String FileMainType = null;
int lastInd = 0;
lastInd = fileName.lastIndexOf(".");
lastInd++;
FileMainType = fileName.substring(lastInd);
retXMLData = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns:" + msgType + " xmlns:ns=\"" + nameSpace + "\">\n" + "<Header>" + "<SenderID>" + empty + "</SenderID>\n" + "<SenderDetail>" + empty + "</SenderDetail>\n" + "<ReceiverID>" + empty + "</ReceiverID>\n" + "<ReceiverDetail>" + empty + "</ReceiverDetail>\n" + "<Source>" + empty + "</Source>\n" + "</Header>\n" + "<Attachment>" + "<FileName>" + fileName + "</FileName>\n" + "<FileType>" + FileMainType + "</FileType>\n" + "<Base64>" + textData + "</Base64>\n" + "</Attachment>\n" + finalAttData + "</ns:" + msgType + ">";
return retXMLData.getBytes();
}
private String ex2str(Exception e)
{
StringWriter strWr = new StringWriter();
e.printStackTrace(new PrintWriter(strWr));
return strWr.toString();
}
}
Please Suggest.
Regards,
Sushama
package com.fonterra.InboundDoc;
import com.sap.aii.af.mp.module.*;
import com.sap.aii.af.ra.ms.api.*;
import com.sap.aii.af.service.auditlog.*;
import com.sap.aii.af.service.cpa.BinaryData;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Hashtable;
import java.util.Iterator;
import javax.ejb.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import sun.misc.BASE64Decoder;
import java.lang.String;
import java.nio.ByteBuffer;
public class CreateAttachmentBean
implements SessionBean
{
private SessionContext myContext;
public CreateAttachmentBean()
{
}
public void ejbRemove()
{
}
public void ejbActivate()
{
}
public void ejbPassivate()
{
}
public void setSessionContext(SessionContext context)
{
myContext = context;
}
public void ejbCreate()
throws CreateException
{
}
public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData)
throws ModuleException
{
Object obj = null;
Message msg = null;
String msgType = null;
String nameSpace = null;
String msgDesc = null;
String FileNameSrc = null;
String contentDesc = null;
String filePath = null;
String fileName = null;
String fileType = null;
int count = 0;
Iterator it = null;
ModuleData outputModuleData = null;
Message MsgNew = null;
XMLPayload xmlpayloadNew = null;
Payload attach_msg = null;
Object objAtt_msg = null;
String attName = null;
Payload plAtt_msg = null;
AuditMessageKey amk = null;
String auditStr = "Inbound Doc";
try
{
obj = inputModuleData.getPrincipalData();
msg = (Message)obj;
msgType = moduleContext.getContextData("msgType");
nameSpace = moduleContext.getContextData("nameSpace");
FileNameSrc = moduleContext.getContextData("FileNameSrc");
Hashtable mp = (Hashtable)inputModuleData.getSupplementalData("module.parameters");
if(msg.getMessageDirection() == MessageDirection.INBOUND)
{
amk = new AuditMessageKey(msg.getMessageId(), AuditDirection.INBOUND);
} else
{
amk = new AuditMessageKey(msg.getMessageId(), AuditDirection.OUTBOUND);
}
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Inbound DocObject created successfully");
try
{
filePath = (String)mp.get("FileName");
int lastInd = filePath.lastIndexOf("
");
lastInd++;
fileName = filePath.substring(lastInd);
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Inbound DocFile Name" + fileName);
}
catch(Exception e)
{
fileName = "Error in File name";
}
XMLPayload xmlpayload = msg.getDocument();
it = msg.getAttachmentIterator();
msgDesc = msg.getDescription();
String xmlDesc = null;
String xmlCont = null;
String xmlName = null;
xmlDesc = xmlpayload.getDescription();
xmlCont = xmlpayload.getContentType();
xmlName = xmlpayload.getName();
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, msgDesc + "mesg Desc");
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, xmlDesc + "xml Desc");
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, xmlCont + "xml Cont");
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, xmlName + "XML name");
if(xmlpayload != null)
{
try
{
Context ctx = new InitialContext();
ConnectionFactory cf = (ConnectionFactory)ctx.lookup("MessagingConnectionFactory");
MessageFactory factory = cf.createMessageFactory("XI");
Message msgnew = factory.createMessage(msg.getFromParty(), msg.getToParty(), msg.getFromService(), msg.getToService(), msg.getAction());
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Inbound Doc New Message msgnew " + msgnew.getProfile());
msgnew.setConversationId(msg.getConversationId());
msgnew.setDeliverySemantics(DeliverySemantics.ExactlyOnce);
xmlpayloadNew = msgnew.createXMLPayload();
xmlpayloadNew.setContent(convertToBase64(xmlpayload, msgType, nameSpace, fileName, count, it, FileNameSrc));
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Inbound DocNew Message xmlpayloadNew " + xmlpayloadNew.getName());
msgnew.setDocument(xmlpayloadNew);
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Inbound DocxmlpayloadNew in msgNew" + msgnew.getMessageId());
inputModuleData.setPrincipalData(msgnew);
}
catch(Exception e)
{
Audit.addAuditLogEntry(amk, AuditLogStatus.ERROR, "Inbound DocError in New Message " + ex2str(e));
}
}
}
catch(Exception exception) { }
return inputModuleData;
}
private byte[] convertToBase64(XMLPayload xmlpayload, String msgType, String nameSpace, String fileName, int count, Iterator it, String FileNameSrc)
throws Exception
{
String ContentType = null;
String ContentDesc = null;
String contentName = null;
String textData = null;
String FileMainName = null;
String encoding = null;
int startPage = 1;
int endPage = 0x7fffffff;
String retXMLData = null;
byte a[] = (byte[])null;
byte binbyt[] = (byte[])null;
String empty = null;
String Att = null;
Payload attach = null;
byte ByteAtt[] = (byte[])null;
XMLPayload xmlpayload1 = null;
String nextStr = null;
Object objAtt = null;
Payload plAtt = null;
String retAttData = null;
String finalAttData = null;
String fileNameAtt = null;
String fileTypeAtt = null;
a = xmlpayload.getContent();
ContentType = xmlpayload.getContentType();
ContentDesc = xmlpayload.getDescription();
contentName = xmlpayload.getName();
//BinaryData b = new BinaryData(a);
//textData = b.toBase64EncodedString();
BASE64Decoder decoder = new BASE64Decoder();
try
{
while(it.hasNext())
{
objAtt = it.next();
attach = (Payload)objAtt;
ByteAtt = attach.getContent();
//
//BinaryData binAttach = new BinaryData(ByteAtt);
Byte b[] = decoder.decodeBuffer(ByteAtt);
//Att = binAttach.toBase64EncodedString();
if(FileNameSrc.compareToIgnoreCase("contentType") == 0)
{
fileNameAtt = attach.getContentType();
} else
if(FileNameSrc.compareToIgnoreCase("contentDesc") == 0)
{
fileNameAtt = attach.getDescription();
}
retAttData = "<Attachment><FileName>" + fileNameAtt + "</FileName>\n" + "<FileType>" + fileTypeAtt + "</FileType>\n" + "<Base64>" + Att + "</Base64>\n" + "</Attachment>\n";
finalAttData = finalAttData + retAttData;
}
}
catch(Exception exception) { }
String FileMainType = null;
int lastInd = 0;
lastInd = fileName.lastIndexOf(".");
lastInd++;
FileMainType = fileName.substring(lastInd);
retXMLData = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns:" + msgType + " xmlns:ns=\"" + nameSpace + "\">\n" + "<Header>" + "<SenderID>" + empty + "</SenderID>\n" + "<SenderDetail>" + empty + "</SenderDetail>\n" + "<ReceiverID>" + empty + "</ReceiverID>\n" + "<ReceiverDetail>" + empty + "</ReceiverDetail>\n" + "<Source>" + empty + "</Source>\n" + "</Header>\n" + "<Attachment>" + "<FileName>" + fileName + "</FileName>\n" + "<FileType>" + FileMainType + "</FileType>\n" + "<Base64>" + textData + "</Base64>\n" + "</Attachment>\n" + finalAttData + "</ns:" + msgType + ">";
return retXMLData.getBytes();
}
private String ex2str(Exception e)
{
StringWriter strWr = new StringWriter();
e.printStackTrace(new PrintWriter(strWr));
return strWr.toString();
}
}
package com.fonterra.InboundDoc;
import com.sap.aii.af.mp.module.*;
import com.sap.aii.af.ra.ms.api.*;
import com.sap.aii.af.service.auditlog.*;
import com.sap.aii.af.service.cpa.BinaryData;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Hashtable;
import java.util.Iterator;
import javax.ejb.*;
import javax.naming.Context;
import javax.naming.InitialContext;
public class CreateAttachmentBean
implements SessionBean
{
private SessionContext myContext;
public CreateAttachmentBean()
{
}
public void ejbRemove()
{
}
public void ejbActivate()
{
}
public void ejbPassivate()
{
}
public void setSessionContext(SessionContext context)
{
myContext = context;
}
public void ejbCreate()
throws CreateException
{
}
public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData)
throws ModuleException
{
Object obj = null;
Message msg = null;
String msgType = null;
String nameSpace = null;
String msgDesc = null;
String FileNameSrc = null;
String contentDesc = null;
String filePath = null;
String fileName = null;
String fileType = null;
int count = 0;
Iterator it = null;
ModuleData outputModuleData = null;
Message MsgNew = null;
XMLPayload xmlpayloadNew = null;
Payload attach_msg = null;
Object objAtt_msg = null;
String attName = null;
Payload plAtt_msg = null;
AuditMessageKey amk = null;
String auditStr = "Inbound Doc";
try
{
obj = inputModuleData.getPrincipalData();
msg = (Message)obj;
msgType = moduleContext.getContextData("msgType");
nameSpace = moduleContext.getContextData("nameSpace");
FileNameSrc = moduleContext.getContextData("FileNameSrc");
Hashtable mp = (Hashtable)inputModuleData.getSupplementalData("module.parameters");
if(msg.getMessageDirection() == MessageDirection.INBOUND)
{
amk = new AuditMessageKey(msg.getMessageId(), AuditDirection.INBOUND);
} else
{
amk = new AuditMessageKey(msg.getMessageId(), AuditDirection.OUTBOUND);
}
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Inbound DocObject created successfully");
try
{
filePath = (String)mp.get("FileName");
int lastInd = filePath.lastIndexOf("
");
lastInd++;
fileName = filePath.substring(lastInd);
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Inbound DocFile Name" + fileName);
}
catch(Exception e)
{
fileName = "Error in File name";
}
XMLPayload xmlpayload = msg.getDocument();
it = msg.getAttachmentIterator();
msgDesc = msg.getDescription();
String xmlDesc = null;
String xmlCont = null;
String xmlName = null;
xmlDesc = xmlpayload.getDescription();
xmlCont = xmlpayload.getContentType();
xmlName = xmlpayload.getName();
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, msgDesc + "mesg Desc");
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, xmlDesc + "xml Desc");
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, xmlCont + "xml Cont");
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, xmlName + "XML name");
if(xmlpayload != null)
{
try
{
Context ctx = new InitialContext();
ConnectionFactory cf = (ConnectionFactory)ctx.lookup("MessagingConnectionFactory");
MessageFactory factory = cf.createMessageFactory("XI");
Message msgnew = factory.createMessage(msg.getFromParty(), msg.getToParty(), msg.getFromService(), msg.getToService(), msg.getAction());
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Inbound Doc New Message msgnew " + msgnew.getProfile());
msgnew.setConversationId(msg.getConversationId());
msgnew.setDeliverySemantics(DeliverySemantics.ExactlyOnce);
xmlpayloadNew = msgnew.createXMLPayload();
xmlpayloadNew.setContent(convertToBase64(xmlpayload, msgType, nameSpace, fileName, count, it, FileNameSrc));
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Inbound DocNew Message xmlpayloadNew " + xmlpayloadNew.getName());
msgnew.setDocument(xmlpayloadNew);
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Inbound DocxmlpayloadNew in msgNew" + msgnew.getMessageId());
inputModuleData.setPrincipalData(msgnew);
}
catch(Exception e)
{
Audit.addAuditLogEntry(amk, AuditLogStatus.ERROR, "Inbound DocError in New Message " + ex2str(e));
}
}
}
catch(Exception exception) { }
return inputModuleData;
}
private byte[] convertToBase64(XMLPayload xmlpayload, String msgType, String nameSpace, String fileName, int count, Iterator it, String FileNameSrc)
throws Exception
{
String ContentType = null;
String ContentDesc = null;
String contentName = null;
String textData = null;
String FileMainName = null;
String encoding = null;
int startPage = 1;
int endPage = 0x7fffffff;
String retXMLData = null;
byte a[] = (byte[])null;
byte binbyt[] = (byte[])null;
String empty = null;
String Att = null;
Payload attach = null;
byte ByteAtt[] = (byte[])null;
XMLPayload xmlpayload1 = null;
String nextStr = null;
Object objAtt = null;
Payload plAtt = null;
String retAttData = null;
String finalAttData = null;
String fileNameAtt = null;
String fileTypeAtt = null;
a = xmlpayload.getContent();
ContentType = xmlpayload.getContentType();
ContentDesc = xmlpayload.getDescription();
contentName = xmlpayload.getName();
BinaryData b = new BinaryData(a);
textData = b.toBase64EncodedString();
try
{
while(it.hasNext())
{
objAtt = it.next();
attach = (Payload)objAtt;
ByteAtt = attach.getContent();
BinaryData binAttach = new BinaryData(ByteAtt);
Att = binAttach.toBase64EncodedString();
if(FileNameSrc.compareToIgnoreCase("contentType") == 0)
{
fileNameAtt = attach.getContentType();
} else
if(FileNameSrc.compareToIgnoreCase("contentDesc") == 0)
{
fileNameAtt = attach.getDescription();
}
retAttData = "<Attachment><FileName>" + fileNameAtt + "</FileName>\n" + "<FileType>" + fileTypeAtt + "</FileType>\n" + "<Base64>" + Att + "</Base64>\n" + "</Attachment>\n";
finalAttData = finalAttData + retAttData;
}
}
catch(Exception exception) { }
String FileMainType = null;
int lastInd = 0;
lastInd = fileName.lastIndexOf(".");
lastInd++;
FileMainType = fileName.substring(lastInd);
retXMLData = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns:" + msgType + " xmlns:ns=\"" + nameSpace + "\">\n" + "<Header>" + "<SenderID>" + empty + "</SenderID>\n" + "<SenderDetail>" + empty + "</SenderDetail>\n" + "<ReceiverID>" + empty + "</ReceiverID>\n" + "<ReceiverDetail>" + empty + "</ReceiverDetail>\n" + "<Source>" + empty + "</Source>\n" + "</Header>\n" + "<Attachment>" + "<FileName>" + fileName + "</FileName>\n" + "<FileType>" + FileMainType + "</FileType>\n" + "<Base64>" + textData + "</Base64>\n" + "</Attachment>\n" + finalAttData + "</ns:" + msgType + ">";
return retXMLData.getBytes();
}
private String ex2str(Exception e)
{
StringWriter strWr = new StringWriter();
e.printStackTrace(new PrintWriter(strWr));
return strWr.toString();
}
}
Hi Stefan,
Thanks for the inputs.
Regarding the thread:
The thread is for file to file scenario, whereas I am using file to proxy scenario. Moreover, the module for binary to base 64 encryption is already written(pasted earlier post). So I was thinking to modify the same code.But no luck so far ..
Secondly, using ABAP..did u mean by abap mapping?
How will i use the program.i suppose in mapping?
Please suggest.
Regards,
Sushama
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.