// GsoapRegistry_t.cxx #include "dial_ws/GsoapRegistry.h" #include using std::string; using std::cout; using std::endl; using dial::GsoapRegistry; #include "stdsoap2.h" void msg(string txt) { cout << "*** "; cout << txt; cout << " ***" << endl; } struct Namespace dial_ws_junk_namespaces[] = { {"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", 0}, {"SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", 0}, {"xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", 0}, {"xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", 0}, {"dial", "http://tempuri.org", 0, 0}, {0, 0, 0, 0} }; int serve_junk(soap*) { return 123; }; int init() { return 0; } int GsoapRegistry_t() { msg("Display servers"); GsoapRegistry::display() << endl; msg("Check missing namespace."); assert(GsoapRegistry::nspace("junk") == 0); msg("Check missing server."); assert(GsoapRegistry::server("junk") == 0); msg("Register junk"); assert( GsoapRegistry::insert("junk", init, serve_junk, dial_ws_junk_namespaces) == 0 ); msg("Display servers with junk"); GsoapRegistry::display() << endl; msg("Check junk init."); assert( GsoapRegistry::init("junk") == init ); msg("Check junk server."); assert( GsoapRegistry::server("junk") == serve_junk ); msg("Check junk namespace."); assert( GsoapRegistry::nspace("junk") == dial_ws_junk_namespaces ); return 0; } #ifdef CTEST_MAIN int main() { return GsoapRegistry_t(); } #endif