on 10-26-2009 10:06 PM
Hi,
Scenario is JDBC to XML.
My Requirement is to include tag elemt <DOCTYPE> to the target XML. My Message Mapping is Multi Mapping(1:Unbounded)
Written a Java mapping inorder to add the tag to the outbound xml. Java Version JDK 1.3.1 and we are on XI3.0
*************************************************************************************************************************************************************
Javacode
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.Map;
import com.sap.aii.mapping.api.StreamTransformation;
import com.sap.aii.mapping.api.StreamTransformationException;
import com.sap.aii.mapping.api.StreamTransformationConstants;
import com.sap.aii.mapping.api.DynamicConfiguration;
import com.sap.aii.mapping.api.AbstractTrace;
public class ModifyRootAndDelay implements StreamTransformation {
AbstractTrace myTrace;
public void execute(InputStream input, OutputStream output) throws StreamTransformationException {
try{
BufferedReader reader = new BufferedReader(new InputStreamReader(input));
String NameSpacePrefix = "<!DOCTYPE Transaction PUBLIC \"-//innotrac//DTD BatchReceiptAuthorization//EN\" \"http://dtd.innotrac.com/dtds/ReceiptAuthorization.dtd\">";
String sLine = null;
StringBuffer XmlMsg= new StringBuffer();
String Result,PayloadBody;
int indexOfFirst;
while ((sLine = reader.readLine()) != null) {
XmlMsg.append(sLine);
}
String StartingTag = XmlMsg.toString();
indexOfFirst = StartingTag.indexOf("<Transaction>") ;
PayloadBody=new String(XmlMsg.substring(indexOfFirst));
Result=NameSpacePrefix.concat(PayloadBody);
output.write(Result.getBytes());
/* Thread.sleep(200000); */
}catch(Exception e){
myTrace.addWarning("Exception raised in the JavaMapping:modifyNamespace.java"+"\n The Exception Message: "+ e.getMessage());
throw new RuntimeException(e.getMessage()) ;
}
} public void setParameter(Map param) {
myTrace = (AbstractTrace) param
.get(StreamTransformationConstants.MAPPING_TRACE);
}
}
************************************************************************************************************************************************************
But iam getting an error in MONI
***********************************************************************************************************************************************************
<SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
<SAP:Category>XIServer</SAP:Category>
<SAP:Code area="MAPPING">GENERIC</SAP:Code>
<SAP:P1>Parsing error after multi mapping.</SAP:P1>
<SAP:P2>Expected Message<i> instead of MerchantID</SAP:P2>
<SAP:P3 />
<SAP:P4 />
<SAP:AdditionalText />
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack>Parsing error after multi mapping.Expected Message<i> instead of MerchantID</SAP:Stack>
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
*************************************************************************************************************************************************************
Please Suggest me how to resolve the error in moni
Appreciate your Help.
Thanks
Srinivas
Edited by: Srinivas on Oct 26, 2009 6:43 PM
Edited by: Srinivas on Oct 26, 2009 6:44 PM
Edited by: Srinivas on Oct 26, 2009 6:45 PM
Solved myself, written a unix command in the post processing steps in the receiver file adpater
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.