I'm trying out Hessian for C++ and I'm having some problems. The documentation isn't very helpfull, but I have managed to build the test application. I have also modified it a bit to call a function on a local server. However, when I try to run it all I get is:
[staffanv@soapstone hessiancpp]$ ./main
starting
io exception: hessian_output::write_object(): come on, really, what kind of Object is
STATS
in : 0
out : 0
Aritmetiskt fel
What does this mean?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry Staffan for the delay in replying !
It's not a habit, it's an error, I forgot to enable email forwarding of bugs, patches, support requests and so on to my email address.
Obviously this happens in hessian_output::write_object(), namely line 214. You're calling write_object() with something derived from Object (what ?) that has the classname set to "STATS".
As you can see there's only a few legal options there.
If you want to send over for instance a struct like
struct data {
int id;
std::string name;
};
you'd have to implement serialisation to a std::map, build a hessian::wrappers::Map off it and pass that to write_object() instead.
Now, I'm going to release a code generator for hessiancpp. It's written in Java (for use of reflection) and it works like this: introspects an interface (your service interface) and generates a matching C++ class that you can use to call the server. It also generates all the custom data structures (Java beans) used as parameters and return values. It does have a few limitations but it's a lot better than writing de/serialisation code yourself and it's also been used in a fairly complex commercial project.
Let me know how it works,
Cheers,
Radu.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi - did you ever get around to publishing the code generator? I'm getting ready to start looking at this to use for a project and want to see how difficult it might be.
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying out Hessian for C++ and I'm having some problems. The documentation isn't very helpfull, but I have managed to build the test application. I have also modified it a bit to call a function on a local server. However, when I try to run it all I get is:
[staffanv@soapstone hessiancpp]$ ./main
starting
io exception: hessian_output::write_object(): come on, really, what kind of Object is
STATS
in : 0
out : 0
Aritmetiskt fel
What does this mean?
Sorry Staffan for the delay in replying !
It's not a habit, it's an error, I forgot to enable email forwarding of bugs, patches, support requests and so on to my email address.
Obviously this happens in hessian_output::write_object(), namely line 214. You're calling write_object() with something derived from Object (what ?) that has the classname set to "STATS".
As you can see there's only a few legal options there.
If you want to send over for instance a struct like
struct data {
int id;
std::string name;
};
you'd have to implement serialisation to a std::map, build a hessian::wrappers::Map off it and pass that to write_object() instead.
Now, I'm going to release a code generator for hessiancpp. It's written in Java (for use of reflection) and it works like this: introspects an interface (your service interface) and generates a matching C++ class that you can use to call the server. It also generates all the custom data structures (Java beans) used as parameters and return values. It does have a few limitations but it's a lot better than writing de/serialisation code yourself and it's also been used in a fairly complex commercial project.
Let me know how it works,
Cheers,
Radu.
I have worked around the problem so you can say it's solved.
That code generator sounds interesting. Whan will it be available?
Hi,
any update on the code generator? Will it be available soon?
Radu
Is the code generator available? Or did your company squash open sourcing it?
I'll dig up a CVS archive and publish the code this week. Sorry for the delay!
Hi - did you ever get around to publishing the code generator? I'm getting ready to start looking at this to use for a project and want to see how difficult it might be.
Thanks!
Hello,
I read that Aldratech also had generation of C++ classes based on Java Services. http://www.caucho.com/news/press/2005-03-02/ Is that so?