ProcessMessage

Processes the input message and retrieves the response message from the server.

Note: You will need to call DeleteMessage() to free memory when this returned message is no longer used.

Syntax

int processMessage (Service* service, Message* request, Message* returnVal) 

Parameters

  • Service—the service the client requests.
  • Request—the input message which contains the "option" setting and the dataset.
  • returnVal—returns the response message from the server.

Results

Returns 0 (if successful) or error code.

Example

Message *request = NULL; 
Message *reply = NULL; 
int nRet; 
 ...	
 // Assume that service is given here 
 // Create Input Message 
 request = createMessage(); 
 ... more code to fill dataTable information in request message 
//Process Input Message, return output Message 
 nRet = processMessage(service, request, &reply); 
 if(nRet != SUCCESSFUL_RETURN) 
 { 
 printf("Error Occurred, " ); 
 printf(getErrorMessage(nRet)); 
 return ; 
 } 
 if(request) 
 nRet = deleteMessage(request); 
 if(reply)	
 nRet = deleteMessage(reply);