Changeset 1749
- Timestamp:
- 08/19/08 14:44:05 (3 months ago)
- Files:
-
- capture-mod/trunk/CaptureSoapServer.cpp (modified) (3 diffs)
- capture-mod/trunk/MIMEsend.pl (added)
- capture-mod/trunk/capture.wsdl (modified) (3 diffs)
- capture-mod/trunk/captureGSOAP.h (modified) (1 diff)
- capture-mod/trunk/client.pl (modified) (3 diffs)
- capture-mod/trunk/install/CaptureBAT.exe (modified) (previous)
- capture-mod/trunk/soapC.cpp (modified) (8 diffs)
- capture-mod/trunk/soapClient.cpp (modified) (2 diffs)
- capture-mod/trunk/soapH.h (modified) (19 diffs)
- capture-mod/trunk/soapServer.cpp (modified) (3 diffs)
- capture-mod/trunk/soapStub.h (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
capture-mod/trunk/CaptureSoapServer.cpp
r1743 r1749 104 104 { 105 105 printf("in ns__junks\n"); 106 ns__myStruct bob;107 bob.first = "bob";108 bob.last = "dole";109 result = bob;106 ns__myStruct x; 107 x.first = "a"; 108 x.last = "b"; 109 result = x; 110 110 111 111 return SOAP_OK; … … 115 115 printf("in ns__sendBase64\n"); 116 116 117 printf("encodedLength = %d, decodedLength = %d, data[0][1][2][3] = %c%c%c%c\n", encodedLength, decodedLength, 118 data[0], data[1], data[2], data[3]); 119 120 HANDLE myHandle = CreateFileA("F:\\tmp\\soapcpp2.exe", (GENERIC_READ | GENERIC_WRITE), 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); 121 if(myHandle == INVALID_HANDLE_VALUE){ 122 printf("couldn't open the file. Exiting\n"); 123 return SOAP_ERR; 124 } 125 DWORD numWrote; 126 BOOL b = WriteFile(myHandle, data, decodedLength, &numWrote, NULL); 127 if(b){ 128 printf("Wrote %d bytes of data\n", numWrote); 129 } 130 CloseHandle(myHandle); 131 132 ns__myStruct x; 133 x.first = "a"; 134 x.last = "b"; 135 result = x; 136 137 return SOAP_OK; 138 139 } 140 141 int ns__sendMIME(struct soap *soap, int magicNumber, int &result){ 117 142 struct soap_multipart * attachment; 118 for(attachment = soap .mime.list; attachment; attachment = attachment->next){143 for(attachment = soap->mime.list; attachment; attachment = attachment->next){ 119 144 printf("MIME attachment:\n"); 120 145 printf("Memory=%p\n", (*attachment).ptr); … … 124 149 printf("ID=%s\n", (*attachment).id?(*attachment).id:"null"); 125 150 printf("Location=%s\n", (*attachment).location?(*attachment).location:"null"); 126 printf("Description=%s\n", (*attachment).description?(*attachment).description:"null 151 printf("Description=%s\n", (*attachment).description?(*attachment).description:"null"); 127 152 } 128 129 printf("=================DATA==============\n");130 printf("=================DATA==============\n");131 printf("=================DATA==============\n");132 printf("=================DATA==============\n");133 printf("First 4 = %c%c%c%c\n", data[0], data[1], data[2], data[3]);134 printf("encodedLength = %d, decodedLength = %d\n", encodedLength, decodedLength);135 // printf("Last 4 = %c%c%c%c\n", data[encodedLength-1], data[encodedLength-2], data[encodedLength-3], data[encodedLength-4]);136 153 137 138 ns__myStruct bob; 139 bob.first = "bob"; 140 bob.last = "dole"; 141 result = bob; 154 printf("magicNumber = %#x\n", magicNumber); 155 if(magicNumber == 123){ 156 result = 42; 157 } 158 else{ 159 result = 0; 160 } 142 161 143 162 return SOAP_OK; 144 145 163 } 146 capture-mod/trunk/capture.wsdl
r1743 r1749 57 57 </message> 58 58 59 <message name="sendMIMERequest"> 60 <part name="magicNumber" type="xsd:int"/> 61 </message> 62 63 <message name="sendMIMEResponse"> 64 <part name="result" type="xsd:int"/> 65 </message> 66 59 67 <message name="addRequest"> 60 68 <part name="a" type="xsd:int"/> … … 102 110 <output message="tns:s"/> 103 111 </operation> 112 <operation name="sendMIME"> 113 <documentation>Service definition of function ns__sendMIME</documentation> 114 <input message="tns:sendMIMERequest"/> 115 <output message="tns:sendMIMEResponse"/> 116 </operation> 104 117 <operation name="add"> 105 118 <documentation>Service definition of function ns__add</documentation> … … 136 149 </operation> 137 150 <operation name="sendBase64"> 151 <SOAP:operation style="rpc" soapAction=""/> 152 <input> 153 <SOAP:body use="encoded" namespace="capture" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 154 </input> 155 <output> 156 <SOAP:body use="encoded" namespace="capture" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 157 </output> 158 </operation> 159 <operation name="sendMIME"> 138 160 <SOAP:operation style="rpc" soapAction=""/> 139 161 <input> capture-mod/trunk/captureGSOAP.h
r1743 r1749 16 16 int ns__junks(char * a, ns__myStruct &result); 17 17 int ns__sendBase64(char * data, int encodedLength, int decodedLength, ns__myStruct &result); 18 int ns__sendMIME(int magicNumber, int &result); 18 19 19 20 int ns__add(int a, int b, int &result); capture-mod/trunk/client.pl
r1743 r1749 10 10 11 11 #test with a binary file 12 #open(A, $ARGV[0]) or die "Can't open $ARGV[0]\n";13 #$fullfile = "";14 #while(<A>){15 #$fullfile .= $_;16 #}12 open(A, $ARGV[0]) or die "Can't open $ARGV[0]\n"; 13 $fullfile = ""; 14 while(<A>){ 15 $fullfile .= $_; 16 } 17 17 #$encoded = encode_base64($fullfile); 18 18 #print "$fullfile\n"; 19 19 #print "$encoded\n"; 20 #@statz = stat($ARGV[0]); 21 #$decodedLength = $statz[7]; 20 @statz = stat($ARGV[0]); 21 $decodedLength = $statz[7]; 22 if(length($fullfile) != $decodedLength){ 23 print "What tha...\n"; 24 } 22 25 #$encodedLength = length($encoded); 23 26 #print "File size = " . $statz[7] . "\n"; … … 32 35 33 36 #$base64Data = SOAP::Data->name(data => $encoded, encodedLength => $encodedLength, decodedLength => $decodedLength); 34 $base64Data1 = SOAP::Data->name(data => $encoded); 35 $base64Data2 = SOAP::Data->name(encodedLength => $encodedLength); 37 #$base64Data1 = SOAP::Data->name(data => $fullfile); 38 $base64Data1 = SOAP::Data->name(data => "abcdefg"); 39 $base64Data2 = SOAP::Data->name(encodedLength => 0); 40 #$base64Data2 = SOAP::Data->name(encodedLength => 7); 36 41 $base64Data3 = SOAP::Data->name(decodedLength => $decodedLength); 42 #$base64Data3 = SOAP::Data->name(decodedLength => 8); 37 43 38 44 $pingDataA = SOAP::Data->name(a => "http://www.cnn.com"); … … 56 62 # -> result; 57 63 64 print "\ncalling client setup\n\n"; 65 # -> packager(SOAP::Lite::Packager::MIME->new) 66 # -> parts([$ent]) 67 $client = SOAP::Lite 68 -> proxy('http://192.168.0.131:1234/') 69 -> ns('capture'); 70 58 71 print "\ncalling sendBase64\n\n"; 59 $res = SOAP::Lite 60 -> packager(SOAP::Lite::Packager::MIME->new) 61 -> parts([$ent]) 62 -> proxy('http://192.168.0.131:1234/') 63 -> ns('capture') 64 -> sendBase64($base64Data1, $base64Data2, $base64Data3) 65 -> result; 72 $result = $client->sendBase64($base64Data1, $base64Data2, $base64Data3); 73 #$result = $client->sendMIME(31337); 66 74 67 print Dumper($res);75 #print Dumper($result); 68 76 69 77 print "calling junks\n"; capture-mod/trunk/soapC.cpp
r1743 r1749 8 8 #include "soapH.h" 9 9 10 SOAP_SOURCE_STAMP("@(#) soapC.cpp ver 2.7.10 2008-08-18 0 3:32:54GMT")10 SOAP_SOURCE_STAMP("@(#) soapC.cpp ver 2.7.10 2008-08-18 06:59:56 GMT") 11 11 12 12 … … 178 178 case SOAP_TYPE_ns__addResponse: 179 179 return soap_in_ns__addResponse(soap, NULL, NULL, "ns:addResponse"); 180 case SOAP_TYPE_ns__sendMIME: 181 return soap_in_ns__sendMIME(soap, NULL, NULL, "ns:sendMIME"); 182 case SOAP_TYPE_ns__sendMIMEResponse: 183 return soap_in_ns__sendMIMEResponse(soap, NULL, NULL, "ns:sendMIMEResponse"); 180 184 case SOAP_TYPE_ns__sendBase64: 181 185 return soap_in_ns__sendBase64(soap, NULL, NULL, "ns:sendBase64"); … … 240 244 { *type = SOAP_TYPE_ns__addResponse; 241 245 return soap_in_ns__addResponse(soap, NULL, NULL, NULL); 246 } 247 if (!soap_match_tag(soap, t, "ns:sendMIME")) 248 { *type = SOAP_TYPE_ns__sendMIME; 249 return soap_in_ns__sendMIME(soap, NULL, NULL, NULL); 250 } 251 if (!soap_match_tag(soap, t, "ns:sendMIMEResponse")) 252 { *type = SOAP_TYPE_ns__sendMIMEResponse; 253 return soap_in_ns__sendMIMEResponse(soap, NULL, NULL, NULL); 242 254 } 243 255 if (!soap_match_tag(soap, t, "ns:sendBase64")) … … 357 369 case SOAP_TYPE_ns__addResponse: 358 370 return soap_out_ns__addResponse(soap, tag, id, (const struct ns__addResponse *)ptr, "ns:addResponse"); 371 case SOAP_TYPE_ns__sendMIME: 372 return soap_out_ns__sendMIME(soap, tag, id, (const struct ns__sendMIME *)ptr, "ns:sendMIME"); 373 case SOAP_TYPE_ns__sendMIMEResponse: 374 return soap_out_ns__sendMIMEResponse(soap, tag, id, (const struct ns__sendMIMEResponse *)ptr, "ns:sendMIMEResponse"); 359 375 case SOAP_TYPE_ns__sendBase64: 360 376 return soap_out_ns__sendBase64(soap, tag, id, (const struct ns__sendBase64 *)ptr, "ns:sendBase64"); … … 414 430 soap_serialize_ns__addResponse(soap, (const struct ns__addResponse *)ptr); 415 431 break; 432 case SOAP_TYPE_ns__sendMIME: 433 soap_serialize_ns__sendMIME(soap, (const struct ns__sendMIME *)ptr); 434 break; 435 case SOAP_TYPE_ns__sendMIMEResponse: 436 soap_serialize_ns__sendMIMEResponse(soap, (const struct ns__sendMIMEResponse *)ptr); 437 break; 416 438 case SOAP_TYPE_ns__sendBase64: 417 439 soap_serialize_ns__sendBase64(soap, (const struct ns__sendBase64 *)ptr); … … 453 475 case SOAP_TYPE_ns__sendBase64: 454 476 return (void*)soap_instantiate_ns__sendBase64(soap, -1, type, arrayType, n); 477 case SOAP_TYPE_ns__sendMIMEResponse: 478 return (void*)soap_instantiate_ns__sendMIMEResponse(soap, -1, type, arrayType, n); 479 case SOAP_TYPE_ns__sendMIME: 480 return (void*)soap_instantiate_ns__sendMIME(soap, -1, type, arrayType, n); 455 481 case SOAP_TYPE_ns__addResponse: 456 482 return (void*)soap_instantiate_ns__addResponse(soap, -1, type, arrayType, n); … … 515 541 else 516 542 delete[] (struct ns__sendBase64*)p->ptr; 543 break; 544 case SOAP_TYPE_ns__sendMIMEResponse: 545 if (p->size < 0) 546 delete (struct ns__sendMIMEResponse*)p->ptr; 547 else 548 delete[] (struct ns__sendMIMEResponse*)p->ptr; 549 break; 550 case SOAP_TYPE_ns__sendMIME: 551 if (p->size < 0) 552 delete (struct ns__sendMIME*)p->ptr; 553 else 554 delete[] (struct ns__sendMIME*)p->ptr; 517 555 break; 518 556 case SOAP_TYPE_ns__addResponse: … … 2273 2311 } 2274 2312 2313 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__sendMIME(struct soap *soap, struct ns__sendMIME *a) 2314 { 2315 (void)soap; (void)a; /* appease -Wall -Werror */ 2316 soap_default_int(soap, &a->magicNumber); 2317 } 2318 2319 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns__sendMIME(struct soap *soap, const struct ns__sendMIME *a) 2320 { 2321 (void)soap; (void)a; /* appease -Wall -Werror */ 2322 } 2323 2324 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns__sendMIME(struct soap *soap, const struct ns__sendMIME *a, const char *tag, const char *type) 2325 { 2326 register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_ns__sendMIME); 2327 if (soap_out_ns__sendMIME(soap, tag, id, a, type)) 2328 return soap->error; 2329 return soap_putindependent(soap); 2330 } 2331 2332 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns__sendMIME(struct soap *soap, const char *tag, int id, const struct ns__sendMIME *a, const char *type) 2333 { 2334 if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns__sendMIME), type)) 2335 return soap->error; 2336 if (soap_out_int(soap, "magicNumber", -1, &a->magicNumber, "")) 2337 return soap->error; 2338 return soap_element_end_out(soap, tag); 2339 } 2340 2341 SOAP_FMAC3 struct ns__sendMIME * SOAP_FMAC4 soap_get_ns__sendMIME(struct soap *soap, struct ns__sendMIME *p, const char *tag, const char *type) 2342 { 2343 if ((p = soap_in_ns__sendMIME(soap, tag, p, type))) 2344 if (soap_getindependent(soap)) 2345 return NULL; 2346 return p; 2347 } 2348 2349 SOAP_FMAC3 struct ns__sendMIME * SOAP_FMAC4 soap_in_ns__sendMIME(struct soap *soap, const char *tag, struct ns__sendMIME *a, const char *type) 2350 { 2351 short soap_flag_magicNumber = 1; 2352 if (soap_element_begin_in(soap, tag, 0, type)) 2353 return NULL; 2354 a = (struct ns__sendMIME *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns__sendMIME, sizeof(struct ns__sendMIME), 0, NULL, NULL, NULL); 2355 if (!a) 2356 return NULL; 2357 soap_default_ns__sendMIME(soap, a); 2358 if (soap->body && !*soap->href) 2359 { 2360 for (;;) 2361 { soap->error = SOAP_TAG_MISMATCH; 2362 if (soap_flag_magicNumber && soap->error == SOAP_TAG_MISMATCH) 2363 if (soap_in_int(soap, "magicNumber", &a->magicNumber, "xsd:int")) 2364 { soap_flag_magicNumber--; 2365 continue; 2366 } 2367 if (soap->error == SOAP_TAG_MISMATCH) 2368 soap->error = soap_ignore_element(soap); 2369 if (soap->error == SOAP_NO_TAG) 2370 break; 2371 if (soap->error) 2372 return NULL; 2373 } 2374 if (soap_element_end_in(soap, tag)) 2375 return NULL; 2376 } 2377 else 2378 { a = (struct ns__sendMIME *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns__sendMIME, 0, sizeof(struct ns__sendMIME), 0, NULL); 2379 if (soap->body && soap_element_end_in(soap, tag)) 2380 return NULL; 2381 } 2382 if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_magicNumber > 0)) 2383 { soap->error = SOAP_OCCURS; 2384 return NULL; 2385 } 2386 return a; 2387 } 2388 2389 SOAP_FMAC5 struct ns__sendMIME * SOAP_FMAC6 soap_new_ns__sendMIME(struct soap *soap, int n) 2390 { return soap_instantiate_ns__sendMIME(soap, n, NULL, NULL, NULL); 2391 } 2392 2393 SOAP_FMAC5 void SOAP_FMAC6 soap_delete_ns__sendMIME(struct soap *soap, struct ns__sendMIME *p) 2394 { soap_delete(soap, p); 2395 } 2396 2397 SOAP_FMAC3 struct ns__sendMIME * SOAP_FMAC4 soap_instantiate_ns__sendMIME(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) 2398 { 2399 DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_ns__sendMIME(%d, %s, %s)\n", n, type?type:"", arrayType?arrayType:"")); 2400 struct soap_clist *cp = soap_link(soap, NULL, SOAP_TYPE_ns__sendMIME, n, soap_fdelete); 2401 if (!cp) 2402 return NULL; 2403 if (n < 0) 2404 { cp->ptr = (void*)new struct ns__sendMIME; 2405 if (size) 2406 *size = sizeof(struct ns__sendMIME); 2407 } 2408 else 2409 { cp->ptr = (void*)new struct ns__sendMIME[n]; 2410 if (!cp->ptr) 2411 { soap->error = SOAP_EOM; 2412 return NULL; 2413 } 2414 if (size) 2415 *size = n * sizeof(struct ns__sendMIME); 2416 } 2417 DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated location=%p\n", cp->ptr)); 2418 return (struct ns__sendMIME*)cp->ptr; 2419 } 2420 SOAP_FMAC3 void SOAP_FMAC4 soap_copy_ns__sendMIME(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n) 2421 { 2422 DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct ns__sendMIME %p -> %p\n", q, p)); 2423 *(struct ns__sendMIME*)p = *(struct ns__sendMIME*)q; 2424 } 2425 2426 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__sendMIMEResponse(struct soap *soap, struct ns__sendMIMEResponse *a) 2427 { 2428 (void)soap; (void)a; /* appease -Wall -Werror */ 2429 soap_default_int(soap, &a->result); 2430 } 2431 2432 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns__sendMIMEResponse(struct soap *soap, const struct ns__sendMIMEResponse *a) 2433 { 2434 (void)soap; (void)a; /* appease -Wall -Werror */ 2435 } 2436 2437 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns__sendMIMEResponse(struct soap *soap, const struct ns__sendMIMEResponse *a, const char *tag, const char *type) 2438 { 2439 register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_ns__sendMIMEResponse); 2440 if (soap_out_ns__sendMIMEResponse(soap, tag, id, a, type)) 2441 return soap->error; 2442 return soap_putindependent(soap); 2443 } 2444 2445 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns__sendMIMEResponse(struct soap *soap, const char *tag, int id, const struct ns__sendMIMEResponse *a, const char *type) 2446 { 2447 if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns__sendMIMEResponse), type)) 2448 return soap->error; 2449 if (soap_out_int(soap, "result", -1, &a->result, "")) 2450 return soap->error; 2451 return soap_element_end_out(soap, tag); 2452 } 2453 2454 SOAP_FMAC3 struct ns__sendMIMEResponse * SOAP_FMAC4 soap_get_ns__sendMIMEResponse(struct soap *soap, struct ns__sendMIMEResponse *p, const char *tag, const char *type) 2455 { 2456 if ((p = soap_in_ns__sendMIMEResponse(soap, tag, p, type))) 2457 if (soap_getindependent(soap)) 2458 return NULL; 2459 return p; 2460 } 2461 2462 SOAP_FMAC3 struct ns__sendMIMEResponse * SOAP_FMAC4 soap_in_ns__sendMIMEResponse(struct soap *soap, const char *tag, struct ns__sendMIMEResponse *a, const char *type) 2463 { 2464 short soap_flag_result = 1; 2465 if (soap_element_begin_in(soap, tag, 0, type)) 2466 return NULL; 2467 a = (struct ns__sendMIMEResponse *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns__sendMIMEResponse, sizeof(struct ns__sendMIMEResponse), 0, NULL, NULL, NULL); 2468 if (!a) 2469 return NULL; 2470 soap_default_ns__sendMIMEResponse(soap, a); 2471 if (soap->body && !*soap->href) 2472 { 2473 for (;;) 2474 { soap->error = SOAP_TAG_MISMATCH; 2475 if (soap_flag_result && soap->error == SOAP_TAG_MISMATCH) 2476 if (soap_in_int(soap, "result", &a->result, "xsd:int")) 2477 { soap_flag_result--; 2478 continue; 2479 } 2480 if (soap->error == SOAP_TAG_MISMATCH) 2481 soap->error = soap_ignore_element(soap); 2482 if (soap->error == SOAP_NO_TAG) 2483 break; 2484 if (soap->error) 2485 return NULL; 2486 } 2487 if (soap_element_end_in(soap, tag)) 2488 return NULL; 2489 } 2490 else 2491 { a = (struct ns__sendMIMEResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns__sendMIMEResponse, 0, sizeof(struct ns__sendMIMEResponse), 0, NULL); 2492 if (soap->body && soap_element_end_in(soap, tag)) 2493 return NULL; 2494 } 2495 if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_result > 0)) 2496 { soap->error = SOAP_OCCURS; 2497 return NULL; 2498 } 2499 return a; 2500 } 2501 2502 SOAP_FMAC5 struct ns__sendMIMEResponse * SOAP_FMAC6 soap_new_ns__sendMIMEResponse(struct soap *soap, int n) 2503 { return soap_instantiate_ns__sendMIMEResponse(soap, n, NULL, NULL, NULL); 2504 } 2505 2506 SOAP_FMAC5 void SOAP_FMAC6 soap_delete_ns__sendMIMEResponse(struct soap *soap, struct ns__sendMIMEResponse *p) 2507 { soap_delete(soap, p); 2508 } 2509 2510 SOAP_FMAC3 struct ns__sendMIMEResponse * SOAP_FMAC4 soap_instantiate_ns__sendMIMEResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) 2511 { 2512 DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_ns__sendMIMEResponse(%d, %s, %s)\n", n, type?type:"", arrayType?arrayType:"")); 2513 struct soap_clist *cp = soap_link(soap, NULL, SOAP_TYPE_ns__sendMIMEResponse, n, soap_fdelete); 2514 if (!cp) 2515 return NULL; 2516 if (n < 0) 2517 { cp->ptr = (void*)new struct ns__sendMIMEResponse; 2518 if (size) 2519 *size = sizeof(struct ns__sendMIMEResponse); 2520 } 2521 else 2522 { cp->ptr = (void*)new struct ns__sendMIMEResponse[n]; 2523 if (!cp->ptr) 2524 { soap->error = SOAP_EOM; 2525 return NULL; 2526 } 2527 if (size) 2528 *size = n * sizeof(struct ns__sendMIMEResponse); 2529 } 2530 DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated location=%p\n", cp->ptr)); 2531 return (struct ns__sendMIMEResponse*)cp->ptr; 2532 } 2533 SOAP_FMAC3 void SOAP_FMAC4 soap_copy_ns__sendMIMEResponse(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n) 2534 { 2535 DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct ns__sendMIMEResponse %p -> %p\n", q, p)); 2536 *(struct ns__sendMIMEResponse*)p = *(struct ns__sendMIMEResponse*)q; 2537 } 2538 2275 2539 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__sendBase64(struct soap *soap, struct ns__sendBase64 *a) 2276 2540 { capture-mod/trunk/soapClient.cpp
r1743 r1749 7 7 #include "soapH.h" 8 8 9 SOAP_SOURCE_STAMP("@(#) soapClient.cpp ver 2.7.10 2008-08-18 0 3:32:54GMT")9 SOAP_SOURCE_STAMP("@(#) soapClient.cpp ver 2.7.10 2008-08-18 06:59:56 GMT") 10 10 11 11 … … 112 112 } 113 113 114 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns__sendMIME(struct soap *soap, const char *soap_endpoint, const char *soap_action, int magicNumber, int &result) 115 { struct ns__sendMIME soap_tmp_ns__sendMIME; 116 struct ns__sendMIMEResponse *soap_tmp_ns__sendMIMEResponse; 117 if (!soap_endpoint) 118 soap_endpoint = "http://192.168.0.131:1234"; 119 soap->encodingStyle = ""; 120 soap_tmp_ns__sendMIME.magicNumber = magicNumber; 121 soap_begin(soap); 122 soap_serializeheader(soap); 123 soap_serialize_ns__sendMIME(soap, &soap_tmp_ns__sendMIME); 124 if (soap_begin_count(soap)) 125 return soap->error; 126 if (soap->mode & SOAP_IO_LENGTH) 127 { if (soap_envelope_begin_out(soap) 128 || soap_putheader(soap) 129 || soap_body_begin_out(soap) 130 || soap_put_ns__sendMIME(soap, &soap_tmp_ns__sendMIME, "ns:sendMIME", "") 131 || soap_body_end_out(soap) 132 || soap_envelope_end_out(soap)) 133 return soap->error; 134 } 135 if (soap_end_count(soap)) 136 return soap->error; 137 if (soap_connect(soap, soap_endpoint, soap_action) 138 || soap_envelope_begin_out(soap) 139 || soap_putheader(soap) 140 || soap_body_begin_out(soap) 141 || soap_put_ns__sendMIME(soap, &soap_tmp_ns__sendMIME, "ns:sendMIME", "") 142 || soap_body_end_out(soap) 143 || soap_envelope_end_out(soap) 144 || soap_end_send(soap)) 145 return soap_closesock(soap); 146 soap_default_int(soap, &result); 147 if (soap_begin_recv(soap) 148 || soap_envelope_begin_in(soap) 149 || soap_recv_header(soap) 150 || soap_body_begin_in(soap)) 151 return soap_closesock(soap); 152 soap_tmp_ns__sendMIMEResponse = soap_get_ns__sendMIMEResponse(soap, NULL, "ns:sendMIMEResponse", ""); 153 if (soap->error) 154 { if (soap->error == SOAP_TAG_MISMATCH && soap->level == 2) 155 return soap_recv_fault(soap); 156 return soap_closesock(soap); 157 } 158 if (soap_body_end_in(soap) 159 || soap_envelope_end_in(soap) 160 || soap_end_recv(soap)) 161 return soap_closesock(soap); 162 result = soap_tmp_ns__sendMIMEResponse->result; 163 return soap_closesock(soap); 164 } 165 114 166 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns__add(struct soap *soap, const char *soap_endpoint, const char *soap_action, int a, int b, int &result) 115 167 { struct ns__add soap_tmp_ns__add; capture-mod/trunk/soapH.h
r1743 r1749 49 49 50 50 #ifndef SOAP_TYPE_double 51 #define SOAP_TYPE_double (2 5)51 #define SOAP_TYPE_double (28) 52 52 #endif 53 53 SOAP_FMAC3 void SOAP_FMAC4 soap_default_double(struct soap*, double *); … … 60 60 61 61 #ifndef SOAP_TYPE_SOAP_ENV__Fault 62 #define SOAP_TYPE_SOAP_ENV__Fault ( 37)62 #define SOAP_TYPE_SOAP_ENV__Fault (40) 63 63 #endif 64 64 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Fault(struct soap*, struct SOAP_ENV__Fault *); … … 78 78 79 79 #ifndef SOAP_TYPE_SOAP_ENV__Reason 80 #define SOAP_TYPE_SOAP_ENV__Reason (3 6)80 #define SOAP_TYPE_SOAP_ENV__Reason (39) 81 81 #endif 82 82 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *); … … 96 96 97 97 #ifndef SOAP_TYPE_SOAP_ENV__Detail 98 #define SOAP_TYPE_SOAP_ENV__Detail (3 3)98 #define SOAP_TYPE_SOAP_ENV__Detail (36) 99 99 #endif 100 100 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *); … … 114 114 115 115 #ifndef SOAP_TYPE_SOAP_ENV__Code 116 #define SOAP_TYPE_SOAP_ENV__Code (3 1)116 #define SOAP_TYPE_SOAP_ENV__Code (34) 117 117 #endif 118 118 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *); … … 132 132 133 133 #ifndef SOAP_TYPE_SOAP_ENV__Header 134 #define SOAP_TYPE_SOAP_ENV__Header (3 0)134 #define SOAP_TYPE_SOAP_ENV__Header (33) 135 135 #endif 136 136 SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Header(struct soap*, struct SOAP_ENV__Header *); … … 148 148 149 149 #ifndef SOAP_TYPE_ns__sub 150 #define SOAP_TYPE_ns__sub ( 29)150 #define SOAP_TYPE_ns__sub (32) 151 151 #endif 152 152 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__sub(struct soap*, struct ns__sub *); … … 162 162 163 163 #ifndef SOAP_TYPE_ns__subResponse 164 #define SOAP_TYPE_ns__subResponse ( 28)164 #define SOAP_TYPE_ns__subResponse (31) 165 165 #endif 166 166 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__subResponse(struct soap*, struct ns__subResponse *); … … 176 176 177 177 #ifndef SOAP_TYPE_ns__visit 178 #define SOAP_TYPE_ns__visit (2 4)178 #define SOAP_TYPE_ns__visit (27) 179 179 #endif 180 180 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__visit(struct soap*, struct ns__visit *); … … 190 190 191 191 #ifndef SOAP_TYPE_ns__visitResponse 192 #define SOAP_TYPE_ns__visitResponse (2 3)192 #define SOAP_TYPE_ns__visitResponse (26) 193 193 #endif 194 194 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__visitResponse(struct soap*, struct ns__visitResponse *); … … 204 204 205 205 #ifndef SOAP_TYPE_ns__ping 206 #define SOAP_TYPE_ns__ping (2 1)206 #define SOAP_TYPE_ns__ping (24) 207 207 #endif 208 208 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__ping(struct soap*, struct ns__ping *); … … 218 218 219 219 #ifndef SOAP_TYPE_ns__pingResponse 220 #define SOAP_TYPE_ns__pingResponse (2 0)220 #define SOAP_TYPE_ns__pingResponse (23) 221 221 #endif 222 222 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__pingResponse(struct soap*, struct ns__pingResponse *); … … 232 232 233 233 #ifndef SOAP_TYPE_ns__add 234 #define SOAP_TYPE_ns__add ( 17)234 #define SOAP_TYPE_ns__add (20) 235 235 #endif 236 236 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__add(struct soap*, struct ns__add *); … … 246 246 247 247 #ifndef SOAP_TYPE_ns__addResponse 248 #define SOAP_TYPE_ns__addResponse (1 6)248 #define SOAP_TYPE_ns__addResponse (19) 249 249 #endif 250 250 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__addResponse(struct soap*, struct ns__addResponse *); … … 259 259 SOAP_FMAC3 void SOAP_FMAC4 soap_copy_ns__addResponse(struct soap*, int, int, void*, size_t, const void*, size_t); 260 260 261 #ifndef SOAP_TYPE_ns__sendMIME 262 #define SOAP_TYPE_ns__sendMIME (17) 263 #endif 264 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__sendMIME(struct soap*, struct ns__sendMIME *); 265 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns__sendMIME(struct soap*, const struct ns__sendMIME *); 266 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns__sendMIME(struct soap*, const struct ns__sendMIME *, const char*, const char*); 267 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns__sendMIME(struct soap*, const char*, int, const struct ns__sendMIME *, const char*); 268 SOAP_FMAC3 struct ns__sendMIME * SOAP_FMAC4 soap_get_ns__sendMIME(struct soap*, struct ns__sendMIME *, const char*, const char*); 269 SOAP_FMAC3 struct ns__sendMIME * SOAP_FMAC4 soap_in_ns__sendMIME(struct soap*, const char*, struct ns__sendMIME *, const char*); 270 SOAP_FMAC5 struct ns__sendMIME * SOAP_FMAC6 soap_new_ns__sendMIME(struct soap*, int); 271 SOAP_FMAC5 void SOAP_FMAC6 soap_delete_ns__sendMIME(struct soap*, struct ns__sendMIME*); 272 SOAP_FMAC3 struct ns__sendMIME * SOAP_FMAC4 soap_instantiate_ns__sendMIME(struct soap*, int, const char*, const char*, size_t*); 273 SOAP_FMAC3 void SOAP_FMAC4 soap_copy_ns__sendMIME(struct soap*, int, int, void*, size_t, const void*, size_t); 274 275 #ifndef SOAP_TYPE_ns__sendMIMEResponse 276 #define SOAP_TYPE_ns__sendMIMEResponse (16) 277 #endif 278 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__sendMIMEResponse(struct soap*, struct ns__sendMIMEResponse *); 279 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns__sendMIMEResponse(struct soap*, const struct ns__sendMIMEResponse *); 280 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns__sendMIMEResponse(struct soap*, const struct ns__sendMIMEResponse *, const char*, const char*); 281 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns__sendMIMEResponse(struct soap*, const char*, int, const struct ns__sendMIMEResponse *, const char*); 282 SOAP_FMAC3 struct ns__sendMIMEResponse * SOAP_FMAC4 soap_get_ns__sendMIMEResponse(struct soap*, struct ns__sendMIMEResponse *, const char*, const char*); 283 SOAP_FMAC3 struct ns__sendMIMEResponse * SOAP_FMAC4 soap_in_ns__sendMIMEResponse(struct soap*, const char*, struct ns__sendMIMEResponse *, const char*); 284 SOAP_FMAC5 struct ns__sendMIMEResponse * SOAP_FMAC6 soap_new_ns__sendMIMEResponse(struct soap*, int); 285 SOAP_FMAC5 void SOAP_FMAC6 soap_delete_ns__sendMIMEResponse(struct soap*, struct ns__sendMIMEResponse*); 286 SOAP_FMAC3 struct ns__sendMIMEResponse * SOAP_FMAC4 soap_instantiate_ns__sendMIMEResponse(struct soap*, int, const char*, const char*, size_t*); 287 SOAP_FMAC3 void SOAP_FMAC4 soap_copy_ns__sendMIMEResponse(struct soap*, int, int, void*, size_t, const void*, size_t); 288 261 289 #ifndef SOAP_TYPE_ns__sendBase64 262 290 #define SOAP_TYPE_ns__sendBase64 (13) … … 318 346 319 347 #ifndef SOAP_TYPE_PointerToSOAP_ENV__Reason 320 #define SOAP_TYPE_PointerToSOAP_ENV__Reason ( 39)348 #define SOAP_TYPE_PointerToSOAP_ENV__Reason (42) 321 349 #endif 322 350 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *const*); … … 331 359 332 360 #ifndef SOAP_TYPE_PointerToSOAP_ENV__Detail 333 #define SOAP_TYPE_PointerToSOAP_ENV__Detail ( 38)361 #define SOAP_TYPE_PointerToSOAP_ENV__Detail (41) 334 362 #endif 335 363 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *const*); … … 344 372 345 373 #ifndef SOAP_TYPE_PointerToSOAP_ENV__Code 346 #define SOAP_TYPE_PointerToSOAP_ENV__Code (3 2)374 #define SOAP_TYPE_PointerToSOAP_ENV__Code (35) 347 375 #endif 348 376 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *const*); … … 355 383 356 384 #ifndef SOAP_TYPE_PointerTostring 357 #define SOAP_TYPE_PointerTostring ( 18)385 #define SOAP_TYPE_PointerTostring (21) 358 386 #endif 359 387 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTostring(struct soap*, char **const*); capture-mod/trunk/soapServer.cpp
r1743 r1749 7 7 #include "soapH.h" 8 8 9 SOAP_SOURCE_STAMP("@(#) soapServer.cpp ver 2.7.10 2008-08-18 0 3:32:54GMT")9 SOAP_SOURCE_STAMP("@(#) soapServer.cpp ver 2.7.10 2008-08-18 06:59:56 GMT") 10 10 11 11 … … 78 78 if (!soap_match_tag(soap, soap->tag, "ns:sendBase64")) 79 79 return soap_serve_ns__sendBase64(soap); 80 if (!soap_match_tag(soap, soap->tag, "ns:sendMIME")) 81 return soap_serve_ns__sendMIME(soap); 80 82 if (!soap_match_tag(soap, soap->tag, "ns:add")) 81 83 return soap_serve_ns__add(soap); … … 172 174 } 173 175 176 SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns__sendMIME(struct soap *soap) 177 { struct ns__sendMIME soap_tmp_ns__sendMIME; 178 struct ns__sendMIMEResponse soap_tmp_ns__sendMIMEResponse; 179 soap_default_ns__sendMIMEResponse(soap, &soap_tmp_ns__sendMIMEResponse); 180 soap_default_ns__sendMIME(soap, &soap_tmp_ns__sendMIME); 181 soap->encodingStyle = ""; 182 if (!soap_get_ns__sendMIME(soap, &soap_tmp_ns__sendMIME, "ns:sendMIME", NULL)) 183 return soap->error; 184 if (soap_body_end_in(soap) 185 || soap_envelope_end_in(soap) 186 || soap_end_recv(soap)) 187 return soap->error; 188 soap->error = ns__sendMIME(soap, soap_tmp_ns__sendMIME.magicNumber, soap_tmp_ns__sendMIMEResponse.result); 189 if (soap->error) 190 return soap->error; 191 soap_serializeheader(soap); 192 soap_serialize_ns__sendMIMEResponse(soap, &soap_tmp_ns__sendMIMEResponse); 193 if (soap_begin_count(soap)) 194 return soap->error; 195 if (soap->mode & SOAP_IO_LENGTH) 196 { if (soap_envelope_begin_out(soap) 197 || soap_putheader(soap) 198 || soap_body_begin_out(soap) 199 || soap_put_ns__sendMIMEResponse(soap, &soap_tmp_ns__sendMIMEResponse, "ns:sendMIMEResponse", "") 200 || soap_body_end_out(soap) 201 || soap_envelope_end_out(soap)) 202 return soap->error; 203 }; 204 if (soap_end_count(soap) 205 || soap_response(soap, SOAP_OK) 206 || soap_envelope_begin_out(soap) 207 || soap_putheader(soap) 208 || soap_body_begin_out(soap) 209 || soap_put_ns__sendMIMEResponse(soap, &soap_tmp_ns__sendMIMEResponse, "ns:sendMIMEResponse", "") 210 || soap_body_end_out(soap) 211 || soap_envelope_end_out(soap) 212 || soap_end_send(soap)) 213 return soap->error; 214 return soap_closesock(soap); 215 } 216 174 217 SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns__add(struct soap *soap) 175 218 { struct ns__add soap_tmp_ns__add; capture-mod/trunk/soapStub.h
r1743 r1749 61 61 #endif 62 62 63 #ifndef SOAP_TYPE_ns__sendMIMEResponse 64 #define SOAP_TYPE_ns__sendMIMEResponse (16) 65 /* ns:sendMIMEResponse */ 66 struct ns__sendMIMEResponse 67 { 68 public: 69 int result; /* SOAP 1.2 RPC return element (when namespace qualified) */ /* required element of type xsd:int */ 70 }; 71 #endif 72 73 #ifndef SOAP_TYPE_ns__sendMIME 74 #define SOAP_TYPE_ns__sendMIME (17) 75 /* ns:sendMIME */ 76 struct ns__sendMIME 77 { 78 public: 79 int magicNumber; /* required element of type xsd:int */ 80 }; 81 #endif 82 63 83 #ifndef SOAP_TYPE_ns__addResponse 64 #define SOAP_TYPE_ns__addResponse (1 6)84 #define SOAP_TYPE_ns__addResponse (19) 65 85 /* ns:addResponse */ 66 86 struct ns__addResponse … … 72 92 73 93 #ifndef SOAP_TYPE_ns__add 74 #define SOAP_TYPE_ns__add ( 17)94 #define SOAP_TYPE_ns__add (20) 75 95 /* ns:add */ 76 96 struct ns__add … … 83 103 84 104 #ifndef SOAP_TYPE_ns__pingResponse 85 #define SOAP_TYPE_ns__pingResponse (2 0)105 #define SOAP_TYPE_ns__pingResponse (23) 86 106 /* ns:pingResponse */ 87 107 struct ns__pingResponse … … 93 113 94 114 #ifndef SOAP_TYPE_ns__ping 95 #define SOAP_TYPE_ns__ping (2 1)115 #define SOAP_TYPE_ns__ping (24) 96 116 /* ns:ping */ 97 117 struct ns__ping … … 103 123 104 124 #ifndef SOAP_TYPE_ns__visitResponse 105 #define SOAP_TYPE_ns__visitResponse (2 3)125 #define SOAP_TYPE_ns__visitResponse (26) 106 126 /* ns:visitResponse */ 107 127 struct ns__visitResponse … … 113 133 114 134 #ifndef SOAP_TYPE_ns__visit 115 #define SOAP_TYPE_ns__visit (2 4)135 #define SOAP_TYPE_ns__visit (27) 116 136 /* ns:visit */ 117 137 struct ns__visit … … 123 143 124 144 #ifndef SOAP_TYPE_ns__subResponse 125 #define SOAP_TYPE_ns__subResponse ( 28)145 #define SOAP_TYPE_ns__subResponse (31) 126 146 /* ns:subResponse */ 127 147 struct ns__subResponse … … 133 153 134 154 #ifndef SOAP_TYPE_ns__sub 135 #define SOAP_TYPE_ns__sub ( 29)155 #define SOAP_TYPE_ns__sub (32) 136 156 /* ns:sub */ 137 157 struct ns__sub … … 144 164 145 165 #ifndef SOAP_TYPE_SOAP_ENV__Header 146 #define SOAP_TYPE_SOAP_ENV__Header (3 0)166 #define SOAP_TYPE_SOAP_ENV__Header (33) 147 167 /* SOAP Header: */ 148 168 struct SOAP_ENV__Header … … 156 176 157 177 #ifndef SOAP_TYPE_SOAP_ENV__Code 158 #define SOAP_TYPE_SOAP_ENV__Code (3 1)178 #define SOAP_TYPE_SOAP_ENV__Code (34) 159 179 /* SOAP Fault Code: */ 160 180 struct SOAP_ENV__Code … … 167 187 168 188 #ifndef SOAP_TYPE_SOAP_ENV__Detail 169 #define SOAP_TYPE_SOAP_ENV__Detail (3 3)189 #define SOAP_TYPE_SOAP_ENV__Detail (36) 170 190 /* SOAP-ENV:Detail */ 171 191 struct SOAP_ENV__Detail … … 179 199 180 200 #ifndef SOAP_TYPE_SOAP_ENV__Reason 181 #define SOAP_TYPE_SOAP_ENV__Reason (3 6)201 #define SOAP_TYPE_SOAP_ENV__Reason (39) 182 202 /* SOAP-ENV:Reason */ 183 203 struct SOAP_ENV__Reason … … 189 209 190 210 #ifndef SOAP_TYPE_SOAP_ENV__Fault 191 #define SOAP_TYPE_SOAP_ENV__Fault ( 37)211 #define SOAP_TYPE_SOAP_ENV__Fault (40) 192 212 /* SOAP Fault: */ 193 213 struct SOAP_ENV__Fault … … 260 280 SOAP_FMAC5 int SOAP_FMAC6 ns__sendBase64(struct soap*, char *data, int encodedLength, int decodedLength, struct s &result); 261 281 282 SOAP_FMAC5 int SOAP_FMAC6 ns__sendMIME(struct soap*, int magicNumber, int &result); 283 262 284 SOAP_FMAC5 int SOAP_FMAC6 ns__add(struct soap*, int a, int b, int &result); 263 285 … … 279 301 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns__sendBase64(struct soap *soap, const char *soap_endpoint, const char *soap_action, char *data, int encodedLength, int decodedLength, struct s &result); 280 302 303 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns__sendMIME(struct soap *soap, const char *soap_endpoint, const char *soap_action, int magicNumber, int &result); 304 281 305 SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns__add(struct soap *soap, const char *soap_endpoint, const char *soap_action, int a, int b, int &result); 282 306 … … 301 325 SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns__sendBase64(struct soap*); 302 326 327 SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns__sendMIME(struct soap*); 328 303 329 SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns__add(struct soap*); 304 330
