I have a requirement for a Content Server web service to run under Tomcat for a specific client. The problem is that in the Tomcat version of the service, unlike the same service running under IIS, european character encoding is incorrectly handled. For example, "Großküchen" comes across as "Großküchen" The attachment has some screen shots.
For comparison, I looked at the OT DocmanService.GetNode() and discovered it works correctly. I'm at a loss to discern the difference, however, as in both my function as well as GetNode() the text appears as "Großküchen" in Builder right past the point the Service Data Object is written in .SetReturnValue(). It certainly seems that the conversion (or lack of) is happening somewhere in the proxies, most likely on the server side unless the WCF Test Client makes the same mistake.
The original version of my function returned the data as strings without using an SDO, so I created a version that uses an SDO, hoping to force some sort of character encoding/conversion. I also tried explicitly assinging the results of the query to a string first, but none of those approaches worked.
I used the Microsoft WCF Test Client to strip things down to the bare minimum. To test DocManService.GetNode() I created a node with a word in its name copied directly from the table row my function is incorrectly returning, the Name property of the SDO is the correct "Großküchen test1".
But at the point of .SetReturnValue() the SDO.fName has the value of 'Großküchen test1'
The relevant code is for DocManService.GetNode()
nodeSDO.fName = node.pName
and later
retVal = .SetReturnValue( nodeSDO )
I created two different versions of my function trying to solve the problem. Their signatures are here:
{"GetTKLValues","blah",{ \
{ "String fieldName", "blah" }, \
{ "String[] dependencies", "blah } \
},"String[]","blah"}, \
\
{"GetTKLValues2","blah",{ \
{ "String fieldName", "blah" }, \
{ "String[] dependencies", "blah" } \
},"TKLValue[]","blah"}, \
\
They differ only in returning string[] vs TKlValue[]
The original version took the results of a database query, converted it into a list, and set the return value:
returnValue = .SetReturnValue(RecArray.ColumnToList(tklResult,1))
I tried a variant where the query results were explicitly converted into string first:
List tmpL = RecArray.ColumnToList(tklResult,1)
if (Length(tmpL)>0)
if (type(tmpL[1] == Core.StringType)) //either all string or all not
integer i
for (i = 1; i <= Length(tmpL); i+=1)
String tmpS = tmpL[i]
tmpL[i] = tmpS
end
end
end
returnValue = .SetReturnValue(tmpL)
Neither of those worked. Since the only discernible difference between my function and the DocumentManagement.GetNode() was the construction of an SDO, I created a function that does it that way:
List tklValues
dynamic record
for record in tklResult
Object newDef = ._GetSDO( "TKLValue" )
newDef.fStringValue = record[1]
tklValues = {@tklValues,newDef}
end
returnValue = .SetReturnValue(tklValues)
At this point I'm back to square one and would appreciate any insights.