QUSIR / staff

Automatically exported from code.google.com/p/staff
Apache License 2.0
0 stars 0 forks source link

DataObject error while parsing special characters #181

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.compile the code attached
2.run

What is the expected output? What do you see instead?
I expect to see the original string deserialized, instead it throws an 
exception:

ERROR 15-08-2012 15:14:36.116 src/main.cpp[42] main: Exception: 
src/DataObject.cpp[3910] FromString: No Root Element in the pAxiomDoc

What version of the product are you using? On what operating system?
r704 on Ubuntu 11.10 32 bits

Please provide any additional information below.
Serializing and deserializing a string field with special chars (ñ á é, etc) 
with a DataObject fails. I'm using staff to serialize and deserialize the data 
for my application (it has multiple process which send staff requests)

Original issue reported on code.google.com by alexmantaut on 15 Aug 2012 at 6:20

Attachments:

GoogleCodeExporter commented 9 years ago
I saw similar problems before and suspect this issue relates to a XML parser 
used by AxiOM, but can't check it now.

1. Which XML parser uses AxiOM: Guththilla or libxml?
2. What encoding you are using to serializa/deserialize document (UTF-8, ISO... 
etc)?

Original comment by loentar on 15 Aug 2012 at 7:01

GoogleCodeExporter commented 9 years ago
Checked that.

Looks like you are using unpatched guththilla from axis2/c-1.6.0.

for details see https://issues.apache.org/jira/browse/AXIS2C-1265

If you want to use guththilla with UTF-8 you must apply patch:

# go to axis2/c source code directory
cd ~/devel/axis2c
# cleanup build
make distclean
# get patch
wget https://issues.apache.org/jira/secure/attachment/12407627/utf8-patch.txt
# apply the patch
patch -d. -p0 <utf8-patch.txt

Then you must recompile Axis2/C and staff as in InstallationManualLinux (don't 
forget to clean up staff's source code by make distclean).

After installation you should be able to work with UTF-8 chars.

Little test to check is UTF-8 working is attached.

Original comment by loentar on 16 Aug 2012 at 5:49

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks Dmitry, I didn't know how to see which encoding was axis2/C using, I was 
looking into it but you beat me to it.

Original comment by alexmantaut on 16 Aug 2012 at 1:12

GoogleCodeExporter commented 9 years ago
Issue 189 has been merged into this issue.

Original comment by loentar on 18 Sep 2012 at 8:06

GoogleCodeExporter commented 9 years ago
In Windows,I have use the utf8-patch and rebuild the Axis2/C(Use command in 
dir: axis2c-src-1.6.0\build\win32), but it's failed.
So Can you tell me how to patch the utf8-patch.txt and rebuild the Axis2/C.

Original comment by bingqing...@gmail.com on 20 Sep 2012 at 2:55

GoogleCodeExporter commented 9 years ago
You need proper version of patch utility, last versions from MinGW does not 
work.

You should start patch from axis2/c sources directory axis2c-src-1.6.0 where 
NOTICE file is located.

Maybe, it will be easier if you install any version of Linux (Ubuntu for 
example) on virtual machine (like vmware player) and apply patch there.

Original comment by loentar on 20 Sep 2012 at 5:38

GoogleCodeExporter commented 9 years ago
I have patch utf8-patch.txt to sources directory axis2c-src-1.6.0, but failed.
Can you help me add the  utf8-patch to axis2/c and rebuild the axis2/c and 
staff In windows? Thanks.

Original comment by bingqing...@gmail.com on 21 Sep 2012 at 6:14

GoogleCodeExporter commented 9 years ago
Learn Linux, it very good practice in any time.

Sent you a mail with patched version of axis2/c.

Original comment by loentar on 21 Sep 2012 at 6:29

GoogleCodeExporter commented 9 years ago
In Linux, I have recompile Axis2/C and staff as in InstallationManualLinux, 
it's Ok.
In Windows, I also recompile and install them. But when i excute the 
axis2_http_server.exe, it's failed.
The log info as follow:(Include messy code)
[Tue Sep 25 15:03:35 2012] [info]  Starting Axis2 HTTP server....
[Tue Sep 25 15:03:35 2012] [info]  Apache Axis2/C version in use : 1.6.0
[Tue Sep 25 15:03:35 2012] [info]  Server port : 9090
[Tue Sep 25 15:03:35 2012] [info]  Repo location : ../
[Tue Sep 25 15:03:35 2012] [info]  Read Timeout : 60000 ms
[Tue Sep 25 15:03:35 2012] [debug] ..\..\..\..\src\core\engine\phase.c(121) 
axis2_handler_t *request_uri_based_dispatcher added to the index 0 of the phase 
Transport
[Tue Sep 25 15:03:35 2012] [debug] ..\..\..\..\src\core\engine\phase.c(121) 
axis2_handler_t *addressing_based_dispatcher added to the index 1 of the phase 
Transport
[Tue Sep 25 15:03:35 2012] [debug] ..\..\..\..\src\core\engine\phase.c(121) 
axis2_handler_t *rest_dispatcher added to the index 0 of the phase Dispatch
[Tue Sep 25 15:03:35 2012] [debug] ..\..\..\..\src\core\engine\phase.c(121) 
axis2_handler_t *soap_message_body_based_dispatcher added to the index 1 of the 
phase Dispatch
[Tue Sep 25 15:03:35 2012] [debug] ..\..\..\..\src\core\engine\phase.c(121) 
axis2_handler_t *soap_action_based_dispatcher added to the index 2 of the phase 
Dispatch
[Tue Sep 25 15:03:35 2012] [debug] ..\..\..\..\src\core\engine\phase.c(121) 
axis2_handler_t *dispatch_post_conditions_evaluator added to the index 0 of the 
phase PostDispatch
[Tue Sep 25 15:03:35 2012] [debug] ..\..\..\..\src\core\engine\phase.c(121) 
axis2_handler_t *context_handler added to the index 1 of the phase PostDispatch
[Tue Sep 25 15:03:35 2012] [debug] 
..\..\..\..\src\core\deployment\conf_builder.c(234) No custom dispatching order 
found. Continue with the default dispatching order
[Tue Sep 25 15:03:35 2012] [debug] 
..\..\..\..\src\core\deployment\conf_builder.c(379) Module addressing found in 
axis2.xml
[Tue Sep 25 15:03:35 2012] [error] ..\..\..\..\util\src\class_loader.c(157) 
Loading shared library (null) 
[Tue Sep 25 15:03:35 2012] [error] ..\..\..\..\util\src\class_loader.c(170) 
Loading shared library ..//lib/axis2_http_sender.dll  Failed. DLERROR IS DLL 
Load Error 126: ~b
N0Rc歔剉!jWW0
/////////////////////////////////////////////////////////////////////////
At moment, I must to realize the webserver, But I can't solve the problem.
So I hope you can help me recompile the Axis2/C and latest staff. Thanks.

Original comment by bingqing...@gmail.com on 25 Sep 2012 at 7:34

GoogleCodeExporter commented 9 years ago
> DLL Load Error 126.

Looks like something wrong with your PATH environment variable.
Possibly, you forgot to add c:\ws\axis2c\lib to your PATH.

Original comment by loentar on 25 Sep 2012 at 7:42

GoogleCodeExporter commented 9 years ago
I had add the PATH  c:\ws\axis2c\lib, And It's Ok when use the axis2c binary 
from downloads list(win32 Release binary axis2/c-1.6.0 and staff-2.0.0-a1-r686 
built with vs2010).

Original comment by bingqing...@gmail.com on 25 Sep 2012 at 7:55

GoogleCodeExporter commented 9 years ago
But It's failed when use my recompile Axis2/C.

Original comment by bingqing...@gmail.com on 25 Sep 2012 at 7:56

GoogleCodeExporter commented 9 years ago
Here is it.

Original comment by loentar on 25 Sep 2012 at 6:51

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you for your help.
I have unpack the file to C: and It's test Ok when server return a english 
string. But It's failed when return a chinese string.
The Function as follow:
std::string CalculatorImpl::Add(std::string strAdd)
{
  std::string tResult;
  // TODO: place your code here
  tResult = "天使Hello";
  printf("val: %s", tResult.c_str());
  return tResult;  // result
}

The client return the std::string length is 0.
The server and client project files as attach.

Original comment by bingqing...@gmail.com on 26 Sep 2012 at 1:51

Attachments:

GoogleCodeExporter commented 9 years ago
That's because you have wrong encoding on server side, you should have UTF-8, 
not any local encoding.

I deleted client.rar because it may contain some sensitive data (you forgot to 
delete some openvpn keys from 2client dir).

Original comment by loentar on 26 Sep 2012 at 6:28

GoogleCodeExporter commented 9 years ago
Thank you very much for your sincere help��

Original comment by bingqing...@gmail.com on 27 Sep 2012 at 1:34