Special characters are missing while converting xmlData to Document

Hi,

Can any one help me about this one. I am getting xml data from another application, in webMethods pipeline xml data looks exactly same xml as applicaiton send. When I am tring to convert this xml data to Record using StringToDocument and DocumentToRecord, some of the data(specialcharecters) is missing.

Which special characters? Is the XML string properly encoded? For example, & encoded with &

Vinay

Try using pub.string.HTMLEncode prior to invoking the StringToDocument.

Haithem

Vinay,

In the recordToDocument Service set encode parameter to “true”,then it can accept special chars like &<&gt etc…

HTH…

Hello everybody,

i have the same problem with typical german characters.
I can see ö,ä,ü sending to SAP but they are not in the incomming IDOC.

Already tried encoding with “ISO8859-1”

Any idea?

Thanks,

Dennis

Forgot my password :slight_smile:

Hello Dennis,

It is not clear if you are getting the message from SAP or are you sending the data to SAP. Anyway the correct encoding is ‘ISO-8859-1’ and not ‘ISO8859-1’. Please give more details so that we can help better.

  • Rajesh Rao

Hi Rajesh,

we send the message from wM to SAP.
In our last stap, we get the message out of trading networks (here we can see our ö,ä,ü), decode it and send it to SAP.

When I safe the pipeline after the outbound process, I can see that the ö,ä,ü are manipulated.

So I guess it must be somewhere in the service:

The decoding had no effect.

Dennis

Hi Dennis,

Is the document which you are passing to decode service encoded with ISO-8859-1? If no the best thing is to do convert the document to ISO-8859-1 first and then call the decode service.

Are you having a variable ‘$encoding’ in the pipeline, before you call the decode service?

Is the value of this variable set to ‘ISO-8859-1’.

How is the data displayed in SAP?

  • Rajesh Rao

Hi Dennis,
You should encode the document at the entry point in webMethods. When you use first StringToDocument there is a variable encoding and set this to UTF-8 and this should take care of it.
We do have the special,spanish and french characters inside the documents and thats how we solved specifying UTF-8 encoding.

Just to clearify where these characters are getting messed up in WM or SAP because in WM these characters(ö,ä,ü) are looking fine even if you don’t specify any encoding.

WM supports by default UTF-8 but in our case it did not work and we had to specify explicity.

Try this and it might help.

Regards,
MJ

Many, Many thanks to both of you.

It was just the UTF-8.

It can be so easy :slight_smile:

Dennis

I’m sending Data with & to SAP PI from webMethods but it’s getting failed at SAP Pi as it’s not coming as & can you please guide me how to send encoded format of & to SAP PI. I’M using SAP xi adapters to post data

Have you tried sending it as html character entity, for & it is “&” (ignore the double quotes)

Check the docs for “pub.string:HTMLEncode”