/****************************************************************** * $Id: soap-wsil.c,v 1.6 2006/11/27 11:15:27 m0gg Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2003 Ferhat Ayaz * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * Email: ayaz@jprogrammer.net ******************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_STDIO_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include #include #include #include #include #include "soap-ctx.h" #include "soap-service.h" #include "soap-router.h" #include "soap-server.h" #include "soap-transport.h" #include "soap-wsil.h" static void _soap_wsil_list_routers(httpd_conn_t *conn) { SoapRouterNode *node; for (node=soap_server_get_routers(); node; node=node->next) { http_output_stream_write_string(conn->out, "" "out, soap_transport_get_name()); http_output_stream_write_string(conn->out, node->context); http_output_stream_write_string(conn->out, "\" " "referencedNamespace=\""); if (node->router->description) { xmlNodePtr root; root = xmlDocGetRootElement(node->router->description); http_output_stream_write_string(conn->out, root->ns->href); } else { http_output_stream_write_string(conn->out, "http://schemas.xmlsoap.org/wsdl/"); } http_output_stream_write_string(conn->out, "\" />" ""); } return; } static void _soap_wsil_handle_get(httpd_conn_t * conn, struct hrequest_t * req) { httpd_set_header(conn, HEADER_CONTENT_TYPE, "text/xml"); httpd_send_header(conn, 200, HTTP_STATUS_200_REASON_PHRASE); http_output_stream_write_string(conn->out, "" "" ); _soap_wsil_list_routers(conn); http_output_stream_write_string(conn->out, "\n"); return; } static void _soap_wsil_entry(httpd_conn_t * conn, struct hrequest_t * req) { if (req->method == HTTP_REQUEST_GET) { _soap_wsil_handle_get(conn, req); } else { httpd_send_header(conn, 200, HTTP_STATUS_200_REASON_PHRASE); http_output_stream_write_string(conn->out, "" "" "" "" "

Sorry!

" "
" "
POST Service is not implemented now. Use your browser
" "" ""); } return; } herror_t soap_wsil_init_args(int argc, char **argv) { int i; for (i=0; i