encoding for SAP Adapter to xml not work

I try to put data from SAP via RFC into an xml document.

The Problem is that I not get a valid xml file, because the german special caracters like ä or ß are not correct encoded.

My last try was to use the pub.sap.rfc:encode to encode the data into UTF-8. Here for I set the encoding param to “utf-8”. But I still get no valid xml File.

The other think I try was to encode the xml-data with pub.string.stringToByte (encoding= utf-8) and than pub.string:byteToString (encoding = utf-8).

But both ways give me no valid xml File.

Have anyone an idea?

Thanks Jan

Did you try using pub.xml:documentToXMLString and make encode=true.

What is your webMethods version?

I assume encoding=“UTF-8” should work.

yes I try first pub.xml:documentToXMLString with parm: encode=true, but this did not work, so I try to encode the data.

My Version is 8.2

Thanks for your help

ISO-8859-1 - Latin 1

ISO-8859-2 - Latin 2

Try the above ones.

Sorry I get always the same error Message.

I Have try it with utf-8 utf-16

ISO-8859-1 - Latin 1

ISO-8859-2 - Latin 2

but always the same!

Kindly attach if you are authorized to share your package code sample and also the generated output xml file.

In you XML, make sure you have:

<?xml version="1.0" encoding="utf-8"?>

When you write it to file, make sure it’s encoded into utf-8.


I tried with some sample data and it is working.

WebMethods version - 8.2
Invoked Service - documentToXMLString
Input- document with 2 input fields

<?xml version="1.0"?>

ä or ß

Check your XML file again, may be other issue causing the problem.

I don’t know why, but now it works. I have completed the prozess by sending the xml-data via TN for Monitoring issues, and know the xml is valid.

Thanks for your help.