#define SOAP_ADMIN_QUERY_ROUTERS "routers"
#define SOAP_ADMIN_QUERY_ROUTER "router"
#define SOAP_ADMIN_QUERY_SERVICES "services"
static void
_soap_admin_send_title(httpd_conn_t* conn, const char* title)
{
httpd_send_header(conn, 200, "OK");
http_output_stream_write_string(conn->out,
"
csoap ");
http_output_stream_write_string(conn->out, title);
http_output_stream_write_string(conn->out, "
");
}
static void
_soap_admin_list_routers(httpd_conn_t* conn)
{
SoapRouterNode *node;
char buffer[1024];
_soap_admin_send_title(conn, "Available routers");
for (node = head; node; node = node->next)
{
sprintf(buffer, " %s",
node->context, node->context);
http_output_stream_write_string(conn->out, buffer);
}
http_output_stream_write_string(conn->out, "");
}
static void
_soap_admin_list_services(httpd_conn_t* conn, const char* routername)
{
SoapRouter *router;
SoapServiceNode *node;
char buffer[1024];
sprintf(buffer, "Listing Services for Router %s", routername);
_soap_admin_send_title(conn, buffer);
router = router_find(routername);
if (!router) {
http_output_stream_write_string(conn->out, "Router not found!");
http_output_stream_write_string(conn->out, "