Sun Java System Web Server 7.0 NSAPI Developer's Guide

Installing the Service Example

To load the shared object containing your functions, add the following line in the Init section of the magnus.conf file:


Init fn=load-modules 
     shlib=yourlibrary 
     funcs=simple-service-init,simple-service

         

To call the simple-service-init function to initialize the message representing the generated output, add the following line to the Init section in magnus.conf. (This line must come after the one that loads the library containing simple-service-init.)


Init fn=simple-service-init
     generated-output="<H1>Generated output msg</H1>"

         

To execute the custom SAF during the request-response process for some object, add the following line to that object in the obj.conf file:

Service type="text/html" 
        fn=simple-service

The type="text/html" argument indicates that this function is invoked during the Service stage only if the content-type has been set to text/html.

The source code for this example is in the service.c file in the install_dir/samples/nsapi directory.