Web report SOAP API encoding issue?

(imported topic written by mingjie91)

Hi.

I was trying to use the SOAP API to access data from the web report. I encountered some issues if the original data contains UTF8 encoded information. Could you help to take a look it is a SOAP server bug, or I did some wrong?

BES Server version: 7.2.1.357.

Steps to recreate the bug:

  1. I create a file as C:\Temp\test.ini. It is UTF8 encoded and contains some Chinese words:

hello world

“07/28/2009 15:55:07” “http://www.eicar.org/download/eicar.com

中文

“07/28/2009 15:55:07” “http://www.eicar.org/download/eicar.com

華語

good bye

!@#$%25^

  1. I created an analysis from BES console which only has one property:

lines of file “C:\Temp\test.ini”

  1. After activated this analysis, I can get the analysis result from Presentation Debugger without any display problem, see attached image:

values of (results ( item 1 of it , applicable computers of item 0 of it )) whose (not error flag of it) of (it , property 1 of it) of fixlet 186 of bes sites whose (name of it = “ActionSite”)

http://lh4.ggpht.com/_2zhIH2RMt0E/SnDVtczyI7I/AAAAAAAAAXw/dylZlGqd2r4/s512/bug1.png

  1. When I tried to call the Session Relevance from SOAP, the returned Chinese words are neither original UTF8, nor percent encoded. I was using the BES Soap sample from http://support.bigfix.com/bes/misc/soapapi.html

Here is the captured packets by wireshark:

http://lh5.ggpht.com/_2zhIH2RMt0E/SnDZZyjlpeI/AAAAAAAAAX0/XbjJuy1HSNU/s640/bug2.png

the expected bytes are: e4b8 ade6 9687, or %.%.

Thanks,

Mingjie.

(imported comment written by BenKus)

Hi Mingjie,

Complicated answer:

The agent doesn’t report the character set of the file it was looking at and the data gets stored in the character set of the database. You can see the characters in the console or the web reports like you showed because you have Windows language packs installed and the browser is smart enough to recognize that those are Chinese characters and display them as such (even though the character set isn’t explicitly defined)… However when you use the SOAP API, the SOAP API actually tries to encode the characters into UTF8, which is the piece that is causing the problem you are seeing…

So the short answer to this is that our Chinese customers with Chinese database character sets will see the results fine for Chinese/English characters in the SOAP API, Japanese customers with Japanese database character sets will see the results fine for Japanese/English characters in the SOAP API, but you will need to change your database character set for this to work properly…

Ben