NonStop SOAP 4.1 User's Manual

125 } /* End of main() */
126
The recv_num variable contains the file identifier for the $RECEIVE file and must be
initialized to 0.
Line 10
Defines the receiveinfo variable. The receiveinfo variable is passed as an
argument to the FILE_GETRECEIVEINFO_ call.
Line 16
The recv_name_length variable contains the length of the recv_name variable
and must be initialized to 0.
Line 21
The count_read variable contains the number of bytes read from $RECEIVE and is
passed as an argument to READUPDATEX. The count_read variable must be initialized
to 0.
Line 27
Checks the returned error.Line 28
recv_buff is a character buffer that contains the received client request. Set the
length of recv_buff to the maximum size of the response buffer (32KB).
Line 34
Initializes a variable with the $RECEIVE file name and another variable with the length
of the $RECEIVE file name.
Line 35 - Line 37
The FILE_OPEN_ call is called to obtain a unique file identifier (recv_num) for
$RECEIVE. FILE_OPEN_ opens the $RECEIVE file.
Line 43 - Line 49
Error handling if the FILE_OPEN is not able to open the $RECEIVE file.Line 51 - Line 56
Breaks the continuous loop if the server stops because of some error.Line 58- Line 116
Initializes the request buffer with NULL values.Line 63
Reads the $RECEIVE file and returns the number of bytes read in count_read variable
and the data in recv_buff. At this point, the server waits until it receives a request
from the client.
Line 69- Line 72
The FILE_GETINFO_ call returns a file system error if an error occurred in the last
operation on recv_num file id. The error is returned in the error variable.
Line 78
FILE_GETRECEIVEINFO_ call returns information about the last message read in
the $RECEIVE file.
Line 84
The switch statement handles the error returned by FILE_GETINFO.Line 86 - Line 104
In case of no error (NO_ERROR), call the process_application_message()
function.
Line 90 - Line 92
In case of system message (SYSTEM_MSG), call the process_system message()
function.
Line 97 - Line 99
In case of other errors, call the file_errors() function.Line 101 - Line 102
Sets the value of count_read to 0 at the end of request processingLine 109
If no files are open, break the while loop and exit.Line 114- Line 115
Close the $RECEIVE file if the while loop breaks.Line 118
Error handling if an error occurs while closing the $RECEIVE file.Line 119 - Line 123
Return statementLine 124
process_application_message
In the case of the reflector service, the process_application_message() function
appears as:
1 void process_application_message(char * recv_buff, unsigned long count_read) {
2
3 short error = 0;
4
5 /**
266 Using the Contract-First Approach in NonStop SOAP 4