I write this reply just for everyone have same problem.
Like wizard_hu_ said, I set up a RSocket object with the initialized RConnection object. Then, I wrote 4 function: MyOpen for open the socket, MyClose for close the socket, MyRead and MyWrite for read and write operations.
Then, I pass the functions to soap object like this:
(of course, fopen and MyOpen have same prototype, so fread and MyRead and so on)
soap* s = soap_new();
s->fopen = MyOpen;
s->fread = MyRead;
s->fwrite = MyWrite;
s->fclose = MyClose;
Because gSOAP expectes a synchronous socket, you have to use User::WaitForRequest or Active Object and CActiveSchedulerWait object to synchronize read \ write operations. For pass the RSocket object to your My* functions, you may use the "user" member of soap object like this:
so, you may use like this:
s->user = &mysocket; // mysocket is declared as RSocket mysocket
Hope this help someone.
int MyOpen(struct soap* soap, others parameters ...)
RSocket* theSocket = reinterpret_cast<RSocket*>(soap->user);