soap-router.c File Reference

#include <libxml/tree.h>
#include <nanohttp/nanohttp-error.h>
#include <nanohttp/nanohttp-logging.h>
#include "soap-fault.h"
#include "soap-ctx.h"
#include "soap-service.h"
#include "soap-router.h"

Go to the source code of this file.

Functions

SoapRoutersoap_router_new (void)
herror_t soap_router_register_service (struct SoapRouter *router, SoapServiceFunc func, const char *method, const char *urn)
void soap_router_register_security (struct SoapRouter *router, soap_auth auth)
void soap_router_register_description (struct SoapRouter *router, xmlDocPtr description)
herror_t soap_router_register_default_service (struct SoapRouter *router, SoapServiceFunc func, const char *method, const char *urn)
SoapServicesoap_router_find_service (struct SoapRouter *router, const char *urn, const char *method)
void soap_router_free (struct SoapRouter *router)


Function Documentation

SoapService* soap_router_find_service struct SoapRouter router,
const char *  urn,
const char *  method
 

Searches for a registered soap service.

Parameters:
router The router object
urn URN of the service
method The name under which the service was registered.
Returns:
The service if found, NULL otherwise.

Definition at line 133 of file soap-router.c.

References SoapRouter::default_service, log_verbose1, log_verbose2, log_verbose4, _SoapService::method, _SoapServiceNode::next, _SoapServiceNode::service, SoapRouter::service_head, and _SoapService::urn.

Referenced by soap_server_process().

void soap_router_free struct SoapRouter router  ) 
 

Frees the router object.

Parameters:
router The router object to free
See also:
soap_router_new

Definition at line 174 of file soap-router.c.

References SoapRouter::description, log_verbose1, log_verbose2, _SoapServiceNode::next, _SoapServiceNode::service, SoapRouter::service_head, and soap_service_free().

Referenced by soap_server_destroy().

struct SoapRouter* soap_router_new void   ) 
 

Creates a new router object. Create a router if you are implementing a soap server. Then register the services to this router.

A router points also to http url context.

Returns:
Soap router
See also:
soap_router_free

Definition at line 52 of file soap-router.c.

References log_error2.

herror_t soap_router_register_default_service struct SoapRouter router,
SoapServiceFunc  func,
const char *  method,
const char *  urn
 

Register a default service for the router.

Definition at line 110 of file soap-router.c.

References SoapRouter::default_service, H_OK, herror_new(), _SoapServiceNode::next, SoapRouter::service_head, SoapRouter::service_tail, soap_service_new(), and soap_service_node_new().

void soap_router_register_description struct SoapRouter router,
xmlDocPtr  doc
 

Register a service description for the router.

Definition at line 99 of file soap-router.c.

References SoapRouter::description.

void soap_router_register_security struct SoapRouter router,
soap_auth  auth
 

Register a security provider for the router.

Definition at line 91 of file soap-router.c.

References SoapRouter::auth.

herror_t soap_router_register_service struct SoapRouter router,
SoapServiceFunc  func,
const char *  method,
const char *  urn
 

Registers a SOAP service (in this case a C function) to the router.

Parameters:
router The router object
func Function to register as a soap service
method Method name to call the function from the client side.
urn The urn for this service

Definition at line 67 of file soap-router.c.

References H_OK, herror_new(), log_verbose4, _SoapServiceNode::next, SoapRouter::service_head, SoapRouter::service_tail, soap_service_new(), and soap_service_node_new().


Generated on Thu Jan 25 23:36:04 2007 for csoap by  doxygen 1.4.6