cancel
Showing results for 
Search instead for 
Did you mean: 

Soap adapter default encoding

Former Member
0 Kudos

Hi there,

we have a XI <-> webservice scenario, where the XML messages are sent in a string (the wsdl is wrapped, literal) with digital signing.

As of now, we have a problem in the digital signing, since the webservice won't validate the signature. We made some tests and this is what I've concluded.

From what I've observed, there are three ways of sending XML file content in a string (let me know if there are more). They are:

1. putting the xml content between "<![CDATA[" and "]]>";

2. replacing '<', '>' and '"' with "&lt;", "&gt;" and "&quot;";

3. replacing '<' and '>' with "&#60;" and "&#62;".

2 and 3 appear to be different encodings.

We tried to send three messages to a test webservice, each with a different way of defining the string, using receiver soap adapter. This test webservice was located in a local machine and we ran a sniffer on it. The three incoming messages were logged by the sniffer, but the upseting news were that the three of them had the same encoding in the input string, which was the third one above ("&#60;" and "&#62;", which by the way is the default by UTF-8).

This only occurs when using SOAP adapter. I tested File adapter and it sent the file exactly how delivered by the sender service (meaning, with the different encodes or with CDATA). We even thought about using module processor for replacing the characters in the message, but since any custom module processor comes before the main adapter module processor, it won't have any effect on the final message.

Using XMLSpy, I sent some test messages to our digital signer (which is also a webservice) with the three ways and it returned a different output when using "&lt;" encoding in the input. Then, I sent this signed message to the webservice and it validated the signature!

We are suspecting that the webserver (which is IBM's WebSphere) always converts the input string to "&lt;", and when they calculate the message hash code, it's different from what we sent (since we always sign a "&#60;" encoded message).

My question is: is there any way of changing the default encode that the soap adapter module processor uses? Or at least of making it not changing the encode of the payload? If it were possible, we would send the message to the signer webservice with "&lt;" encoding and the problem would be solved.

Thanks in advance,

Henrique.

Accepted Solutions (0)

Answers (3)

Answers (3)

henrique_pinto
Active Contributor
0 Kudos

Hi there, I reopened this question because just changing the parameter didn't help out. In the sniffer, the message continues to arrive with &#60; 😕

So, if anyone can help out, I'd appreciate.

Thanks,

Henrique.

Former Member
0 Kudos

Hi Henrique

Did you solve this, we have the same problem. Help is needed!!!

Regards,

Morten

henrique_pinto
Active Contributor
0 Kudos

Morten,

actually, we've found out that &#60; = &lt; , in both UTF-8 and ISO-8859-1 encodings. It makes no difference if you use one or the other.

The point which was troublesome for us were the special characters (like á,â,à,ã,é, etc) which have different encoding for UTF-8 and ISO-8859-1. Since we had identified that the service we were accessing wasn't able to identify these characters properly, we just removed them from the string fields and that worked out for us.

Hope it helps you out.

Regards,

Henrique.

bhavesh_kantilal
Active Contributor
0 Kudos

Henrique,

Appreciate keeping this thread alive and updating on your learnings

Regards,

Bhavesh

henrique_pinto
Active Contributor
0 Kudos

That's what we're here for. 🐵

Henrique.

Former Member
0 Kudos

Hi,

Is that the only solution for that problem? I've tried everything I could think of to solve it and i'm still stuck. unfortunately I can't just remove those special characters.

Is it a problem with the soap adapter?

Thx

henrique_pinto
Active Contributor
0 Kudos

Friends,

I've found how to use ISO-8859-1 encoding on soap receiver adapter.

"If you want to change this encoding, for instance to iso-8859-1, you can set parameter XMBWS.XMLEncoding to iso-8859-1 in the module configuration for the SOAP adapter module."

I found this out on SAP Note 856597.

Hope it helps someone,

Henrique.

henrique_pinto
Active Contributor
0 Kudos

I found out that I need to use ISO-8859-1 instead of UTF-8.

How to set this in Soap Adapter?

Thanks in advance,

Henrique.