on 01-30-2007 4:25 PM
Hello.
I'm in the process of moving all of our XI 2.0 applications to XI 3.0. One of these apps uses an imported archive as an interface mapping. I'm getting this error message: "XML not well-formed", when I try to test my mapping in IR.
The java mapping imports the StreamTransformation class, then references the RECEIVER_NAME and RECEIVER_NAMESPACE components. However, these are always blank in the XML being created.
This is a part of my Java mapping:
package wtGas;
import com.sap.aii.mapping.api.StreamTransformation;
import com.sap.aii.mapping.api.StreamTransformationConstants;
import java.io.*;
import java.util.Map;
import java.util.Vector;
import javax.xml.parsers.*;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
public class JM_WTGas extends DefaultHandler implements StreamTransformation {
public void setParameter (Map param){
map = param;
}
public void execute(InputStream in, OutputStream out) throws com.sap.aii.mapping.api.StreamTransformationException {
DefaultHandler handler = this;
SAXParserFactory factory = SAXParserFactory.newInstance();
try{
SAXParser saxParser = factory.newSAXParser();
this.out=out;
saxParser.parse(in, handler);
}catch(Throwable t){
t.printStackTrace();
}
}
public void startDocument() throws SAXException {
write("<?xml version='1.0' encoding='UTF-8'?>");
write("<ns1:" + (String)map.<b>get(StreamTransformationConstants.RECEIVER_NAME)</b> + " xmlns:ns1=\"" + (String)map.<b>get(StreamTransformationConstants.RECEIVER_NAMESPACE)</b>+ "\">");
write("<TABLE2>");
}
public void endDocument() throws SAXException{
write("</ns1:" + (String) map.<b>get(StreamTransformationConstants.RECEIVER_NAME)</b> + ">")
-
-
-
And this is the resulting XML file:
<?xml version='1.0' encoding='UTF-8'?>
<b><ns1: xmlns:ns1=""></b>
<TABLE2>
<item>
<REC_TYPE>0001</REC_TYPE>
<POSTKEY>50</POSTKEY>
<ACCOUNT></ACCOUNT>
<AMOUNT>0000000000000000</AMOUNT>
<TAX_CODE>1o</TAX_CODE>
<JURIS>camb</JURIS>
<BUNIT></BUNIT>
<COST_CTR></COST_CTR>
<ORD_NO></ORD_NO>
<ASSIGNMENT></ASSIGNMENT>
<DET_TEXT></DET_TEXT>
</item>
<b></ns1:></b>
As you can see, it's leaving out the receiver name and namespace. Can anyone tell me what's going on, please? This was working in XI 2.0.
Thank you.
Nicole
Are you doing the single test in the IR ?
If then the streamtransformation map will not be set by default...it needs to be set explicitly...on the 'Test' tab, there are in turn 2 sub tabs 'Document' and 'Parameters'....the streamtransformation values need to be set in the 'Parameters' tab...
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
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.