00001
00016 #include "OSSolverAgent.h"
00017 #include "OSWSUtil.h"
00018 #include "CoinTime.hpp"
00019 #include "OSParameters.h"
00020 #include "OSOutput.h"
00021
00022 #include <cstdlib>
00023
00024 #ifdef HAVE_CTIME
00025 # include <ctime>
00026 #else
00027 # ifdef HAVE_TIME_H
00028 # include <time.h>
00029 # else
00030 # error "don't have header file for time"
00031 # endif
00032 #endif
00033
00034 #include <stdio.h>
00035 #include <sstream>
00036
00037 using std::string;
00038 using std::ostringstream;
00039 using std::endl;
00040
00041 extern const OSSmartPtr<OSOutput> osoutput;
00042
00043 OSSolverAgent::OSSolverAgent(string solverURI) : OShL()
00044 {
00045 string::size_type nstart = 0;
00046 string::size_type posSlash;
00047
00048
00049 if (solverURI.find("http://") != string::npos) solverURI = solverURI.substr(7);
00050
00051 posSlash = solverURI.find("/", nstart);
00052 if(posSlash != std::string::npos) nstart = posSlash;
00053 postURI = solverURI.substr(nstart, solverURI.size() - 1);
00054
00055 string::size_type colonlocation = solverURI.find(":");
00056 if(colonlocation == string::npos)
00057 {
00058 solverAddress = solverURI.substr(0, nstart);
00059 solverPortNumber = 80;
00060 }
00061 else
00062 {
00063 solverPortNumber = (unsigned short) atoi( &solverURI.substr(colonlocation + 1, nstart - colonlocation - 1)[0] ) ;
00064 solverAddress = solverURI.substr(0, colonlocation);
00065 }
00066 }
00067
00068 OSSolverAgent::~OSSolverAgent()
00069 {
00070 }
00071
00072 string OSSolverAgent::solve(string osil, string osol)
00073 {
00074 string sOSrL;
00075 string theSOAP;
00076 string solveResult;
00077
00078 #ifndef NDEBUG
00079 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Inside SolverAgent solve() method \n");
00080
00081 std::ostringstream outStr;
00082 outStr.str("");
00083 outStr.clear();
00084
00085 outStr << "Sending to the remote system:" << std::endl << std::endl;
00086 outStr << "OSiL string:" << std::endl << std::endl;
00087 outStr << osil << std::endl << std::endl;
00088 outStr << "OSoL string:" << std::endl << std::endl;
00089 outStr << osol << std::endl << std::endl;
00090
00091 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_debug, outStr.str());
00092 #endif
00093
00094 bool useCDATA = true;
00095
00096 int numInputs = 2;
00097 string smethod = "solve";
00098 string msInputs[2];
00099
00100
00101
00102 #ifndef NDEBUG
00103 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "SOAPify OSiL \n");
00104 #endif
00105 msInputs[0] = WSUtil::SOAPify( osil, useCDATA) ;
00106
00107 #ifndef NDEBUG
00108 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, msInputs[0]);
00109 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "SOAPify OSoL \n");
00110 #endif
00111 msInputs[1] = WSUtil::SOAPify( osol, useCDATA) ;
00112 #ifndef NDEBUG
00113 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, msInputs[1]);
00114 #endif
00115 string msInputNames[2] = {"osil", "osol"};
00116 string sSoapAction = "OSSolverService#solve";
00117
00118 double cpuTime;
00119 double startTime = 0;
00120 startTime = CoinCpuTime();
00121 theSOAP = WSUtil::createSOAPMessage(numInputs, solverAddress, postURI,
00122 smethod, msInputs, msInputNames, sSoapAction);
00123
00124 cpuTime = CoinCpuTime() - startTime;
00125 startTime = CoinWallclockTime();
00126 #ifndef NDEBUG
00127 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "SEND THE SOAP\n");
00128 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, theSOAP);
00129 #endif
00130 solveResult = WSUtil::sendSOAPMessage( theSOAP, solverAddress, solverPortNumber);
00131 #ifndef NDEBUG
00132 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Response received\n");
00133 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, solveResult);
00134 #endif
00135 cpuTime = CoinWallclockTime() - startTime;
00136
00137
00138
00139 solveResult = WSUtil::getOSxL(solveResult, "solve");
00140 #ifndef NDEBUG
00141 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Result received\n");
00142 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, solveResult);
00143 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "DeSOAPify result\n");
00144 #endif
00145
00146 useCDATA = false;
00147 sOSrL = WSUtil::deSOAPify( solveResult, useCDATA);
00148 #ifndef NDEBUG
00149 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, sOSrL);
00150 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "RETURN THE OSRL\n");
00151 #endif
00152
00153 return sOSrL;
00154 }
00155
00156 string OSSolverAgent::fileUpload( string osilFileName, string theOSiLFile)
00157 {
00158 string theHTTPPOST="";
00159 string uploadResult="";
00160 string boundaryName = "AaB03x";
00161 theHTTPPOST = WSUtil::createFormDataUpload(solverAddress, postURI,
00162 osilFileName, theOSiLFile, boundaryName);
00163
00164
00165 #ifndef NDEBUG
00166 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Upload file in SolverAgent\n");
00167 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, theHTTPPOST);
00168 #endif
00169 uploadResult = WSUtil::sendSOAPMessage( theHTTPPOST, solverAddress, solverPortNumber);
00170 return uploadResult;
00171 }
00172
00173
00174 bool OSSolverAgent::send(string osil, string osol)
00175 {
00176 string theSOAP;
00177 string sendResult;
00178 bool useCDATA = true;
00179
00180 #ifndef NDEBUG
00181 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Inside SolverAgent send() method \n");
00182
00183 std::ostringstream outStr;
00184 outStr.str("");
00185 outStr.clear();
00186
00187 outStr << "Sending to the remote system:" << std::endl << std::endl;
00188 outStr << "OSiL string:" << std::endl << std::endl;
00189 outStr << osil << std::endl << std::endl;
00190 outStr << "OSoL string:" << std::endl << std::endl;
00191 outStr << osol << std::endl << std::endl;
00192
00193 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_debug, outStr.str());
00194 #endif
00195
00196
00197 int numInputs = 2;
00198 string smethod = "send";
00199 string msInputs[2];
00200
00201
00202 #ifndef NDEBUG
00203 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "SOAPIFY OSIL\n");
00204 #endif
00205 msInputs[0] = WSUtil::SOAPify( osil, useCDATA);
00206 #ifndef NDEBUG
00207
00208 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, msInputs[0]);
00209 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "SOAPIFY OSOL\n");
00210 #endif
00211 msInputs[1] = WSUtil::SOAPify( osol, useCDATA) ;
00212 #ifndef NDEBUG
00213 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, msInputs[1]);
00214 #endif
00215
00216 string msInputNames[2] = {"osil", "osol"};
00217 string sSoapAction = "OSSolverService#send";
00218
00219 theSOAP = WSUtil::createSOAPMessage(numInputs, solverAddress, postURI,
00220 smethod, msInputs, msInputNames, sSoapAction);
00221 #ifndef NDEBUG
00222 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Send the SOAP\n");
00223 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, theSOAP);
00224 #endif
00225
00226
00227 sendResult = WSUtil::sendSOAPMessage( theSOAP, solverAddress, solverPortNumber);
00228 #ifndef NDEBUG
00229 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Message returned\n");
00230 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, sendResult);
00231 #endif
00232
00233
00234 #ifndef NDEBUG
00235 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, "Strip out OSxL string\n");
00236 #endif
00237 sendResult = WSUtil::getOSxL(sendResult, "send");
00238 #ifndef NDEBUG
00239 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, sendResult);
00240 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "DeSOAPify\n");
00241 #endif
00242
00243 useCDATA = false;
00244 sendResult = WSUtil::deSOAPify( sendResult, useCDATA);
00245 #ifndef NDEBUG
00246 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, sendResult);
00247 #endif
00248 if( sendResult.find("true") != string::npos ) return true;
00249 else return false;
00250 }
00251
00252 string OSSolverAgent::getJobID(string osol)
00253 {
00254 string sjobID = "";
00255 string getJobIDResult;
00256 string theSOAP;
00257 bool useCDATA = true;
00258
00259 #ifndef NDEBUG
00260 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Inside SolverAgent getJobID() method \n");
00261
00262 std::ostringstream outStr;
00263 outStr.str("");
00264 outStr.clear();
00265
00266 outStr << "Sending to the remote system:" << std::endl << std::endl;
00267 outStr << "OSoL string:" << std::endl << std::endl;
00268 outStr << osol << std::endl << std::endl;
00269
00270 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_debug, outStr.str());
00271 #endif
00272
00273
00274 int numInputs = 1;
00275 string smethod = "getJobID";
00276 string msInputs[1];
00277
00278
00279
00280 #ifndef NDEBUG
00281 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "SOAPIFY OSOL\n");
00282 #endif
00283 msInputs[0] = WSUtil::SOAPify( osol, useCDATA) ;
00284 #ifndef NDEBUG
00285 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, msInputs[0]);
00286 #endif
00287 string msInputNames[1] = {"osol"};
00288 string sSoapAction = "OSSolverService#getJobID";
00289
00290 theSOAP = WSUtil::createSOAPMessage(numInputs, solverAddress, postURI,
00291 smethod, msInputs, msInputNames, sSoapAction);
00292 #ifndef NDEBUG
00293 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Send the SOAP\n");
00294 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, theSOAP);
00295 #endif
00296
00297 getJobIDResult = WSUtil::sendSOAPMessage( theSOAP, solverAddress, solverPortNumber);
00298 #ifndef NDEBUG
00299 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Message returned\n");
00300 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, getJobIDResult);
00301 #endif
00302
00303 getJobIDResult = WSUtil::getOSxL(getJobIDResult, "getJobID");
00304 #ifndef NDEBUG
00305 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, "Strip out job ID\n");
00306 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, getJobIDResult);
00307 #endif
00308
00309 useCDATA = false;
00310 sjobID = WSUtil::deSOAPify( getJobIDResult, useCDATA);
00311 #ifndef NDEBUG
00312 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "DeSOAPify\n");
00313 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, sjobID);
00314 #endif
00315
00316 return sjobID;
00317 }
00318
00319
00320 string OSSolverAgent::retrieve(string osol)
00321 {
00322 string sOSrL;
00323 string retrieveResult;
00324 string theSOAP;
00325 bool useCDATA = true;
00326
00327 #ifndef NDEBUG
00328 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Inside SolverAgent retrieve() method \n");
00329
00330 std::ostringstream outStr;
00331 outStr.str("");
00332 outStr.clear();
00333
00334 outStr << "Sending to the remote system:" << std::endl << std::endl;
00335 outStr << "OSoL string:" << std::endl << std::endl;
00336 outStr << osol << std::endl << std::endl;
00337
00338 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_debug, outStr.str());
00339 #endif
00340
00341
00342 int numInputs = 1;
00343 string smethod = "retrieve";
00344 string msInputs[1];
00345
00346
00347 #ifndef NDEBUG
00348 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "SOAPIFY OSoL\n");
00349 #endif
00350 msInputs[0] = WSUtil::SOAPify( osol, useCDATA) ;
00351 #ifndef NDEBUG
00352 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, msInputs[0]);
00353 #endif
00354 string msInputNames[1] = {"osol"};
00355 string sSoapAction = "OSSolverService#retrieve";
00356
00357 theSOAP = WSUtil::createSOAPMessage(numInputs, solverAddress, postURI,
00358 smethod, msInputs, msInputNames, sSoapAction);
00359 #ifndef NDEBUG
00360 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Send the SOAP\n");
00361 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, theSOAP);
00362 #endif
00363
00364
00365 retrieveResult = WSUtil::sendSOAPMessage( theSOAP, solverAddress, solverPortNumber);
00366 #ifndef NDEBUG
00367 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Message returned\n");
00368 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, retrieveResult);
00369 #endif
00370
00371
00372 #ifndef NDEBUG
00373 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, "Strip out OSxL string\n");
00374 #endif
00375 retrieveResult = WSUtil::getOSxL(retrieveResult, "retrieve");
00376
00377
00378 #ifndef NDEBUG
00379 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, retrieveResult);
00380 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "DeSOAPify\n");
00381 #endif
00382 useCDATA = false;
00383 sOSrL = WSUtil::deSOAPify( retrieveResult, useCDATA);
00384 #ifndef NDEBUG
00385 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, sOSrL);
00386 #endif
00387
00388 return sOSrL;
00389 }
00390
00391
00392 string OSSolverAgent::kill(string osol)
00393 {
00394 string sOSpL;
00395 string killResult;
00396 string theSOAP;
00397 bool useCDATA = true;
00398
00399 #ifndef NDEBUG
00400 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Inside SolverAgent kill() method \n");
00401
00402 std::ostringstream outStr;
00403 outStr.str("");
00404 outStr.clear();
00405
00406 outStr << "Sending to the remote system:" << std::endl << std::endl;
00407 outStr << "OSoL string:" << std::endl << std::endl;
00408 outStr << osol << std::endl << std::endl;
00409
00410 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_debug, outStr.str());
00411 #endif
00412
00413
00414 int numInputs = 1;
00415 string smethod = "kill";
00416 string msInputs[1];
00417
00418
00419 #ifndef NDEBUG
00420 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "SOAPify OSoL \n");
00421 #endif
00422 msInputs[0] = WSUtil::SOAPify( osol, useCDATA) ;
00423 #ifndef NDEBUG
00424 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, msInputs[0]);
00425 #endif
00426 string msInputNames[1] = {"osol"};
00427 string sSoapAction = "OSSolverService#kill";
00428
00429 theSOAP = WSUtil::createSOAPMessage(numInputs, solverAddress, postURI,
00430 smethod, msInputs, msInputNames, sSoapAction);
00431
00432 #ifndef NDEBUG
00433 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "SEND THE SOAP\n");
00434 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, theSOAP);
00435 #endif
00436 killResult = WSUtil::sendSOAPMessage( theSOAP, solverAddress, solverPortNumber);
00437 #ifndef NDEBUG
00438 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Response received\n");
00439 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, killResult);
00440 #endif
00441
00442 killResult = WSUtil::getOSxL( killResult, "kill");
00443
00444
00445 useCDATA = false;
00446 #ifndef NDEBUG
00447 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "DeSOAPify result\n");
00448 #endif
00449 sOSpL = WSUtil::deSOAPify( killResult, useCDATA);
00450 #ifndef NDEBUG
00451 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, sOSpL);
00452 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "RETURN THE OSpL\n");
00453 #endif
00454
00455 return sOSpL;
00456 }
00457
00458 string OSSolverAgent::knock(string ospl, string osol)
00459 {
00460 string sOSpL;
00461 string theSOAP;
00462 string knockResult;
00463 bool useCDATA = true;
00464 #ifndef NDEBUG
00465 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Inside SolverAgent knock() method \n");
00466
00467 std::ostringstream outStr;
00468 outStr.str("");
00469 outStr.clear();
00470
00471 outStr << "Sending to the remote system:" << std::endl << std::endl;
00472 outStr << "OSpL string:" << std::endl << std::endl;
00473 outStr << ospl << std::endl << std::endl;
00474 outStr << "OSoL string:" << std::endl << std::endl;
00475 outStr << osol << std::endl << std::endl;
00476
00477 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_debug, outStr.str());
00478 #endif
00479
00480
00481 int numInputs = 2;
00482 string smethod = "knock";
00483 string msInputs[2];
00484
00485
00486 #ifndef NDEBUG
00487 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "SOAPify OSpL \n");
00488 #endif
00489 msInputs[0] = WSUtil::SOAPify( ospl, useCDATA) ;
00490 #ifndef NDEBUG
00491 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, msInputs[0]);
00492 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "SOAPify OSoL \n");
00493 #endif
00494 msInputs[1] = WSUtil::SOAPify( osol, useCDATA) ;
00495 #ifndef NDEBUG
00496 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, msInputs[1]);
00497 #endif
00498
00499 string msInputNames[2] = {"ospl", "osol"};
00500 string sSoapAction = "OSSolverService#knock";
00501
00502 theSOAP = WSUtil::createSOAPMessage(numInputs, solverAddress, postURI,
00503 smethod, msInputs, msInputNames, sSoapAction);
00504
00505 #ifndef NDEBUG
00506 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "SEND THE SOAP\n");
00507 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, theSOAP);
00508 #endif
00509 knockResult = WSUtil::sendSOAPMessage( theSOAP, solverAddress, solverPortNumber);
00510 #ifndef NDEBUG
00511 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "Response received\n");
00512 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, knockResult);
00513 #endif
00514
00515
00516 knockResult = WSUtil::getOSxL( knockResult, "knock");
00517
00518 useCDATA = false;
00519 #ifndef NDEBUG
00520 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "DeSOAPify result\n");
00521 #endif
00522 sOSpL = WSUtil::deSOAPify( knockResult, useCDATA);
00523 #ifndef NDEBUG
00524 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_detailed_trace, sOSpL);
00525 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSAgent, ENUM_OUTPUT_LEVEL_trace, "RETURN THE OSpL\n");
00526 #endif
00527
00528 return sOSpL;
00529 }