NonStop SOAP 4.1 User's Manual

36
37 recv_name_length = (short)strlen( recv_name );
38
39 /**
40 * FILE_OPEN_ is called to obtain a unique file identifier (recv_num)
41 * for $RECEIVE
42 */
43 error = FILE_OPEN_( recv_name,
44 recv_name_length,
45 &recv_num,
46 , /* Access */
47 , /* Exclusion */
48 , /* Nowait depth */
49 1 ); /* Receive Depth */
50
51 if ( recv_num == -1 )
52 {
53 printf( " Error while Opening $RECEIVE \n " );
54 printf( " Error is = %d \n " , error );
55 exit(1);
56 }
57
58 while ( 1 )
59 {
60 /**
61 * Initialising the request buffer
62 */
63 memset(recv_buff, '\0', RECV_BUFFER_LENGTH);
64
65 /**
66 * Read $RECEIVE file and return the number of bytes read in
67 * variable count_read and the data in recv_buff
68 */
69 READUPDATEX(recv_num,
70 (char *)recv_buff,
71 RECV_BUFFER_LENGTH - 1,
72 &count_read);
73
74 /**
75 * FILE_GETINFO_ will return the file system error resulting
76 * from the last operation on file id recv_num in variable error
77 */
78 FILE_GETINFO_(recv_num, &error);
79
80 /**
81 * FILE_GETRECEIVEINFO_ will return information about the last
82 * message read on $RECEIVE file in variable receiveinfo
83 */
84 FILE_GETRECEIVEINFOL_((short *)&receive_info);
85
86 switch (error) {
87 /**
88 * Process Application message.
89 */
90 case NO_ERROR:
91 process_application_message(recv_buff, count_read);
92 break;
93
94 /**
95 * Process System message.
96 */
97 case SYSTEM_MSG:
98 process_system_message((short *)receive_info );
99 break;
100
101 default:
102 file_errors(error);
103
104 } /* End of switch statement */
105
106 /**
107 * Setting the value of count_read to 0 at the end of request processing
108 */
109 count_read = 0;
110
111 /**
112 * if no opens are pending, then break the while loop and exit
113 */
114 if (!totalOpenCnt)
115 break;
116 } /* while end */
117
118 error = FILE_CLOSE_(recv_num);
119 if ( error != 0 )
120 {
121 printf( " Error while Closing $RECEIVE \n " );
122 printf( " Error number is = %d \n " , error );
123 }
124 return 0;
Developing a NonStop SOAP 4 Pathway Web Service Using the WSDL2PWY Tool 265