Here you go. I am not deleting the temps because I use these methods for
logging . :-)
template <class GObject>
void serializeGnuSoapObject(GObject& obj, const char* nsClassName,
std::ostream *paramOs = &std::cout)
{
soap *ctx = soap_new1(SOAP_XML_INDENT); // new context with option
ctx->os = paramOs;
::soap_begin_send(ctx);
obj.soap_put(ctx, nsClassName, NULL);
soap_end_send(ctx);
::soap_end(ctx); // clean up allocated temporaries
::soap_free(ctx); // delete context
}
template <class GnuObject>
bool deSerializeGnuSoapObject( GnuObject& instance, const char*
nsClassName, std::istream *paramIs = &std::cin )
{
bool status = false;
soap *ctx = soap_new1( SOAP_XML_STRICT ); // new context with option
soap_init( ctx );
soap_begin( ctx );
ctx->is = paramIs;
soap_begin_recv(ctx);
instance.soap_get(ctx, nsClassName, "" );
if (ctx->error == SOAP_OK)
{
status = true;
}
soap_end_recv(ctx);
// soap_destroy(ctx); // delete deserialized objects
// soap_end(ctx); // delete temporaries
soap_free(ctx); // delete context
return status;
}
Jayaram Ganapathy
************************************************************************************************
This mail is transmitted to you on behalf of [ Tata Consultancy Services
].
Diese Post wird Ihnen im Namen der [ Tata Consultancy Services ]
ubermittelt
************************************************************************************************
[email protected]
Sent by: [email protected]
21-02-09 07:22 AM
Please respond to
[email protected]
To
[email protected]
cc
Subject
[gsoap] Method invocations for serialization
Section 7.5.1 of the documentation says "For serializing class instances,
method invocations MUST be used instead of function calls, for example
obj.soap_serialize(&soap) and obj.soap_put(&soap, "elt", "type")." I'm
having a hard time finding where soap generates proxies/versions of the
method input and output classes that have such methods; where do they get
generated?
--
David Dyer-Bennet, [email protected]; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info
---
This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.