ZOO-Project
Macros | Functions
zoo_loader.c File Reference
#include "fcgio.h"
#include "fcgi_config.h"
#include "fcgi_stdio.h"
#include <sys/types.h>
#include <unistd.h>
#include "service_internal.h"
#include "response_print.h"
#include "cgic.h"
#include <libxml/tree.h>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include "request_parser.h"

Macros

#define MALLOC_CHECK_   0
 
#define MALLOC_CHECK   0
 
#define TRUE   1
 
#define FALSE   -1
 

Functions

int runRequest (map **)
 Specific includes. More...
 
int cgiInit ()
 
int cgiMain ()
 Main entry point for cgic. More...
 

Macro Definition Documentation

#define FALSE   -1
#define MALLOC_CHECK   0
#define MALLOC_CHECK_   0
#define TRUE   1

Function Documentation

int cgiInit ( )
int cgiMain ( )

Main entry point for cgic.

Returns
0 on sucess.

We'll use cgiOut as the default output (stdout) to produce plain text response.

In case that the POST method was used, then check if params came in XML format else try to use the attribute "request" which should be the only one.

Store the original XML request in xrequest map

int runRequest ( map **  inputs)

Specific includes.

Specific includes.

Parameters
inputsthe request parameters map
Returns
0 on sucess, other value on failure
See also
conf_read,recursReaddirF

Parsing service specfic configuration file

Manage our own error log file (usefull to separate standard apache debug messages from the ZOO-Kernel ones but also for IIS users to avoid wrong headers messages returned by the CGI due to wrong redirection of stderr)

Here we need to close stdout to ensure that unsupported chars has been found in the zcfg and then printed on stdout

Loop over Identifier list

No support for dot in service name stored in metadb!? #ifdef META_DB service* s2=extractServiceFromDb(m,tmpMapI->value,0); if(s2==NULL){ #endif

Create the input and output maps data structure

05-007r7 WPS 1.0.0 page 57 : 'If status="true" and storeExecuteResponse is "false" then the service shall raise an exception.'

Initialize the specific [lenv] section which contains runtime variables:

  • usid : it is an universally unique identifier
  • osid : it is an idenfitication number
  • sid : it is the process idenfitication number (OS)
  • uusid : it is an universally unique identifier
  • status : value between 0 and 100 to express the completude of the operations of the running service
  • message : is a string where you can store error messages, in case service is failing, or o provide details on the ongoing operation.
  • cwd : the current working directory or servicePath if defined
  • soap : is a boolean value, true if the request was contained in a SOAP Envelop
  • sessid : string storing the session identifier (only when cookie is used)
  • cgiSid : only defined on Window platforms (for being able to identify the created process)

error server don't accept the process need to output a valid error response here !!!

Ensure that if error occurs when freeing memory, no signal will return an ExceptionReport document as the result was already returned to the client.