Hi,
I need help in creating server side skeletons and client side stubs using wsdl2c. I have a 2 wsdl files importing an xsd schema with in it. I have generated skeletons and stubs using wsdl2c file. I copied both wsdls together with .xsd file into a directory and I have executed the commands, Skeletons: wsdl2c.sh -o <output_dir1> -f -uri app1.wsdl -u -ss -sd. Stubs: wsdl2c.sh -o <output_dir2> -f -uri app2.wsdl -u. And each command created skeletons and stubs successfully in their respective output directories. Now my questions are: 1. Are the above commands correct? Because, in the generated file list, I see 2 sets of requests and 2 files of responses for a SOAP operation which is kind of confusing to me. Lets say, a. for e.g, for Ping operation, the generated skeleton files are: adb_pingRequestE10.c/h and adb_pingResponseE13.c/h b. for clearCache operation, the generated stubs are: adb_ClearCacheRequest.c/h adb_clearCacheRequestE0.c/h adb_clearCacheRequestE0.c/h adb_ClearCacheResponse.c/h adb_clearCacheResponseE8.c/h While implementing/invoking those operations which Request/Response objects/types/variables should I use? 2. All the stub operations are in RequestE<n>.c/h (where n is number) taking RequestE<n> as input and returning Response<n>as output. So, in my application I followed the flow: //Prepare request object (complex type) - Begin a. adb_ClearCacheRequest_t *pclearCacheRequest = adb_ClearCacheRequest_create(env); b. adb_clearCacheRequestE0_t *pClearcacheRequestE0 = adb_clearCacheRequestE0_create(env); c. status = adb_clearCacheRequestE0_set_clearCacheRequest(pClearcacheRequestE0, env, pclearCacheRequest); //Prepare request object (complex type) - End d. adb_clearCacheResponseE8_t *pclearCacheResponseE8 = axis2_stub_op_DataExchangeService_clearCache( stub, env, pClearcacheRequestE0); e. adb_ClearCacheResponse_t *pClearCacheResponse = adb_clearCacheResponseE8_get_clearCacheResponse( pclearCacheResponseE8, env); // Free Request objects - Begin f. status = adb_ClearCacheRequest_free(pclearCacheRequest, env); g. //status = adb_clearCacheRequestE0_free(pClearcacheRequestE0, env); // Free Request objects - End With the above code, I noticed the below problems while debugging: Problem # 1: If I don't use Step b, then Step d is returning NULL. Problem # 2: My understanding is, I have to free both the request objects since I am creating both. So, if I have Step g uncommented, then I am getting following exceptions: *** glibc detected *** double free or corruption (fasttop): 0x00007ffff0036490 *** ======= Backtrace: ========= /lib64/libc.so.6[0x7ffff6c1ec76] /lib64/libc.so.6(cfree+0x6c)[0x7ffff6c2396c] ./libdotmeddataexchangecppclient.so(adb_ClearCacheRequest_free+0x82)[0x7 ffff7afc61e] ./libdotmeddataexchangecppclient.so(adb_clearCacheRequestE0_reset_clearC acheRequest+0x97)[0x7ffff7b3f833] ./libdotmeddataexchangecppclient.so(adb_clearCacheRequestE0_free+0x73)[0 x7ffff7b3eb53] ./libdotmeddataexchangecppclient.so(_ZN6dotmed12DataExchange10clearCache Ev+0x4b6)[0x7ffff7af897e] Problem # 3: But commenting Step g is not fixing this memory issue with other Request objects of other SOAP operations. So, Is this the correct way of creating request and response pair for stubs? Problem # 4: Though commenting Step g, fixes the issue (sometimes), but I would like to know the procedure to create request and response objects in my scenario (wsdl with xsd) because, I am getting memory exceptions in other functions too when I invoke other operations. Thanks & Regards, Sangeeta.
