Menu

Problems with hessiancpp

Help
2005-02-28
2013-04-11
  • Staffan Vilcans

    Staffan Vilcans - 2005-02-28

    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?

     
    • Radu-Adrian Popescu

      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.

       
    • Staffan Vilcans

      Staffan Vilcans - 2005-03-29

      I have worked around the problem so you can say it's solved.

      That code generator sounds interesting. Whan will it be available?

       
    • zregvart

      zregvart - 2005-11-25

      Hi,
      any update on the code generator? Will it be available soon?

       
    • Mike Goodey

      Mike Goodey - 2008-03-07

      Radu

      Is the code generator available? Or did your company squash open sourcing it?

       
    • Radu-Adrian Popescu

      I'll dig up a CVS archive and publish the code this week. Sorry for the delay!

       
    • Gary Mui

      Gary Mui - 2008-10-16

      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!

       
  • Anonymous

    Anonymous - 2010-05-28

    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?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.