Changeset 1762
- Timestamp:
- 08/21/08 13:55:59 (3 months ago)
- Files:
-
- capture-mod/trunk/CaptureSoapServer.cpp (modified) (4 diffs)
- capture-mod/trunk/capture.wsdl (modified) (9 diffs)
- capture-mod/trunk/captureGSOAP.h (modified) (2 diffs)
- capture-mod/trunk/install/CaptureBAT.exe (modified) (previous)
- capture-mod/trunk/soapC.cpp (modified) (41 diffs)
- capture-mod/trunk/soapClient.cpp (modified) (5 diffs)
- capture-mod/trunk/soapH.h (modified) (20 diffs)
- capture-mod/trunk/soapServer.cpp (modified) (6 diffs)
- capture-mod/trunk/soapStub.h (modified) (25 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
capture-mod/trunk/CaptureSoapServer.cpp
r1761 r1762 57 57 } 58 58 59 60 // Implementation of the "add" remote method:61 int ns__add(struct soap *soap, int a, int b, int &result)62 {63 //printf("add got %d and %d\n", a, b);64 result = a + b;65 66 return SOAP_OK;67 }68 69 59 int ns__ping(struct soap *soap, char * a, char ** result) 70 60 { … … 94 84 } 95 85 96 // Implementation of the "sub" remote method: 97 int ns__sub(struct soap *soap, double a, double b, double &result) 98 { 99 result = a - b; 100 return SOAP_OK; 101 } 102 103 104 int ns__junks(struct soap *soap, char * a, ns__myStruct &result) 105 { 106 printf("in ns__junks\n"); 107 ns__myStruct x; 108 x.first = "a"; 109 x.last = "b"; 110 result = x; 111 112 return SOAP_OK; 113 } 114 115 int ns__sendFileBase64(struct soap *soap, char * fileName, char * data, unsigned int encodedLength, unsigned int decodedLength, ns__myStruct &result){ 86 int ns__sendFileBase64(struct soap *soap, char * fileName, char * data, unsigned int encodedLength, unsigned int decodedLength, int &result){ 116 87 printf("in ns__sendFileBase64\n"); 117 88 … … 146 117 delete[] decodedData; 147 118 148 ns__myStruct x;149 x.first = "a"; 150 x.last = "b";151 result = x; 152 153 return SOAP_OK; 154 155 } 156 119 result = 1; 120 121 return SOAP_OK; 122 123 } 124 125 //Allows you to ask for a file and get it back in base64. 126 //NOTE: While I know it will be mitigated by the network architecture, features like this 127 //are why we should look into SOAP over SSL 157 128 int ns__receiveFileBase64(struct soap *soap, char * fileName, ns__receiveFileStruct &result){ 158 129 int debug = 0; … … 213 184 } 214 185 186 //After we have sent a document into the VM, open it 187 //We want to do this in a generic way, so rather than calling specific applications with the 188 //document as the parameter, we instead exploit the fact that as long as default handlers are 189 //set for a given file type, it can be run from the command line by simply typing its name. 190 //Thus we run cmd.exe with the /K option and the document name as a parameter. 191 //From cmd.exe help: "/K Carries out the command specified by string but remains" 192 int ns__openDocument(struct soap *soap, char * fileName, int &result){ 193 int debug = 1; 194 if(debug) printf("in ns__openDocument\n"); 195 196 //Create the string for the parameters 197 wchar_t * docName = new wchar_t[1024]; 198 wsprintf(docName, L"/D %hs", fileName); 199 200 //open with cmd.exe 201 STARTUPINFO myStart; 202 memset(&myStart, 0, sizeof(STARTUPINFO)); 203 myStart.dwFlags = 0; 204 PROCESS_INFORMATION procInfo; 205 BOOL b = CreateProcess(L"C:\\WINDOWS\\system32\\cmd.exe", L"", NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, 206 NULL, NULL, &myStart, &procInfo); 207 if(!b){ 208 printf("CreateProcess failed with error %d\n", GetLastError()); 209 return SOAP_ERR; 210 } 211 212 if(debug) printf("dwProcessId = %d, dwThreadId = %d\n", procInfo.dwProcessId, procInfo.dwThreadId); 213 214 CloseHandle(procInfo.hProcess); 215 CloseHandle(procInfo.hThread); 216 217 return SOAP_OK; 218 } 219 220 //Thus far, SOAP::Lite hasn't been sending the data correctly, so we never get into this function. 221 //Removing the "This is a multipart message in MIME format..." from MIME::Entity's Entity.pm at least gets 222 //rid of the gSOAP "No XML element" error, but then it doesn't seem to ever exit the SOAP::Lite send. 215 223 int ns__sendMIME(struct soap *soap, int magicNumber, int &result){ 216 224 printf("In ns__sendMIME\n"); 217 225 226 //From the gSOAP documentation example 218 227 struct soap_multipart * attachment; 219 228 for(attachment = soap->mime.list; attachment; attachment = attachment->next){ capture-mod/trunk/capture.wsdl
r1760 r1762 26 26 attributeFormDefault="unqualified"> 27 27 <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> 28 <complexType name="myStruct">29 <complexContent>30 <restriction base="ns:s">31 </restriction>32 </complexContent>33 </complexType>34 28 <complexType name="receiveFileStruct"> 35 29 <complexContent> … … 37 31 </restriction> 38 32 </complexContent> 39 </complexType>40 <complexType name="s">41 <sequence>42 <element name="first" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>43 <element name="last" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>44 </sequence>45 33 </complexType> 46 34 <complexType name="rcvS"> … … 55 43 </types> 56 44 57 <message name="junks"> 58 <part name="a" type="xsd:string"/> 59 </message> 60 61 <message name="s"> 62 <part name="first" type="xsd:string"/> 63 <part name="last" type="xsd:string"/> 64 </message> 65 66 <message name="sendFileBase64"> 45 <message name="sendFileBase64Request"> 67 46 <part name="fileName" type="xsd:string"/> 68 47 <part name="data" type="xsd:string"/> 69 48 <part name="encodedLength" type="xsd:unsignedInt"/> 70 49 <part name="decodedLength" type="xsd:unsignedInt"/> 50 </message> 51 52 <message name="sendFileBase64Response"> 53 <part name="result" type="xsd:int"/> 71 54 </message> 72 55 … … 89 72 </message> 90 73 91 <message name="addRequest"> 92 <part name="a" type="xsd:int"/> 93 <part name="b" type="xsd:int"/> 74 <message name="openDocumentRequest"> 75 <part name="fileName" type="xsd:string"/> 94 76 </message> 95 77 96 <message name=" addResponse">78 <message name="openDocumentResponse"> 97 79 <part name="result" type="xsd:int"/> 98 80 </message> … … 114 96 </message> 115 97 116 <message name="subRequest">117 <part name="a" type="xsd:double"/>118 <part name="b" type="xsd:double"/>119 </message>120 121 <message name="subResponse">122 <part name="result" type="xsd:double"/>123 </message>124 125 98 <portType name="capturePortType"> 126 <operation name="junks">127 <documentation>Service definition of function ns__junks</documentation>128 <input message="tns:junks"/>129 <output message="tns:s"/>130 </operation>131 99 <operation name="sendFileBase64"> 132 100 <documentation>Service definition of function ns__sendFileBase64</documentation> 133 <input message="tns:sendFileBase64 "/>134 <output message="tns:s "/>101 <input message="tns:sendFileBase64Request"/> 102 <output message="tns:sendFileBase64Response"/> 135 103 </operation> 136 104 <operation name="receiveFileBase64"> … … 144 112 <output message="tns:sendMIMEResponse"/> 145 113 </operation> 146 <operation name=" add">147 <documentation>Service definition of function ns__ add</documentation>148 <input message="tns: addRequest"/>149 <output message="tns: addResponse"/>114 <operation name="openDocument"> 115 <documentation>Service definition of function ns__openDocument</documentation> 116 <input message="tns:openDocumentRequest"/> 117 <output message="tns:openDocumentResponse"/> 150 118 </operation> 151 119 <operation name="ping"> … … 159 127 <output message="tns:visitResponse"/> 160 128 </operation> 161 <operation name="sub">162 <documentation>Service definition of function ns__sub</documentation>163 <input message="tns:subRequest"/>164 <output message="tns:subResponse"/>165 </operation>166 129 </portType> 167 130 168 131 <binding name="capture" type="tns:capturePortType"> 169 132 <SOAP:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> 170 <operation name="junks">171 <SOAP:operation style="rpc" soapAction=""/>172 <input>173 <SOAP:body use="encoded" namespace="capture" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>174 </input>175 <output>176 <SOAP:body use="encoded" namespace="capture" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>177 </output>178 </operation>179 133 <operation name="sendFileBase64"> 180 134 <SOAP:operation style="rpc" soapAction=""/> … … 204 158 </output> 205 159 </operation> 206 <operation name=" add">160 <operation name="openDocument"> 207 161 <SOAP:operation style="rpc" soapAction=""/> 208 162 <input> … … 231 185 </output> 232 186 </operation> 233 <operation name="sub">234 <SOAP:operation style="rpc" soapAction=""/>235 <input>236 <SOAP:body use="encoded" namespace="capture" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>237 </input>238 <output>239 <SOAP:body use="encoded" namespace="capture" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>240 </output>241 </operation>242 187 </binding> 243 188 capture-mod/trunk/captureGSOAP.h
r1760 r1762 9 9 10 10 11 typedef struct s{12 char * first;13 char * last;14 } ns__myStruct;15 16 11 typedef struct rcvS{ 17 12 char * data; … … 20 15 } ns__receiveFileStruct; 21 16 22 int ns__junks(char * a, ns__myStruct &result); 23 int ns__sendFileBase64(char * fileName, char * data, unsigned int encodedLength, unsigned int decodedLength, ns__myStruct &result); 17 int ns__sendFileBase64(char * fileName, char * data, unsigned int encodedLength, unsigned int decodedLength, int &result); 24 18 int ns__receiveFileBase64(char * fileName, ns__receiveFileStruct &result); 25 19 int ns__sendMIME(int magicNumber, int &result); 26 27 int ns__add(int a, int b, int &result); 20 int ns__openDocument(char * fileName, int &result); 28 21 int ns__ping(char * a, char ** result); 29 22 int ns__visit(char * a, char ** result); 30 int ns__sub(double a, double b, double &result);capture-mod/trunk/soapC.cpp
r1760 r1762 8 8 #include "soapH.h" 9 9 10 SOAP_SOURCE_STAMP("@(#) soapC.cpp ver 2.7.10 2008-08-2 0 08:51:52GMT")10 SOAP_SOURCE_STAMP("@(#) soapC.cpp ver 2.7.10 2008-08-21 03:00:07 GMT") 11 11 12 12 … … 160 160 case SOAP_TYPE_int: 161 161 return soap_in_int(soap, NULL, NULL, "xsd:int"); 162 case SOAP_TYPE_double:163 return soap_in_double(soap, NULL, NULL, "xsd:double");164 162 case SOAP_TYPE_unsignedInt: 165 163 return soap_in_unsignedInt(soap, NULL, NULL, "xsd:unsignedInt"); 166 case SOAP_TYPE_ns__sub:167 return soap_in_ns__sub(soap, NULL, NULL, "ns:sub");168 case SOAP_TYPE_ns__subResponse:169 return soap_in_ns__subResponse(soap, NULL, NULL, "ns:subResponse");170 164 case SOAP_TYPE_ns__visit: 171 165 return soap_in_ns__visit(soap, NULL, NULL, "ns:visit"); … … 176 170 case SOAP_TYPE_ns__pingResponse: 177 171 return soap_in_ns__pingResponse(soap, NULL, NULL, "ns:pingResponse"); 178 case SOAP_TYPE_ns__ add:179 return soap_in_ns__ add(soap, NULL, NULL, "ns:add");180 case SOAP_TYPE_ns__ addResponse:181 return soap_in_ns__ addResponse(soap, NULL, NULL, "ns:addResponse");172 case SOAP_TYPE_ns__openDocument: 173 return soap_in_ns__openDocument(soap, NULL, NULL, "ns:openDocument"); 174 case SOAP_TYPE_ns__openDocumentResponse: 175 return soap_in_ns__openDocumentResponse(soap, NULL, NULL, "ns:openDocumentResponse"); 182 176 case SOAP_TYPE_ns__sendMIME: 183 177 return soap_in_ns__sendMIME(soap, NULL, NULL, "ns:sendMIME"); … … 188 182 case SOAP_TYPE_ns__sendFileBase64: 189 183 return soap_in_ns__sendFileBase64(soap, NULL, NULL, "ns:sendFileBase64"); 190 case SOAP_TYPE_ns__ junks:191 return soap_in_ns__ junks(soap, NULL, NULL, "ns:junks");184 case SOAP_TYPE_ns__sendFileBase64Response: 185 return soap_in_ns__sendFileBase64Response(soap, NULL, NULL, "ns:sendFileBase64Response"); 192 186 case SOAP_TYPE_ns__receiveFileStruct: 193 187 return soap_in_ns__receiveFileStruct(soap, NULL, NULL, "ns:receiveFileStruct"); 194 188 case SOAP_TYPE_rcvS: 195 189 return soap_in_rcvS(soap, NULL, NULL, "rcvS"); 196 case SOAP_TYPE_ns__myStruct:197 return soap_in_ns__myStruct(soap, NULL, NULL, "ns:myStruct");198 case SOAP_TYPE_s:199 return soap_in_s(soap, NULL, NULL, "s");200 190 case SOAP_TYPE_PointerTostring: 201 191 return soap_in_PointerTostring(soap, NULL, NULL, "xsd:string"); … … 217 207 return soap_in_int(soap, NULL, NULL, NULL); 218 208 } 219 if (!soap_match_tag(soap, t, "xsd:double"))220 { *type = SOAP_TYPE_double;221 return soap_in_double(soap, NULL, NULL, NULL);222 }223 209 if (!soap_match_tag(soap, t, "xsd:unsignedInt")) 224 210 { *type = SOAP_TYPE_unsignedInt; 225 211 return soap_in_unsignedInt(soap, NULL, NULL, NULL); 226 212 } 227 if (!soap_match_tag(soap, t, "ns:sub"))228 { *type = SOAP_TYPE_ns__sub;229 return soap_in_ns__sub(soap, NULL, NULL, NULL);230 }231 if (!soap_match_tag(soap, t, "ns:subResponse"))232 { *type = SOAP_TYPE_ns__subResponse;233 return soap_in_ns__subResponse(soap, NULL, NULL, NULL);234 }235 213 if (!soap_match_tag(soap, t, "ns:visit")) 236 214 { *type = SOAP_TYPE_ns__visit; … … 249 227 return soap_in_ns__pingResponse(soap, NULL, NULL, NULL); 250 228 } 251 if (!soap_match_tag(soap, t, "ns: add"))252 { *type = SOAP_TYPE_ns__ add;253 return soap_in_ns__ add(soap, NULL, NULL, NULL);254 } 255 if (!soap_match_tag(soap, t, "ns: addResponse"))256 { *type = SOAP_TYPE_ns__ addResponse;257 return soap_in_ns__ addResponse(soap, NULL, NULL, NULL);229 if (!soap_match_tag(soap, t, "ns:openDocument")) 230 { *type = SOAP_TYPE_ns__openDocument; 231 return soap_in_ns__openDocument(soap, NULL, NULL, NULL); 232 } 233 if (!soap_match_tag(soap, t, "ns:openDocumentResponse")) 234 { *type = SOAP_TYPE_ns__openDocumentResponse; 235 return soap_in_ns__openDocumentResponse(soap, NULL, NULL, NULL); 258 236 } 259 237 if (!soap_match_tag(soap, t, "ns:sendMIME")) … … 273 251 return soap_in_ns__sendFileBase64(soap, NULL, NULL, NULL); 274 252 } 275 if (!soap_match_tag(soap, t, "ns: junks"))276 { *type = SOAP_TYPE_ns__ junks;277 return soap_in_ns__ junks(soap, NULL, NULL, NULL);253 if (!soap_match_tag(soap, t, "ns:sendFileBase64Response")) 254 { *type = SOAP_TYPE_ns__sendFileBase64Response; 255 return soap_in_ns__sendFileBase64Response(soap, NULL, NULL, NULL); 278 256 } 279 257 if (!soap_match_tag(soap, t, "ns:receiveFileStruct")) … … 284 262 { *type = SOAP_TYPE_rcvS; 285 263 return soap_in_rcvS(soap, NULL, NULL, NULL); 286 }287 if (!soap_match_tag(soap, t, "ns:myStruct"))288 { *type = SOAP_TYPE_ns__myStruct;289 return soap_in_ns__myStruct(soap, NULL, NULL, NULL);290 }291 if (!soap_match_tag(soap, t, "s"))292 { *type = SOAP_TYPE_s;293 return soap_in_s(soap, NULL, NULL, NULL);294 264 } 295 265 if (!soap_match_tag(soap, t, "xsd:string")) … … 375 345 case SOAP_TYPE_int: 376 346 return soap_out_int(soap, tag, id, (const int *)ptr, "xsd:int"); 377 case SOAP_TYPE_double:378 return soap_out_double(soap, tag, id, (const double *)ptr, "xsd:double");379 347 case SOAP_TYPE_unsignedInt: 380 348 return soap_out_unsignedInt(soap, tag, id, (const unsigned int *)ptr, "xsd:unsignedInt"); 381 case SOAP_TYPE_ns__sub:382 return soap_out_ns__sub(soap, tag, id, (const struct ns__sub *)ptr, "ns:sub");383 case SOAP_TYPE_ns__subResponse:384 return soap_out_ns__subResponse(soap, tag, id, (const struct ns__subResponse *)ptr, "ns:subResponse");385 349 case SOAP_TYPE_ns__visit: 386 350 return soap_out_ns__visit(soap, tag, id, (const struct ns__visit *)ptr, "ns:visit"); … … 391 355 case SOAP_TYPE_ns__pingResponse: 392 356 return soap_out_ns__pingResponse(soap, tag, id, (const struct ns__pingResponse *)ptr, "ns:pingResponse"); 393 case SOAP_TYPE_ns__ add:394 return soap_out_ns__ add(soap, tag, id, (const struct ns__add *)ptr, "ns:add");395 case SOAP_TYPE_ns__ addResponse:396 return soap_out_ns__ addResponse(soap, tag, id, (const struct ns__addResponse *)ptr, "ns:addResponse");357 case SOAP_TYPE_ns__openDocument: 358 return soap_out_ns__openDocument(soap, tag, id, (const struct ns__openDocument *)ptr, "ns:openDocument"); 359 case SOAP_TYPE_ns__openDocumentResponse: 360 return soap_out_ns__openDocumentResponse(soap, tag, id, (const struct ns__openDocumentResponse *)ptr, "ns:openDocumentResponse"); 397 361 case SOAP_TYPE_ns__sendMIME: 398 362 return soap_out_ns__sendMIME(soap, tag, id, (const struct ns__sendMIME *)ptr, "ns:sendMIME"); … … 403 367 case SOAP_TYPE_ns__sendFileBase64: 404 368 return soap_out_ns__sendFileBase64(soap, tag, id, (const struct ns__sendFileBase64 *)ptr, "ns:sendFileBase64"); 405 case SOAP_TYPE_ns__ junks:406 return soap_out_ns__ junks(soap, tag, id, (const struct ns__junks *)ptr, "ns:junks");369 case SOAP_TYPE_ns__sendFileBase64Response: 370 return soap_out_ns__sendFileBase64Response(soap, tag, id, (const struct ns__sendFileBase64Response *)ptr, "ns:sendFileBase64Response"); 407 371 case SOAP_TYPE_ns__receiveFileStruct: 408 372 return soap_out_ns__receiveFileStruct(soap, tag, id, (const struct rcvS *)ptr, "ns:receiveFileStruct"); 409 373 case SOAP_TYPE_rcvS: 410 374 return soap_out_rcvS(soap, tag, id, (const struct rcvS *)ptr, "rcvS"); 411 case SOAP_TYPE_ns__myStruct:412 return soap_out_ns__myStruct(soap, tag, id, (const struct s *)ptr, "ns:myStruct");413 case SOAP_TYPE_s:414 return soap_out_s(soap, tag, id, (const struct s *)ptr, "s");415 375 case SOAP_TYPE_PointerTostring: 416 376 return soap_out_PointerTostring(soap, tag, id, (char **const*)ptr, "xsd:string"); … … 438 398 switch (type) 439 399 { 440 case SOAP_TYPE_ns__sub:441 soap_serialize_ns__sub(soap, (const struct ns__sub *)ptr);442 break;443 case SOAP_TYPE_ns__subResponse:444 soap_serialize_ns__subResponse(soap, (const struct ns__subResponse *)ptr);445 break;446 400 case SOAP_TYPE_ns__visit: 447 401 soap_serialize_ns__visit(soap, (const struct ns__visit *)ptr); … … 456 410 soap_serialize_ns__pingResponse(soap, (const struct ns__pingResponse *)ptr); 457 411 break; 458 case SOAP_TYPE_ns__ add:459 soap_serialize_ns__ add(soap, (const struct ns__add*)ptr);460 break; 461 case SOAP_TYPE_ns__ addResponse:462 soap_serialize_ns__ addResponse(soap, (const struct ns__addResponse *)ptr);412 case SOAP_TYPE_ns__openDocument: 413 soap_serialize_ns__openDocument(soap, (const struct ns__openDocument *)ptr); 414 break; 415 case SOAP_TYPE_ns__openDocumentResponse: 416 soap_serialize_ns__openDocumentResponse(soap, (const struct ns__openDocumentResponse *)ptr); 463 417 break; 464 418 case SOAP_TYPE_ns__sendMIME: … … 474 428 soap_serialize_ns__sendFileBase64(soap, (const struct ns__sendFileBase64 *)ptr); 475 429 break; 476 case SOAP_TYPE_ns__ junks:477 soap_serialize_ns__ junks(soap, (const struct ns__junks*)ptr);430 case SOAP_TYPE_ns__sendFileBase64Response: 431 soap_serialize_ns__sendFileBase64Response(soap, (const struct ns__sendFileBase64Response *)ptr); 478 432 break; 479 433 case SOAP_TYPE_ns__receiveFileStruct: … … 483 437 soap_serialize_rcvS(soap, (const struct rcvS *)ptr); 484 438 break; 485 case SOAP_TYPE_ns__myStruct:486 soap_serialize_ns__myStruct(soap, (const struct s *)ptr);487 break;488 case SOAP_TYPE_s:489 soap_serialize_s(soap, (const struct s *)ptr);490 break;491 439 case SOAP_TYPE_PointerTostring: 492 440 soap_serialize_PointerTostring(soap, (char **const*)ptr); … … 510 458 switch (t) 511 459 { 512 case SOAP_TYPE_s:513 return (void*)soap_instantiate_s(soap, -1, type, arrayType, n);514 460 case SOAP_TYPE_rcvS: 515 461 return (void*)soap_instantiate_rcvS(soap, -1, type, arrayType, n); 516 case SOAP_TYPE_ns__ junks:517 return (void*)soap_instantiate_ns__ junks(soap, -1, type, arrayType, n);462 case SOAP_TYPE_ns__sendFileBase64Response: 463 return (void*)soap_instantiate_ns__sendFileBase64Response(soap, -1, type, arrayType, n); 518 464 case SOAP_TYPE_ns__sendFileBase64: 519 465 return (void*)soap_instantiate_ns__sendFileBase64(soap, -1, type, arrayType, n); … … 524 470 case SOAP_TYPE_ns__sendMIME: 525 471 return (void*)soap_instantiate_ns__sendMIME(soap, -1, type, arrayType, n); 526 case SOAP_TYPE_ns__ addResponse:527 return (void*)soap_instantiate_ns__ addResponse(soap, -1, type, arrayType, n);528 case SOAP_TYPE_ns__ add:529 return (void*)soap_instantiate_ns__ add(soap, -1, type, arrayType, n);472 case SOAP_TYPE_ns__openDocumentResponse: 473 return (void*)soap_instantiate_ns__openDocumentResponse(soap, -1, type, arrayType, n); 474 case SOAP_TYPE_ns__openDocument: 475 return (void*)soap_instantiate_ns__openDocument(soap, -1, type, arrayType, n); 530 476 case SOAP_TYPE_ns__pingResponse: 531 477 return (void*)soap_instantiate_ns__pingResponse(soap, -1, type, arrayType, n); … … 536 482 case SOAP_TYPE_ns__visit: 537 483 return (void*)soap_instantiate_ns__visit(soap, -1, type, arrayType, n); 538 case SOAP_TYPE_ns__subResponse:539 return (void*)soap_instantiate_ns__subResponse(soap, -1, type, arrayType, n);540 case SOAP_TYPE_ns__sub:541 return (void*)soap_instantiate_ns__sub(soap, -1, type, arrayType, n);542 484 #ifndef WITH_NOGLOBAL 543 485 case SOAP_TYPE_SOAP_ENV__Header: … … 560 502 return (void*)soap_instantiate_SOAP_ENV__Fault(soap, -1, type, arrayType, n); 561 503 #endif 562 case SOAP_TYPE_ns__myStruct:563 return (void*)soap_instantiate_ns__myStruct(soap, -1, type, arrayType, n);564 504 case SOAP_TYPE_ns__receiveFileStruct: 565 505 return (void*)soap_instantiate_ns__receiveFileStruct(soap, -1, type, arrayType, n); … … 571 511 { switch (p->type) 572 512 { 573 case SOAP_TYPE_s:574 if (p->size < 0)575 delete (struct s*)p->ptr;576 else577 delete[] (struct s*)p->ptr;578 break;579 513 case SOAP_TYPE_rcvS: 580 514 if (p->size < 0) … … 583 517 delete[] (struct rcvS*)p->ptr; 584 518 break; 585 case SOAP_TYPE_ns__ junks:519 case SOAP_TYPE_ns__sendFileBase64Response: 586 520 if (p->size < 0) 587 delete (struct ns__ junks*)p->ptr;521 delete (struct ns__sendFileBase64Response*)p->ptr; 588 522 else 589 delete[] (struct ns__ junks*)p->ptr;523 delete[] (struct ns__sendFileBase64Response*)p->ptr; 590 524 break; 591 525 case SOAP_TYPE_ns__sendFileBase64: … … 613 547 delete[] (struct ns__sendMIME*)p->ptr; 614 548 break; 615 case SOAP_TYPE_ns__ addResponse:549 case SOAP_TYPE_ns__openDocumentResponse: 616 550 if (p->size < 0) 617 delete (struct ns__ addResponse*)p->ptr;551 delete (struct ns__openDocumentResponse*)p->ptr; 618 552 else 619 delete[] (struct ns__ addResponse*)p->ptr;620 break; 621 case SOAP_TYPE_ns__ add:553 delete[] (struct ns__openDocumentResponse*)p->ptr; 554 break; 555 case SOAP_TYPE_ns__openDocument: 622 556 if (p->size < 0) 623 delete (struct ns__ add*)p->ptr;557 delete (struct ns__openDocument*)p->ptr; 624 558 else 625 delete[] (struct ns__ add*)p->ptr;559 delete[] (struct ns__openDocument*)p->ptr; 626 560 break; 627 561 case SOAP_TYPE_ns__pingResponse: … … 649 583 delete[] (struct ns__visit*)p->ptr; 650 584 break; 651 case SOAP_TYPE_ns__subResponse:652 if (p->size < 0)653 delete (struct ns__subResponse*)p->ptr;654 else655 delete[] (struct ns__subResponse*)p->ptr;656 break;657 case SOAP_TYPE_ns__sub:658 if (p->size < 0)659 delete (struct ns__sub*)p->ptr;660 else661 delete[] (struct ns__sub*)p->ptr;662 break;663 585 case SOAP_TYPE_SOAP_ENV__Header: 664 586 if (p->size < 0) … … 690 612 else 691 613 delete[] (struct SOAP_ENV__Fault*)p->ptr; 692 break;693 case SOAP_TYPE_ns__myStruct:694 if (p->size < 0)695 delete (struct s*)p->ptr;696 else697 delete[] (struct s*)p->ptr;698 614 break; 699 615 case SOAP_TYPE_ns__receiveFileStruct: … … 780 696 { 781 697 return soap_inint(soap, tag, a, type, SOAP_TYPE_int); 782 }783 784 SOAP_FMAC3 void SOAP_FMAC4 soap_default_double(struct soap *soap, double *a)785 { (void)soap; /* appease -Wall -Werror */786 #ifdef SOAP_DEFAULT_double787 *a = SOAP_DEFAULT_double;788 #else789 *a = (double)0;790 #endif791 }792 793 SOAP_FMAC3 int SOAP_FMAC4 soap_put_double(struct soap *soap, const double *a, const char *tag, const char *type)794 {795 register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_double);796 if (soap_out_double(soap, tag, id, a, type))797 return soap->error;798 return soap_putindependent(soap);799 }800 801 SOAP_FMAC3 int SOAP_FMAC4 soap_out_double(struct soap *soap, const char *tag, int id, const double *a, const char *type)802 {803 return soap_outdouble(soap, tag, id, a, type, SOAP_TYPE_double);804 }805 806 SOAP_FMAC3 double * SOAP_FMAC4 soap_get_double(struct soap *soap, double *p, const char *tag, const char *type)807 {808 if ((p = soap_in_double(soap, tag, p, type)))809 if (soap_getindependent(soap))810 return NULL;811 return p;812 }813 814 SOAP_FMAC3 double * SOAP_FMAC4 soap_in_double(struct soap *soap, const char *tag, double *a, const char *type)815 {816 return soap_indouble(soap, tag, a, type, SOAP_TYPE_double);817 698 } 818 699 … … 1503 1384 #endif 1504 1385 1505 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__sub(struct soap *soap, struct ns__sub *a)1506 {1507 (void)soap; (void)a; /* appease -Wall -Werror */1508 soap_default_double(soap, &a->a);1509 soap_default_double(soap, &a->b);1510 }1511 1512 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns__sub(struct soap *soap, const struct ns__sub *a)1513 {1514 (void)soap; (void)a; /* appease -Wall -Werror */1515 }1516 1517 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns__sub(struct soap *soap, const struct ns__sub *a, const char *tag, const char *type)1518 {1519 register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_ns__sub);1520 if (soap_out_ns__sub(soap, tag, id, a, type))1521 return soap->error;1522 return soap_putindependent(soap);1523 }1524 1525 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns__sub(struct soap *soap, const char *tag, int id, const struct ns__sub *a, const char *type)1526 {1527 if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns__sub), type))1528 return soap->error;1529 if (soap_out_double(soap, "a", -1, &a->a, ""))1530 return soap->error;1531 if (soap_out_double(soap, "b", -1, &a->b, ""))1532 return soap->error;1533 return soap_element_end_out(soap, tag);1534 }1535 1536 SOAP_FMAC3 struct ns__sub * SOAP_FMAC4 soap_get_ns__sub(struct soap *soap, struct ns__sub *p, const char *tag, const char *type)1537 {1538 if ((p = soap_in_ns__sub(soap, tag, p, type)))1539 if (soap_getindependent(soap))1540 return NULL;1541 return p;1542 }1543 1544 SOAP_FMAC3 struct ns__sub * SOAP_FMAC4 soap_in_ns__sub(struct soap *soap, const char *tag, struct ns__sub *a, const char *type)1545 {1546 short soap_flag_a = 1, soap_flag_b = 1;1547 if (soap_element_begin_in(soap, tag, 0, type))1548 return NULL;1549 a = (struct ns__sub *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns__sub, sizeof(struct ns__sub), 0, NULL, NULL, NULL);1550 if (!a)1551 return NULL;1552 soap_default_ns__sub(soap, a);1553 if (soap->body && !*soap->href)1554 {1555 for (;;)1556 { soap->error = SOAP_TAG_MISMATCH;1557 if (soap_flag_a && soap->error == SOAP_TAG_MISMATCH)1558 if (soap_in_double(soap, "a", &a->a, "xsd:double"))1559 { soap_flag_a--;1560 continue;1561 }1562 if (soap_flag_b && soap->error == SOAP_TAG_MISMATCH)1563 if (soap_in_double(soap, "b", &a->b, "xsd:double"))1564 { soap_flag_b--;1565 continue;1566 }1567 if (soap->error == SOAP_TAG_MISMATCH)1568 soap->error = soap_ignore_element(soap);1569 if (soap->error == SOAP_NO_TAG)1570 break;1571 if (soap->error)1572 return NULL;1573 }1574 if (soap_element_end_in(soap, tag))1575 return NULL;1576 }1577 else1578 { a = (struct ns__sub *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns__sub, 0, sizeof(struct ns__sub), 0, NULL);1579 if (soap->body && soap_element_end_in(soap, tag))1580 return NULL;1581 }1582 if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_a > 0 || soap_flag_b > 0))1583 { soap->error = SOAP_OCCURS;1584 return NULL;1585 }1586 return a;1587 }1588 1589 SOAP_FMAC5 struct ns__sub * SOAP_FMAC6 soap_new_ns__sub(struct soap *soap, int n)1590 { return soap_instantiate_ns__sub(soap, n, NULL, NULL, NULL);1591 }1592 1593 SOAP_FMAC5 void SOAP_FMAC6 soap_delete_ns__sub(struct soap *soap, struct ns__sub *p)1594 { soap_delete(soap, p);1595 }1596 1597 SOAP_FMAC3 struct ns__sub * SOAP_FMAC4 soap_instantiate_ns__sub(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size)1598 {1599 DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_ns__sub(%d, %s, %s)\n", n, type?type:"", arrayType?arrayType:""));1600 struct soap_clist *cp = soap_link(soap, NULL, SOAP_TYPE_ns__sub, n, soap_fdelete);1601 if (!cp)1602 return NULL;1603 if (n < 0)1604 { cp->ptr = (void*)new struct ns__sub;1605 if (size)1606 *size = sizeof(struct ns__sub);1607 }1608 else1609 { cp->ptr = (void*)new struct ns__sub[n];1610 if (!cp->ptr)1611 { soap->error = SOAP_EOM;1612 return NULL;1613 }1614 if (size)1615 *size = n * sizeof(struct ns__sub);1616 }1617 DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated location=%p\n", cp->ptr));1618 return (struct ns__sub*)cp->ptr;1619 }1620 SOAP_FMAC3 void SOAP_FMAC4 soap_copy_ns__sub(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)1621 {1622 DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct ns__sub %p -> %p\n", q, p));1623 *(struct ns__sub*)p = *(struct ns__sub*)q;1624 }1625 1626 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__subResponse(struct soap *soap, struct ns__subResponse *a)1627 {1628 (void)soap; (void)a; /* appease -Wall -Werror */1629 soap_default_double(soap, &a->result);1630 }1631 1632 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns__subResponse(struct soap *soap, const struct ns__subResponse *a)1633 {1634 (void)soap; (void)a; /* appease -Wall -Werror */1635 }1636 1637 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns__subResponse(struct soap *soap, const struct ns__subResponse *a, const char *tag, const char *type)1638 {1639 register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_ns__subResponse);1640 if (soap_out_ns__subResponse(soap, tag, id, a, type))1641 return soap->error;1642 return soap_putindependent(soap);1643 }1644 1645 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns__subResponse(struct soap *soap, const char *tag, int id, const struct ns__subResponse *a, const char *type)1646 {1647 if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns__subResponse), type))1648 return soap->error;1649 if (soap_out_double(soap, "result", -1, &a->result, ""))1650 return soap->error;1651 return soap_element_end_out(soap, tag);1652 }1653 1654 SOAP_FMAC3 struct ns__subResponse * SOAP_FMAC4 soap_get_ns__subResponse(struct soap *soap, struct ns__subResponse *p, const char *tag, const char *type)1655 {1656 if ((p = soap_in_ns__subResponse(soap, tag, p, type)))1657 if (soap_getindependent(soap))1658 return NULL;1659 return p;1660 }1661 1662 SOAP_FMAC3 struct ns__subResponse * SOAP_FMAC4 soap_in_ns__subResponse(struct soap *soap, const char *tag, struct ns__subResponse *a, const char *type)1663 {1664 short soap_flag_result = 1;1665 if (soap_element_begin_in(soap, tag, 0, type))1666 return NULL;1667 a = (struct ns__subResponse *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns__subResponse, sizeof(struct ns__subResponse), 0, NULL, NULL, NULL);1668 if (!a)1669 return NULL;1670 soap_default_ns__subResponse(soap, a);1671 if (soap->body && !*soap->href)1672 {1673 for (;;)1674 { soap->error = SOAP_TAG_MISMATCH;1675 if (soap_flag_result && soap->error == SOAP_TAG_MISMATCH)1676 if (soap_in_double(soap, "result", &a->result, "xsd:double"))1677 { soap_flag_result--;1678 continue;1679 }1680 if (soap->error == SOAP_TAG_MISMATCH)1681 soap->error = soap_ignore_element(soap);1682 if (soap->error == SOAP_NO_TAG)1683 break;1684 if (soap->error)1685 return NULL;1686 }1687 if (soap_element_end_in(soap, tag))1688 return NULL;1689 }1690 else1691 { a = (struct ns__subResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns__subResponse, 0, sizeof(struct ns__subResponse), 0, NULL);1692 if (soap->body && soap_element_end_in(soap, tag))1693 return NULL;1694 }1695 if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_result > 0))1696 { soap->error = SOAP_OCCURS;1697 return NULL;1698 }1699 return a;1700 }1701 1702 SOAP_FMAC5 struct ns__subResponse * SOAP_FMAC6 soap_new_ns__subResponse(struct soap *soap, int n)1703 { return soap_instantiate_ns__subResponse(soap, n, NULL, NULL, NULL);1704 }1705 1706 SOAP_FMAC5 void SOAP_FMAC6 soap_delete_ns__subResponse(struct soap *soap, struct ns__subResponse *p)1707 { soap_delete(soap, p);1708 }1709 1710 SOAP_FMAC3 struct ns__subResponse * SOAP_FMAC4 soap_instantiate_ns__subResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size)1711 {1712 DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_ns__subResponse(%d, %s, %s)\n", n, type?type:"", arrayType?arrayType:""));1713 struct soap_clist *cp = soap_link(soap, NULL, SOAP_TYPE_ns__subResponse, n, soap_fdelete);1714 if (!cp)1715 return NULL;1716 if (n < 0)1717 { cp->ptr = (void*)new struct ns__subResponse;1718 if (size)1719 *size = sizeof(struct ns__subResponse);1720 }1721 else1722 { cp->ptr = (void*)new struct ns__subResponse[n];1723 if (!cp->ptr)1724 { soap->error = SOAP_EOM;1725 return NULL;1726 }1727 if (size)1728 *size = n * sizeof(struct ns__subResponse);1729 }1730 DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated location=%p\n", cp->ptr));1731 return (struct ns__subResponse*)cp->ptr;1732 }1733 SOAP_FMAC3 void SOAP_FMAC4 soap_copy_ns__subResponse(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)1734 {1735 DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct ns__subResponse %p -> %p\n", q, p));1736 *(struct ns__subResponse*)p = *(struct ns__subResponse*)q;1737 }1738 1739 1386 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__visit(struct soap *soap, struct ns__visit *a) 1740 1387 { … … 2177 1824 } 2178 1825 2179 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__ add(struct soap *soap, struct ns__add*a)2180 { 2181 (void)soap; (void)a; /* appease -Wall -Werror */ 2182 soap_default_ int(soap, &a->a);2183 soap_default_int(soap, &a->b); 2184 } 2185 2186 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns__add(struct soap *soap, const struct ns__add *a) 2187 { 2188 (void)soap; (void)a; /* appease -Wall -Werror */2189 } 2190 2191 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns__ add(struct soap *soap, const struct ns__add*a, const char *tag, const char *type)2192 { 2193 register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_ns__ add);2194 if (soap_out_ns__ add(soap, tag, id, a, type))1826 SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns__openDocument(struct soap *soap, struct ns__openDocument *a) 1827 { 1828 (void)soap; (void)a; /* appease -Wall -Werror */ 1829 soap_default_string(soap, &a->fileName); 1830 } 1831 1832 SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns__openDocument(struct soap *soap, const struct ns__openDocument *a) 1833 { 1834 (void)soap; (void)a; /* appease -Wall -Werror */ 1835 soap_serialize_string(soap, &a->fileName); 1836 } 1837 1838 SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns__openDocument(struct soap *soap, const struct ns__openDocument *a, const char *tag, const char *type) 1839 { 1840 register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_ns__openDocument); 1841 if (soap_out_ns__openDocument(soap, tag, id, a, type)) 2195 1842 return soap->error; 2196 1843 return soap_putindependent(soap); 2197 1844 } 2198 1845 2199 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns__add(struct soap *soap, const char *tag, int id, const struct ns__add *a, const char *type) 2200 { 2201 if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns__add), type)) 2202 return soap->error; 2203 if (soap_out_int(soap, "a", -1, &a->a, "")) 2204 return soap->error; 2205 if (soap_out_int(soap, "b", -1, &a->b, "")) 1846 SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns__openDocument(struct soap *soap, const char *tag, int id, const struct ns__openDocument *a, const char *type) 1847 { 1848 if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns__openDocument), type)) 1849 return soap->error; 1850 if (soap_out_string(soap, "fileName", -1, &a->fileName, "")) 2206 1851 return soap->error; 2207 1852 return soap_element_end_out(soap, tag); 2208 1853 } 2209 1854 2210 SOAP_FMAC3 struct ns__ add * SOAP_FMAC4 soap_get_ns__add(struct soap *soap, struct ns__add*p, const char *tag, const char *type)2211 { 2212 if ((p = soap_in_ns__ add(soap, tag, p, type)))1855 SOAP_FMAC3 struct ns__openDocument * SOAP_FMAC4 soap_get_ns__openDocument(struct soap *soap, struct ns__openDocument *p, const char *tag, const char *type) 1856 { 1857 if ((p = soap_in_ns__openDocument(soap, tag, p, type))) 2213 1858 if (soap_getindependent(soap)) 2214 1859 return NULL; … … 2216 1861 } 2217 1862 2218 SOAP_FMAC3 struct ns__ add * SOAP_FMAC4 soap_in_ns__add(struct soap *soap, const char *tag, struct ns__add*a, const char *type)2219 { 2220 short soap_flag_ a = 1, soap_flag_b= 1;1863 SOAP_FMAC3 struct ns__openDocument * SOAP_FMAC4 soap_in_
