#806 Nullpointer in soap_serialize


Hello @all,
my Name is Alexander and i study computer science in Germany. For my university I will implement a new interface with gSOAP. But i get a difficult exception in the generated code. I don't know why:-(

SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_std__listTemplateOfns__aBean(struct soap *soap, const std::list<ns__aBean >*a)
for (std::list<ns__aBean >::const_iterator i = a->begin(); i != a->end(); ++i)
(*i).soap_serialize(soap); <------------this position

Can you please look at the project an tell me, it's a bug in gSOAP or my mistake.



  • Alexander

    Alexander - 2012-01-31


  • Alexander

    Alexander - 2012-02-01
    • assigned_to: nobody --> engelen
  • Robert van Engelen

    A crash in the serializer is usually caused by either:

    1. un-initialized pointer members;
    2. locally-allocated data that is returned by the service operation out of scope;
    3. when not including "soapH.h" in .c or .cpp files, where soapH.h includes the soapcpp2-generated type (re)definitions.

    In your case it is #3. The aBean.cpp file #includes "aBean.h" but that definition is changed by soapcpp2 to include a serializer. The new definition is put in soapStub.h included by soapH.h. The soapH.h file is the one you should always include in your project.

    For testing, I recommend to use stdin/stdout communications instead of sockets:

    printf("Server ist oben!\n");
    return server.serve();

    and then test the server by redirecting an example request file (here auto-generated by soapcpp2):

    > wsImpl < webbsyService.readA.req.xml

  • Robert van Engelen

    • status: open --> open-fixed
  • Robert van Engelen

    • status: open-fixed --> pending-fixed
  • Robert van Engelen

    • status: pending-fixed --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks