Skip to Content
0

java mapping to handle & not working

Nov 02, 2017 at 08:13 PM

65

avatar image
Former Member

i have used java mapping to replace & with & in XML file.

the whole scenario is working when tested in operation mapping,

But while testing end to end i am getting the same error i.e interface determination error which i used to get before implementing the java mapping (reason for this was & in XML file ).

The interface determination error as resolved when i manually changed and processed the XML through test .

So please let me know if i need to configure something after doing java mapping.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Mark Dihiansan Nov 03, 2017 at 03:34 AM
0

Hi,

Have you reactivated the interface determination? Sometimes it keeps the old mapping.

Regards,

Mark

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Yes mark i have reactivated it but its still not working

0

Hi Abhishek,

Can you attach your payload here? Can you give us a snippet of your java mapping code?

Regards,

Mark

0
Former Member

public class DDN_java_mapping extends AbstractTransformation {

@Override

public void transform(TransformationInput transformationInput, TransformationOutput transformationOutput) throws StreamTransformationException {

try {

InputStream inputstream = transformationInput.getInputPayload().getInputStream();

OutputStream outputstream = transformationOutput.getOutputPayload().getOutputStream();

byte[] b = new byte[inputstream.available()];

inputstream.read(b);

String inputContent = new String(b);

inputContent = inputContent.replaceAll("&", "&");

outputstream.write(inputContent.getBytes());

} catch (Exception exception) { getTrace().addDebugMessage(exception.getMessage()); throw new StreamTransformationException(exception.toString());

}

}

}

0
Evgeniy Kolmakov Nov 07, 2017 at 08:06 AM
0

Hi Abhishek!

I can't catch the aim of replacing the symbol with exactly the same symbol. What do you want to do? Or if it's the editor issue which doesn't show correct representation?

If you have any issues with your xml file contents caused by using '&' symbol within it (which means that your source xml file is not well-formed), you should replace such symbols using escape sequence.

Regards, Evgeniy.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

when i attached the code here it converted the "&" to &

attached the orginal filejavacode.txt

javacode.txt (790 B)
0
avatar image
Former Member Nov 13, 2017 at 03:39 AM
0

Check the status of cache and refresh if required.

Share
10 |10000 characters needed characters left characters exceeded