cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Encoding in Client Java Proxy

Former Member
0 Kudos

Hi,

We have a Java Proxy -> XI -> JDBC scenario. Since we are working with some special characters, we need to specify the XML encoding in Java Proxy to "UTF-8".

Any idea how to achieve this in Java Proxy.

Regards,

Anurag Mahendru.

Accepted Solutions (0)

Answers (3)

Answers (3)

henrique_pinto
Active Contributor
0 Kudos

You could try to use the wrapped method.

Your xml would be something like:

> <my_message>

> <xml><![CDATA[<?xml version='1.0'

> encoding='UTF-8'?><data><field>1234</field></data>]]>

> </xml>

> </my_message>

To set the encoding for you XML (to be treated as string in your code), just use something like:

> TransformerFactory tf = TransformerFactory.newInstance();

> Transformer trans = tf.newTransformer();

> trans.setOutputProperty(OutputKeys.ENCODING, "UTF-8");

> trans.transform(new DOMSource(this.getDataXML()), new StreamResult(out));

Regards,

Henrique.

stefan_grube
Active Contributor
0 Kudos

The JPR does not set the encoding of the XML explizit, but it is always UTF-8.

Regards

Stefan

GabrielSagaya
Active Contributor
0 Kudos

You can use encoding for your input structure as ISO-8859-1 instead

of UTF-8

How To Work with Character Encodings in Process Integration

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79...

Former Member
0 Kudos

Actually while using the Java Proxies, the XML message formed at XI (Inbound Message) has no encoding specified. In JPF document the XML encoding not specified.

So i was looking for some way in which i can set the encoding in the incoming JPF Document by making some settings to JPR or in the Java Proxy calling code.

Regards,

Anurag Mahendru