cancel
Showing results for 
Search instead for 
Did you mean: 

Imported java mapping trouble

nicole_bruneau2
Explorer
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

nicole_bruneau2
Explorer
0 Kudos

Thank you. I knew it was something really simple! Am I correct to assume that when I actually run the entire integration, these values will be automatically filled in?

Thanks, again.

Nicole

Answers (0)