(file) Return to CIMOperationResponseDecoder.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Client

   1 martin 1.86 //%LICENSE////////////////////////////////////////////////////////////////
   2 martin 1.87 //
   3 martin 1.86 // Licensed to The Open Group (TOG) under one or more contributor license
   4             // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
   5             // this work for additional information regarding copyright ownership.
   6             // Each contributor licenses this file to you under the OpenPegasus Open
   7             // Source License; you may not use this file except in compliance with the
   8             // License.
   9 martin 1.87 //
  10 martin 1.86 // Permission is hereby granted, free of charge, to any person obtaining a
  11             // copy of this software and associated documentation files (the "Software"),
  12             // to deal in the Software without restriction, including without limitation
  13             // the rights to use, copy, modify, merge, publish, distribute, sublicense,
  14             // and/or sell copies of the Software, and to permit persons to whom the
  15             // Software is furnished to do so, subject to the following conditions:
  16 martin 1.87 //
  17 martin 1.86 // The above copyright notice and this permission notice shall be included
  18             // in all copies or substantial portions of the Software.
  19 martin 1.87 //
  20 martin 1.86 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  21 martin 1.87 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  22 martin 1.86 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  23             // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  24             // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  25             // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  26             // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  27 martin 1.87 //
  28 martin 1.86 //////////////////////////////////////////////////////////////////////////
  29 mike   1.2  //
  30             //%/////////////////////////////////////////////////////////////////////////////
  31             
  32             #include <Pegasus/Common/Config.h>
  33             #include <iostream>
  34 kumpf  1.15 #include <Pegasus/Common/Constants.h>
  35 mike   1.2  #include <Pegasus/Common/XmlParser.h>
  36             #include <Pegasus/Common/XmlReader.h>
  37             #include <Pegasus/Common/System.h>
  38             #include <Pegasus/Common/XmlWriter.h>
  39             #include <Pegasus/Common/HTTPMessage.h>
  40             #include <Pegasus/Common/CIMMessage.h>
  41 kumpf  1.60 #include <Pegasus/Common/Exception.h>
  42 mike   1.85 #include <Pegasus/Common/BinaryCodec.h>
  43 mike   1.2  #include "CIMOperationResponseDecoder.h"
  44             
  45 kumpf  1.76 #include <Pegasus/Common/MessageLoader.h>
  46 humberto 1.43 
  47 mike     1.2  PEGASUS_USING_STD;
  48               
  49               PEGASUS_NAMESPACE_BEGIN
  50               
  51               CIMOperationResponseDecoder::CIMOperationResponseDecoder(
  52                   MessageQueue* outputQueue,
  53                   MessageQueue* encoderQueue,
  54 karl     1.41     ClientAuthenticator* authenticator,
  55                   Uint32 showInput)
  56 mike     1.2      :
  57 kumpf    1.16     MessageQueue(PEGASUS_QUEUENAME_OPRESPDECODER),
  58 mike     1.2      _outputQueue(outputQueue),
  59                   _encoderQueue(encoderQueue),
  60 karl     1.41     _authenticator(authenticator),
  61                   _showInput(showInput)
  62 mike     1.2  {
  63               }
  64               
  65               CIMOperationResponseDecoder::~CIMOperationResponseDecoder()
  66               {
  67               }
  68               
  69               void  CIMOperationResponseDecoder::setEncoderQueue(MessageQueue* encoderQueue)
  70               {
  71                   _encoderQueue = encoderQueue;
  72               }
  73               
  74               void CIMOperationResponseDecoder::handleEnqueue()
  75               {
  76                   Message* message = dequeue();
  77               
  78                   if (!message)
  79 kumpf    1.60         return;
  80 mike     1.2  
  81                   switch (message->getType())
  82                   {
  83 kumpf    1.60         case HTTP_MESSAGE:
  84                       {
  85                           HTTPMessage* httpMessage = (HTTPMessage*)message;
  86                           _handleHTTPMessage(httpMessage);
  87                           break;
  88                       }
  89 mike     1.2  
  90 kumpf    1.60         default:
  91 kumpf    1.17             PEGASUS_ASSERT(0);
  92 kumpf    1.60             break;
  93 mike     1.2      }
  94               
  95                   delete message;
  96               }
  97               
  98 a.dunfey 1.73 void CIMOperationResponseDecoder::setDataStorePointer(
  99                   ClientPerfDataStore* perfDataStore_ptr)
 100               {   dataStore = perfDataStore_ptr;
 101               }
 102               
 103 mike     1.2  void CIMOperationResponseDecoder::_handleHTTPMessage(HTTPMessage* httpMessage)
 104               {
 105                   //
 106                   // Parse the HTTP message:
 107                   //
 108 w.white  1.67     TimeValue networkEndTime = TimeValue::getCurrentTime();
 109 w.white  1.64 
 110 j.alex   1.68     String  startLine;
 111 mike     1.2      Array<HTTPHeader> headers;
 112 kumpf    1.88     const char* content;
 113 j.alex   1.68     Uint32  contentLength;
 114                   Boolean cimReconnect=false;
 115 mike     1.2  
 116 kumpf    1.19     if (httpMessage->message.size() == 0)
 117 kumpf    1.60     {
 118 kumpf    1.76         MessageLoaderParms mlParms(
 119                           "Client.CIMOperationResponseDecoder.EMPTY_RESPONSE",
 120 dave.sudlik 1.80             "Connection closed by CIM Server.");
 121 kumpf       1.60         String mlString(MessageLoader::getMessage(mlParms));
 122                  
 123                          CIMClientMalformedHTTPException* malformedHTTPException =
 124                              new CIMClientMalformedHTTPException(mlString);
 125                  
 126                          ClientExceptionMessage * response =
 127                              new ClientExceptionMessage(malformedHTTPException);
 128                  
 129                          _outputQueue->enqueue(response);
 130                          return;
 131                      }
 132 kumpf       1.19 
 133 j.alex      1.68 
 134 mike        1.2      httpMessage->parse(startLine, headers, contentLength);
 135                  
 136 kumpf       1.19     //
 137 kumpf       1.76     // Check for Connection: Close
 138 j.alex      1.68     //
 139 kumpf       1.90     const char* connectClose;
 140 j.alex      1.69     if (HTTPMessage::lookupHeader(headers, "Connection", connectClose, false))
 141 j.alex      1.68     {
 142 kumpf       1.90         if (System::strcasecmp(connectClose, "Close") == 0)
 143 j.alex      1.68         {
 144                              //reconnect and then resend next request.
 145                              cimReconnect=true;
 146                          }
 147                      }
 148                      //
 149 kumpf       1.19     // Get the status line info
 150                      //
 151                      String httpVersion;
 152                      Uint32 statusCode;
 153                      String reasonPhrase;
 154                  
 155                      Boolean parsableMessage = HTTPMessage::parseStatusLine(
 156                          startLine, httpVersion, statusCode, reasonPhrase);
 157                      if (!parsableMessage)
 158                      {
 159 kumpf       1.76         MessageLoaderParms mlParms(
 160                              "Client.CIMOperationResponseDecoder.MALFORMED_RESPONSE",
 161                              "Malformed HTTP response message.");
 162 kumpf       1.60         String mlString(MessageLoader::getMessage(mlParms));
 163                  
 164                          CIMClientMalformedHTTPException* malformedHTTPException =
 165                              new CIMClientMalformedHTTPException(mlString);
 166 kumpf       1.19 
 167 kumpf       1.60         ClientExceptionMessage * response =
 168                              new ClientExceptionMessage(malformedHTTPException);
 169 kumpf       1.76 
 170 j.alex      1.68         response->setCloseConnect(cimReconnect);
 171 humberto    1.43 
 172 kumpf       1.60         _outputQueue->enqueue(response);
 173                          return;
 174 kumpf       1.19     }
 175                  
 176 karl        1.41 #ifdef PEGASUS_CLIENT_TRACE_ENABLE
 177                      if (_showInput & 1)
 178                      {
 179                          cout << "CIMOperatonResponseDecoder";
 180                          httpMessage->printAll(cout);
 181                      }
 182                      if (_showInput & 2)
 183                      {
 184                          Logger::put(Logger::STANDARD_LOG,
 185 yi.zhou     1.75             System::CIMSERVER,
 186 marek       1.82             Logger::INFORMATION,
 187 kumpf       1.60             "CIMOperationRequestDecoder::Response, XML content: $1",
 188 kumpf       1.78             httpMessage->message.getData());
 189 karl        1.41     }
 190                  #endif
 191                  
 192 kumpf       1.8      try
 193 mike        1.2      {
 194 kumpf       1.8          if (_authenticator->checkResponseHeaderForChallenge(headers))
 195                          {
 196                              //
 197                              // Get the original request, put that in the encoder's queue for
 198                              // re-sending with authentication challenge response.
 199                              //
 200 kumpf       1.70             Message* reqMessage = _authenticator->releaseRequestMessage();
 201                  
 202 j.alex      1.69             if (cimReconnect == true)
 203                              {
 204 kumpf       1.70                 reqMessage->setCloseConnect(cimReconnect);
 205 j.alex      1.69                 _outputQueue->enqueue(reqMessage);
 206 kumpf       1.76             }
 207                              else
 208 j.alex      1.69             {
 209                                  _encoderQueue->enqueue(reqMessage);
 210                              }
 211 mike        1.2  
 212 kumpf       1.8              return;
 213                          }
 214                          else
 215                          {
 216                              //
 217                              // Received a valid/error response from the server.
 218 kumpf       1.76             // We do not need the original request message anymore, hence
 219                              // delete the request message by getting the handle from the
 220                              // ClientAuthenticator.
 221 kumpf       1.8              //
 222 kumpf       1.70             Message* reqMessage = _authenticator->releaseRequestMessage();
 223                              delete reqMessage;
 224 kumpf       1.8          }
 225 mike        1.2      }
 226 kumpf       1.76     catch (InvalidAuthHeader& e)
 227 mike        1.2      {
 228 kumpf       1.20         CIMClientMalformedHTTPException* malformedHTTPException =
 229                              new CIMClientMalformedHTTPException(e.getMessage());
 230 kumpf       1.17         ClientExceptionMessage * response =
 231                              new ClientExceptionMessage(malformedHTTPException);
 232 mike        1.2  
 233 j.alex      1.68         response->setCloseConnect(cimReconnect);
 234 kumpf       1.17         _outputQueue->enqueue(response);
 235 kumpf       1.15         return;
 236                      }
 237 kumpf       1.36 
 238 kumpf       1.52     // We have the response.  If authentication failed, we will generate a
 239                      // CIMClientHTTPErrorException below with the "401 Unauthorized" status
 240                      // in the (re-challenge) response.
 241 kumpf       1.15 
 242                      //
 243                      // Check for a success (200 OK) response
 244                      //
 245 kumpf       1.17     if (statusCode != HTTP_STATUSCODE_OK)
 246 kumpf       1.15     {
 247                          String cimError;
 248                          String pegasusError;
 249                  
 250 brian.campbell 1.57         HTTPMessage::lookupHeader(headers, "CIMError", cimError, true);
 251 kumpf          1.76         HTTPMessage::lookupHeader(
 252                                 headers, PEGASUS_HTTPHEADERTAG_ERRORDETAIL, pegasusError);
 253 kumpf          1.35         try
 254                             {
 255                                 pegasusError = XmlReader::decodeURICharacters(pegasusError);
 256                             }
 257 brian.campbell 1.57         catch (ParseError&)
 258 kumpf          1.35         {
 259                                 // Ignore this exception.  We're more interested in having the
 260                                 // message in encoded form than knowing that the format is invalid.
 261                             }
 262 kumpf          1.15 
 263 kumpf          1.32         CIMClientHTTPErrorException* httpError =
 264 kumpf          1.54             new CIMClientHTTPErrorException(statusCode, reasonPhrase,
 265                                                                 cimError, pegasusError);
 266 kumpf          1.17         ClientExceptionMessage * response =
 267                                 new ClientExceptionMessage(httpError);
 268 kumpf          1.15 
 269 j.alex         1.68         response->setCloseConnect(cimReconnect);
 270 kumpf          1.15         _outputQueue->enqueue(response);
 271 kumpf          1.8          return;
 272 mike           1.2      }
 273                     
 274                         //
 275                         // Search for "CIMOperation" header:
 276                         //
 277 kumpf          1.90     const char* cimOperation;
 278 mike           1.2  
 279                         if (!HTTPMessage::lookupHeader(
 280 kumpf          1.60         headers, "CIMOperation", cimOperation, true))
 281 mike           1.2      {
 282 kumpf          1.76         MessageLoaderParms mlParms(
 283                                 "Client.CIMOperationResponseDecoder.MISSING_CIMOP_HEADER",
 284                                 "Missing CIMOperation HTTP header");
 285                             String mlString(MessageLoader::getMessage(mlParms));
 286 humberto       1.43 
 287 kumpf          1.76         CIMClientMalformedHTTPException* malformedHTTPException =
 288                                 new CIMClientMalformedHTTPException(mlString);
 289 kumpf          1.60 
 290 kumpf          1.17         ClientExceptionMessage * response =
 291                                 new ClientExceptionMessage(malformedHTTPException);
 292                     
 293 j.alex         1.68         response->setCloseConnect(cimReconnect);
 294                     
 295 kumpf          1.17         _outputQueue->enqueue(response);
 296                             return;
 297 mike           1.2      }
 298                     
 299 david          1.42     //
 300                         // Search for "Content-Type" header:
 301                         //
 302 kumpf          1.60 
 303                         // BUG 572, Use of Content-Type header and change error msg.
 304                         // If header exists, test type.  If not, ignore. We will find
 305                         // content type errors in text analysis.
 306                         // content-type header  value format:
 307                         //              type "/" subtype *( ";" parameter )
 308                         // ex. text/xml;Charset="utf8"
 309 kumpf          1.90     const char* cimContentType;
 310 mike           1.85     bool binaryResponse = false;
 311 kumpf          1.60 
 312                         if (HTTPMessage::lookupHeader(
 313                                 headers, "Content-Type", cimContentType, true))
 314                         {
 315 kumpf          1.81         String type;
 316                             String charset;
 317 kumpf          1.60 
 318 kumpf          1.81         if (!HTTPMessage::parseContentTypeHeader(
 319                                     cimContentType, type, charset) ||
 320 mike           1.85             ((!String::equalNoCase(type, "application/xml") &&
 321 kumpf          1.81              !String::equalNoCase(type, "text/xml")) ||
 322                                 !String::equalNoCase(charset, "utf-8"))
 323 mike           1.85 #if defined(PEGASUS_ENABLE_PROTOCOL_BINARY)
 324                                 && !(binaryResponse=String::equalNoCase(
 325                                     type, "application/x-openpegasus"))
 326                     #endif
 327                             )
 328 kumpf          1.60         {
 329                                 CIMClientMalformedHTTPException* malformedHTTPException = new
 330 kumpf          1.90                 CIMClientMalformedHTTPException(
 331                                         "Bad Content-Type HTTP header; " + String(cimContentType));
 332 kumpf          1.60             ClientExceptionMessage * response =
 333                                     new ClientExceptionMessage(malformedHTTPException);
 334                     
 335 j.alex         1.68             response->setCloseConnect(cimReconnect);
 336                     
 337 kumpf          1.60             _outputQueue->enqueue(response);
 338                                 return;
 339                             }
 340                         }
 341                         // comment out the error rejection code if the content-type header does
 342                         //    not exist
 343 karl           1.48 #ifdef PEGASUS_REJECT_ON_MISSING_CONTENTTYPE_HEADER
 344 kumpf          1.60     else
 345                         {
 346                             CIMClientMalformedHTTPException* malformedHTTPException = new
 347                                 CIMClientMalformedHTTPException
 348                                     ("Missing Content-Type HTTP header; ");
 349                             ClientExceptionMessage * response =
 350                                 new ClientExceptionMessage(malformedHTTPException);
 351                     
 352 j.alex         1.68         response->setCloseConnect(cimReconnect);
 353                     
 354 kumpf          1.60         _outputQueue->enqueue(response);
 355                             return;
 356                         }
 357 karl           1.48 #endif
 358 kumpf          1.60 
 359                         // look for any cim status codes. The HTTPConnection level would have
 360                         // added them here.
 361                     
 362 kumpf          1.90     const char* cimStatusCodeValue;
 363 kumpf          1.60     Boolean found = HTTPMessage::lookupHeader(headers, "CIMStatusCode",
 364                             cimStatusCodeValue, true);
 365                         CIMStatusCode cimStatusCodeNumber = CIM_ERR_SUCCESS;
 366                     
 367 kumpf          1.90     if (found &&
 368                             (cimStatusCodeNumber = (CIMStatusCode) atoi(cimStatusCodeValue)) !=
 369                                  CIM_ERR_SUCCESS)
 370 kumpf          1.60     {
 371                             String cimStatusCodeDescription;
 372                             found = HTTPMessage::lookupHeader(headers, "CIMStatusCodeDescription",
 373                                 cimStatusCodeDescription, true);
 374 kumpf          1.90         if (found && cimStatusCodeDescription.size() > 0)
 375 kumpf          1.60         {
 376                                 try
 377                                 {
 378                                     cimStatusCodeDescription =
 379                                         XmlReader::decodeURICharacters(cimStatusCodeDescription);
 380                                 }
 381                                 catch (ParseError&)
 382                                 {
 383                                 }
 384                             } // if there is a description with the code
 385                     
 386                             CIMException* cimStatusException =
 387                                 new CIMException(cimStatusCodeNumber,cimStatusCodeDescription);
 388 brian.campbell 1.62         cimStatusException->setContentLanguages(httpMessage->contentLanguages);
 389 kumpf          1.60         ClientExceptionMessage * response =
 390                                 new ClientExceptionMessage(cimStatusException);
 391 kumpf          1.76 
 392 j.alex         1.68         response->setCloseConnect(cimReconnect);
 393                     
 394 kumpf          1.60         _outputQueue->enqueue(response);
 395                             return;
 396                         }
 397 kumpf          1.90 
 398                         const char* serverTime;
 399 kumpf          1.76     if (HTTPMessage::lookupHeader(
 400                                 headers, "WBEMServerResponseTime", serverTime, true))
 401 w.white        1.64     {
 402 kumpf          1.90         Uint32 sTime = (Uint32) atol(serverTime);
 403 w.white        1.64         dataStore->setServerTime(sTime);
 404                         }
 405                     
 406 brian.campbell 1.59 
 407 mike           1.2      // Calculate the beginning of the content from the message size and
 408 kumpf          1.78     // the content length.
 409 mike           1.2  
 410 kumpf          1.88     content = httpMessage->message.getData() +
 411 kumpf          1.78         httpMessage->message.size() - contentLength;
 412 mike           1.2  
 413                         //
 414                         // If it is a method response, then dispatch it to be handled:
 415                         //
 416                     
 417 kumpf          1.90     if (System::strcasecmp(cimOperation, "MethodResponse") != 0)
 418 mike           1.2      {
 419 kumpf          1.76         MessageLoaderParms mlParms(
 420                                 "Client.CIMOperationResponseDecoder.EXPECTED_METHODRESPONSE",
 421                                 "Received CIMOperation HTTP header value \"$1\", expected "
 422                                     "\"MethodResponse\"",
 423                                 cimOperation);
 424 kumpf          1.60         String mlString(MessageLoader::getMessage(mlParms));
 425 humberto       1.43 
 426 kumpf          1.60         CIMClientMalformedHTTPException* malformedHTTPException =
 427                                 new CIMClientMalformedHTTPException(mlString);
 428 humberto       1.43 
 429 kumpf          1.60         ClientExceptionMessage * response =
 430                                 new ClientExceptionMessage(malformedHTTPException);
 431 kumpf          1.17 
 432 j.alex         1.68         response->setCloseConnect(cimReconnect);
 433                     
 434 kumpf          1.17         _outputQueue->enqueue(response);
 435                             return;
 436 mike           1.2      }
 437                     
 438 w.white        1.64     dataStore->setResponseSize(contentLength);
 439                         dataStore->setEndNetworkTime(networkEndTime);
 440 kumpf          1.89     _handleMethodResponse(content, contentLength,
 441 mike           1.85         httpMessage->contentLanguages, cimReconnect, binaryResponse);
 442 mike           1.2  }
 443                     
 444 j.alex         1.68 void CIMOperationResponseDecoder::_handleMethodResponse(
 445 kumpf          1.88     const char* content,
 446 mike           1.85     Uint32 contentLength,
 447 kumpf          1.72     const ContentLanguageList& contentLanguages,
 448 mike           1.85     Boolean cimReconnect,
 449                         Boolean binaryResponse)
 450 mike           1.2  {
 451                         Message* response = 0;
 452                     
 453                         //
 454 mike           1.85     // Decode binary messages up-front and skip remainder:
 455                         //
 456                     
 457                         if (binaryResponse)
 458                         {
 459                             // Note: this may throw an excpetion which will be caught by caller.
 460                     
 461                             Buffer in(content, contentLength);
 462                     
 463                             CIMResponseMessage* msg = BinaryCodec::decodeResponse(in);
 464                     
 465                             msg->operationContext.set(
 466                                 ContentLanguageListContainer(contentLanguages));
 467                             msg->setCloseConnect(cimReconnect);
 468                             _outputQueue->enqueue(msg);
 469                     
 470                             return;
 471                         }
 472                     
 473                         //
 474 mike           1.2      // Create and initialize XML parser:
 475                         //
 476                     
 477                         XmlParser parser((char*)content);
 478                         XmlEntry entry;
 479                     
 480                         try
 481                         {
 482 kumpf          1.60         //
 483                             // Process <?xml ... >
 484                             //
 485 mike           1.2  
 486 kumpf          1.11         const char* xmlVersion = 0;
 487                             const char* xmlEncoding = 0;
 488                     
 489 kumpf          1.60         XmlReader::getXmlDeclaration(parser, xmlVersion, xmlEncoding);
 490 mike           1.2  
 491 kumpf          1.60         //
 492                             // Process <CIM ... >
 493                             //
 494 mike           1.2  
 495 kumpf          1.9          const char* cimVersion = 0;
 496                             const char* dtdVersion = 0;
 497                     
 498 kumpf          1.17         // ATTN-RK-P3-20020416: Need to validate these versions?
 499 kumpf          1.60         XmlReader::getCimStartTag(parser, cimVersion, dtdVersion);
 500 mike           1.2  
 501 kumpf          1.60         //
 502                             // Expect <MESSAGE ... >
 503                             //
 504 mike           1.2  
 505 kumpf          1.60         String messageId;
 506                             String protocolVersion;
 507 mike           1.2  
 508 kumpf          1.60         if (!XmlReader::getMessageStartTag(parser, messageId, protocolVersion))
 509                             {
 510 kumpf          1.76             MessageLoaderParms mlParms(
 511                                     "Client.CIMOperationResponseDecoder.EXPECTED_MESSAGE_ELEMENT",
 512 kumpf          1.60                 "expected MESSAGE element");
 513                                 throw XmlValidationError(parser.getLine(), mlParms);
 514                             }
 515 humberto       1.43 
 516 karl           1.77         // test for valid protocolVersion
 517                             if (!XmlReader::isSupportedProtocolVersion(protocolVersion))
 518 david.dillard  1.71         {
 519 kumpf          1.76             MessageLoaderParms mlParms(
 520                                     "Client.CIMOperationResponseDecoder.UNSUPPORTED_PROTOCOL",
 521                                     "Received unsupported protocol version \"$0\", expected "
 522                                         "\"$1\"",
 523                                     protocolVersion,
 524                                     "1.[0-9]+");
 525 kumpf          1.60             String mlString(MessageLoader::getMessage(mlParms));
 526 humberto       1.43 
 527 kumpf          1.60             CIMClientResponseException* responseException =
 528                                     new CIMClientResponseException(mlString);
 529 humberto       1.43 
 530 kumpf          1.83             ClientExceptionMessage * clientExceptionMessage =
 531 kumpf          1.17                 new ClientExceptionMessage(responseException);
 532 mike           1.2  
 533 kumpf          1.83             clientExceptionMessage->setCloseConnect(cimReconnect);
 534 j.alex         1.68 
 535 kumpf          1.83             _outputQueue->enqueue(clientExceptionMessage);
 536 kumpf          1.17             return;
 537 kumpf          1.60         }
 538                     
 539                             //
 540                             // Expect <SIMPLERSP ... >
 541                             //
 542                     
 543                             XmlReader::expectStartTag(parser, entry, "SIMPLERSP");
 544                     
 545                             //
 546                             // Expect <IMETHODRESPONSE ... >
 547                             //
 548 mike           1.2  
 549 kumpf          1.60         const char* iMethodResponseName = 0;
 550                             Boolean isEmptyTag = false;
 551 humberto       1.43 
 552 kumpf          1.60         if (XmlReader::getIMethodResponseStartTag(
 553                                     parser, iMethodResponseName, isEmptyTag))
 554                             {
 555                                 //
 556                                 // Dispatch the method:
 557                                 //
 558                     
 559                                 if (System::strcasecmp(iMethodResponseName, "GetClass") == 0)
 560                                     response = _decodeGetClassResponse(
 561                                         parser, messageId, isEmptyTag);
 562 kumpf          1.76             else if (System::strcasecmp(
 563                                              iMethodResponseName, "GetInstance") == 0)
 564 kumpf          1.60                 response = _decodeGetInstanceResponse(
 565                                         parser, messageId, isEmptyTag);
 566 kumpf          1.76             else if (System::strcasecmp(
 567                                              iMethodResponseName, "EnumerateClassNames") == 0)
 568 kumpf          1.60                 response = _decodeEnumerateClassNamesResponse(
 569                                         parser, messageId, isEmptyTag);
 570 kumpf          1.76             else if (System::strcasecmp(
 571                                              iMethodResponseName, "References") == 0)
 572 kumpf          1.60                 response = _decodeReferencesResponse(
 573                                         parser, messageId, isEmptyTag);
 574 kumpf          1.76             else if (System::strcasecmp(
 575                                              iMethodResponseName, "ReferenceNames") == 0)
 576 kumpf          1.60                 response = _decodeReferenceNamesResponse(
 577                                         parser, messageId, isEmptyTag);
 578 kumpf          1.76             else if (System::strcasecmp(
 579                                              iMethodResponseName, "AssociatorNames") == 0)
 580 kumpf          1.60                 response = _decodeAssociatorNamesResponse(
 581                                         parser, messageId, isEmptyTag);
 582 kumpf          1.76             else if (System::strcasecmp(
 583                                              iMethodResponseName, "Associators") == 0)
 584 kumpf          1.60                 response = _decodeAssociatorsResponse(
 585                                         parser, messageId, isEmptyTag);
 586 kumpf          1.76             else if (System::strcasecmp(
 587                                              iMethodResponseName, "CreateInstance") == 0)
 588 kumpf          1.60                 response = _decodeCreateInstanceResponse(
 589                                         parser, messageId, isEmptyTag);
 590 kumpf          1.76             else if (System::strcasecmp(
 591                                              iMethodResponseName,"EnumerateInstanceNames") == 0)
 592 kumpf          1.60                 response = _decodeEnumerateInstanceNamesResponse(
 593                                         parser, messageId, isEmptyTag);
 594 kumpf          1.76             else if (System::strcasecmp(
 595                                              iMethodResponseName,"EnumerateInstances") == 0)
 596 kumpf          1.60                 response = _decodeEnumerateInstancesResponse(
 597                                         parser, messageId, isEmptyTag);
 598 kumpf          1.76             else if (System::strcasecmp(
 599                                              iMethodResponseName, "GetProperty") == 0)
 600 kumpf          1.60                 response = _decodeGetPropertyResponse(
 601                                         parser, messageId, isEmptyTag);
 602 kumpf          1.76             else if (System::strcasecmp(
 603                                              iMethodResponseName, "SetProperty") == 0)
 604 kumpf          1.60                 response = _decodeSetPropertyResponse(
 605                                         parser, messageId, isEmptyTag);
 606 kumpf          1.76             else if (System::strcasecmp(
 607                                              iMethodResponseName, "DeleteQualifier") == 0)
 608 kumpf          1.60                 response = _decodeDeleteQualifierResponse(
 609                                         parser, messageId, isEmptyTag);
 610 kumpf          1.76             else if (System::strcasecmp(
 611                                              iMethodResponseName, "GetQualifier") == 0)
 612 kumpf          1.60                 response = _decodeGetQualifierResponse(
 613                                         parser, messageId, isEmptyTag);
 614 kumpf          1.76             else if (System::strcasecmp(
 615                                              iMethodResponseName, "SetQualifier") == 0)
 616 kumpf          1.60                 response = _decodeSetQualifierResponse(
 617                                         parser, messageId, isEmptyTag);
 618 kumpf          1.76             else if (System::strcasecmp(
 619                                              iMethodResponseName, "EnumerateQualifiers") == 0)
 620 kumpf          1.60                 response = _decodeEnumerateQualifiersResponse(
 621                                         parser, messageId, isEmptyTag);
 622 kumpf          1.76             else if (System::strcasecmp(
 623                                              iMethodResponseName, "EnumerateClasses") == 0)
 624 kumpf          1.60                 response = _decodeEnumerateClassesResponse(
 625                                         parser, messageId, isEmptyTag);
 626 kumpf          1.76             else if (System::strcasecmp(
 627                                              iMethodResponseName, "CreateClass") == 0)
 628 kumpf          1.60                 response = _decodeCreateClassResponse(
 629                                         parser, messageId, isEmptyTag);
 630 kumpf          1.76             else if (System::strcasecmp(
 631                                              iMethodResponseName, "ModifyClass") == 0)
 632 kumpf          1.60                 response = _decodeModifyClassResponse(
 633                                         parser, messageId, isEmptyTag);
 634 kumpf          1.76             else if (System::strcasecmp(
 635                                              iMethodResponseName, "ModifyInstance") == 0)
 636 kumpf          1.60                 response = _decodeModifyInstanceResponse(
 637                                         parser, messageId, isEmptyTag);
 638 kumpf          1.76             else if (System::strcasecmp(
 639                                              iMethodResponseName, "DeleteClass") == 0)
 640 kumpf          1.60                 response = _decodeDeleteClassResponse(
 641                                         parser, messageId, isEmptyTag);
 642 kumpf          1.76             else if (System::strcasecmp(
 643                                              iMethodResponseName, "DeleteInstance") == 0)
 644 kumpf          1.60                 response = _decodeDeleteInstanceResponse(
 645                                         parser, messageId, isEmptyTag);
 646                                 else if (System::strcasecmp(iMethodResponseName, "ExecQuery") == 0)
 647                                     response = _decodeExecQueryResponse(
 648                                         parser, messageId, isEmptyTag);
 649                                 else
 650                                 {
 651                                     MessageLoaderParms mlParms(
 652                                         "Client.CIMOperationResponseDecoder.UNRECOGNIZED_NAME",
 653                                         "Unrecognized IMethodResponse name \"$0\"",
 654                                         iMethodResponseName);
 655                                     throw XmlValidationError(parser.getLine(), mlParms);
 656                                 }
 657 humberto       1.43 
 658 kumpf          1.60             //
 659                                 // Handle end tag:
 660                                 //
 661 humberto       1.43 
 662 kumpf          1.60             if (!isEmptyTag)
 663                                 {
 664                                     XmlReader::expectEndTag(parser, "IMETHODRESPONSE");
 665                                 }
 666                             }
 667                             else if (XmlReader::getMethodResponseStartTag(
 668                                          parser, iMethodResponseName, isEmptyTag))
 669                             {
 670                                 response = _decodeInvokeMethodResponse(
 671                                     parser, messageId, iMethodResponseName, isEmptyTag);
 672                     
 673 j.alex         1.68 
 674 kumpf          1.60             //
 675                                 // Handle end tag:
 676                                 //
 677                                 if (!isEmptyTag)
 678                                 {
 679                                     XmlReader::expectEndTag(parser, "METHODRESPONSE");
 680                                 }
 681                             }
 682                             else
 683                             {
 684 kumpf          1.76             MessageLoaderParms mlParms(
 685                                     "Client.CIMOperationResponseDecoder."
 686                                         "EXPECTED_METHODRESPONSE_OR_IMETHODRESPONSE_ELEMENT",
 687 kumpf          1.60                 "expected METHODRESPONSE or IMETHODRESPONSE element");
 688                                 throw XmlValidationError(parser.getLine(), mlParms);
 689                             }
 690 mike           1.2  
 691                             //
 692                             // Handle end tags:
 693                             //
 694 kumpf          1.60         XmlReader::expectEndTag(parser, "SIMPLERSP");
 695                             XmlReader::expectEndTag(parser, "MESSAGE");
 696                             XmlReader::expectEndTag(parser, "CIM");
 697 mike           1.2      }
 698 kumpf          1.17     catch (XmlException& x)
 699                         {
 700                             if (response)
 701                             {
 702 karl           1.41 //#ifdef PEGASUS_SNIA_INTEROP_TEST
 703                     //         httpMessage->printAll(cout);
 704                     //#endif
 705 kumpf          1.60 
 706 kumpf          1.17             delete response;
 707                             }
 708                     
 709                             response = new ClientExceptionMessage(
 710 kumpf          1.20             new CIMClientXmlException(x.getMessage()));
 711 kumpf          1.17     }
 712 mike           1.2      catch (Exception& x)
 713                         {
 714 kumpf          1.50         // Might get MalformedObjectNameException, InvalidNameException, etc.
 715 kumpf          1.17 
 716                             if (response)
 717                             {
 718                                 delete response;
 719                             }
 720 mike           1.2  
 721 kumpf          1.17         response = new ClientExceptionMessage(
 722 kumpf          1.53             new CIMClientResponseException(x.getMessage()));
 723 mike           1.2      }
 724 chuck          1.39 
 725                     //l10n start
 726                     // l10n TODO - might want to move A-L and C-L to Message
 727                     // to make this more maintainable
 728 kumpf          1.60     // Add the language header to the request
 729                         CIMMessage * cimmsg = dynamic_cast<CIMMessage *>(response);
 730                         if (cimmsg != NULL)
 731                         {
 732 kumpf          1.76         cimmsg->operationContext.set(
 733                                 ContentLanguageListContainer(contentLanguages));
 734 kumpf          1.60     }
 735                         else
 736                         {
 737                             ;    // l10n TODO - error back to client here
 738                         }
 739                     // l10n end
 740 mike           1.2  
 741 j.alex         1.68     response->setCloseConnect(cimReconnect);
 742                     
 743                     
 744 mike           1.2      _outputQueue->enqueue(response);
 745                     }
 746                     
 747 kumpf          1.76 CIMCreateClassResponseMessage*
 748                         CIMOperationResponseDecoder::_decodeCreateClassResponse(
 749                             XmlParser& parser,
 750                             const String& messageId,
 751                             Boolean isEmptyImethodresponseTag)
 752 mike           1.2  {
 753                         XmlEntry entry;
 754 kumpf          1.12     CIMException cimException;
 755 mike           1.2  
 756 kumpf          1.60     if (!isEmptyImethodresponseTag)
 757 mike           1.2      {
 758 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
 759                             {
 760 kumpf          1.76             return new CIMCreateClassResponseMessage(
 761 kumpf          1.60                 messageId,
 762                                     cimException,
 763 kumpf          1.76                 QueueIdStack());
 764 kumpf          1.60         }
 765 mike           1.2  
 766 kumpf          1.60         if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
 767                             {
 768                                 if (entry.type != XmlEntry::EMPTY_TAG)
 769                                 {
 770                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
 771                                 }
 772                             }
 773 mike           1.2      }
 774 kumpf          1.60 
 775 kumpf          1.76     return new CIMCreateClassResponseMessage(
 776 kumpf          1.60         messageId,
 777                             cimException,
 778 kumpf          1.76         QueueIdStack());
 779 mike           1.2  }
 780                     
 781 kumpf          1.76 CIMGetClassResponseMessage*
 782                         CIMOperationResponseDecoder::_decodeGetClassResponse(
 783                             XmlParser& parser,
 784                             const String& messageId,
 785                             Boolean isEmptyImethodresponseTag)
 786 mike           1.2  {
 787                         XmlEntry entry;
 788 kumpf          1.12     CIMException cimException;
 789 mike           1.2  
 790 kumpf          1.60     if (isEmptyImethodresponseTag)
 791                         {
 792                             MessageLoaderParms mlParms("Common.XmlReader.EXPECTED_OPEN",
 793                                 "Expected open of $0 element", "IMETHODRESPONSE");
 794                             throw XmlValidationError(parser.getLine(), mlParms);
 795                         }
 796                         else if (XmlReader::getErrorElement(parser, cimException))
 797 mike           1.2      {
 798 kumpf          1.76         return new CIMGetClassResponseMessage(
 799 kumpf          1.60             messageId,
 800                                 cimException,
 801                                 QueueIdStack(),
 802 kumpf          1.76             CIMClass());
 803 mike           1.2      }
 804 kumpf          1.37     else if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
 805 mike           1.2      {
 806 kumpf          1.60         CIMClass cimClass;
 807 mike           1.2  
 808 kumpf          1.60         if ((entry.type == XmlEntry::EMPTY_TAG) ||
 809                                 !XmlReader::getClassElement(parser, cimClass))
 810                             {
 811                                 MessageLoaderParms mlParms(
 812                                     "Client.CIMOperationResponseDecoder.EXPECTED_CLASS_ELEMENT",
 813                                     "expected CLASS element");
 814                                 throw XmlValidationError(parser.getLine(), mlParms);
 815                             }
 816 humberto       1.43 
 817 kumpf          1.60         XmlReader::expectEndTag(parser, "IRETURNVALUE");
 818 humberto       1.43 
 819 kumpf          1.76         return new CIMGetClassResponseMessage(
 820 kumpf          1.60             messageId,
 821                                 cimException,
 822                                 QueueIdStack(),
 823 kumpf          1.76             cimClass);
 824 mike           1.2      }
 825                         else
 826                         {
 827 kumpf          1.76         MessageLoaderParms mlParms(
 828                                 "Client.CIMOperationResponseDecoder."
 829                                     "EXPECTED_ERROR_OR_IRETURNVALUE_ELEMENT",
 830 kumpf          1.60             "expected ERROR or IRETURNVALUE element");
 831                             throw XmlValidationError(parser.getLine(), mlParms);
 832 mike           1.2      }
 833                     }
 834                     
 835 kumpf          1.76 CIMModifyClassResponseMessage*
 836                         CIMOperationResponseDecoder::_decodeModifyClassResponse(
 837                             XmlParser& parser,
 838                             const String& messageId,
 839                             Boolean isEmptyImethodresponseTag)
 840 mike           1.2  {
 841                         XmlEntry entry;
 842 kumpf          1.12     CIMException cimException;
 843 mike           1.2  
 844 kumpf          1.60     if (!isEmptyImethodresponseTag)
 845 mike           1.2      {
 846 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
 847                             {
 848 kumpf          1.76             return new CIMModifyClassResponseMessage(
 849 kumpf          1.60                 messageId,
 850                                     cimException,
 851 kumpf          1.76                 QueueIdStack());
 852 kumpf          1.60         }
 853                     
 854                             if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
 855                             {
 856                                 if (entry.type != XmlEntry::EMPTY_TAG)
 857                                 {
 858                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
 859                                 }
 860                             }
 861 mike           1.2      }
 862 kumpf          1.60 
 863 kumpf          1.76     return new CIMModifyClassResponseMessage(
 864 kumpf          1.60         messageId,
 865                             cimException,
 866 kumpf          1.76         QueueIdStack());
 867 mike           1.2  }
 868                     
 869 kumpf          1.76 CIMEnumerateClassNamesResponseMessage*
 870                         CIMOperationResponseDecoder::_decodeEnumerateClassNamesResponse(
 871                             XmlParser& parser,
 872                             const String& messageId,
 873                             Boolean isEmptyImethodresponseTag)
 874 mike           1.2  {
 875                         XmlEntry entry;
 876 kumpf          1.12     CIMException cimException;
 877 kumpf          1.60     Array<CIMName> classNames;
 878 mike           1.2  
 879 kumpf          1.60     if (!isEmptyImethodresponseTag)
 880 mike           1.2      {
 881 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
 882                             {
 883 kumpf          1.76             return new CIMEnumerateClassNamesResponseMessage(
 884 kumpf          1.60                 messageId,
 885                                     cimException,
 886                                     QueueIdStack(),
 887 kumpf          1.76                 Array<CIMName>());
 888 kumpf          1.60         }
 889                     
 890                             if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
 891                             {
 892                                 if (entry.type != XmlEntry::EMPTY_TAG)
 893                                 {
 894                                     CIMName className;
 895                     
 896                                     while (XmlReader::getClassNameElement(parser, className, false))
 897                                         classNames.append(className);
 898                     
 899                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
 900                                 }
 901                             }
 902 mike           1.2      }
 903                     
 904 kumpf          1.76     return new CIMEnumerateClassNamesResponseMessage(
 905 kumpf          1.60         messageId,
 906                             cimException,
 907                             QueueIdStack(),
 908 kumpf          1.76         classNames);
 909 mike           1.2  }
 910                     
 911 kumpf          1.76 CIMEnumerateClassesResponseMessage*
 912                         CIMOperationResponseDecoder::_decodeEnumerateClassesResponse(
 913                             XmlParser& parser,
 914                             const String& messageId,
 915                             Boolean isEmptyImethodresponseTag)
 916 mike           1.2  {
 917                         XmlEntry entry;
 918 kumpf          1.12     CIMException cimException;
 919 kumpf          1.60     Array<CIMClass> cimClasses;
 920 mike           1.2  
 921 kumpf          1.60     if (!isEmptyImethodresponseTag)
 922 mike           1.2      {
 923 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
 924                             {
 925 kumpf          1.76             return new CIMEnumerateClassesResponseMessage(
 926 kumpf          1.60                 messageId,
 927                                     cimException,
 928                                     QueueIdStack(),
 929 kumpf          1.76                 Array<CIMClass>());
 930 kumpf          1.60         }
 931                     
 932                             if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
 933                             {
 934                                 if (entry.type != XmlEntry::EMPTY_TAG)
 935                                 {
 936                                     CIMClass cimClass;
 937                     
 938                                     while (XmlReader::getClassElement(parser, cimClass))
 939                                         cimClasses.append(cimClass);
 940                     
 941                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
 942                                 }
 943                             }
 944 mike           1.2      }
 945                     
 946 kumpf          1.76     return new CIMEnumerateClassesResponseMessage(
 947 kumpf          1.60         messageId,
 948                             cimException,
 949                             QueueIdStack(),
 950 kumpf          1.76         cimClasses);
 951 mike           1.2  }
 952                     
 953 kumpf          1.76 CIMDeleteClassResponseMessage*
 954                         CIMOperationResponseDecoder::_decodeDeleteClassResponse(
 955                             XmlParser& parser,
 956                             const String& messageId,
 957                             Boolean isEmptyImethodresponseTag)
 958 mike           1.2  {
 959                         XmlEntry entry;
 960 kumpf          1.12     CIMException cimException;
 961 mike           1.2  
 962 kumpf          1.60     if (!isEmptyImethodresponseTag)
 963 mike           1.2      {
 964 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
 965                             {
 966 kumpf          1.76             return new CIMDeleteClassResponseMessage(
 967 kumpf          1.60                 messageId,
 968                                     cimException,
 969 kumpf          1.76                 QueueIdStack());
 970 kumpf          1.60         }
 971                     
 972                             if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
 973                             {
 974                                 if (entry.type != XmlEntry::EMPTY_TAG)
 975                                 {
 976                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
 977                                 }
 978                             }
 979 mike           1.2      }
 980 kumpf          1.60 
 981 kumpf          1.76     return new CIMDeleteClassResponseMessage(
 982 kumpf          1.60         messageId,
 983                             cimException,
 984 kumpf          1.76         QueueIdStack());
 985 mike           1.2  }
 986                     
 987 kumpf          1.76 CIMCreateInstanceResponseMessage*
 988                         CIMOperationResponseDecoder::_decodeCreateInstanceResponse(
 989                             XmlParser& parser,
 990                             const String& messageId,
 991                             Boolean isEmptyImethodresponseTag)
 992 mike           1.2  {
 993                         XmlEntry entry;
 994 kumpf          1.12     CIMException cimException;
 995 mike           1.2  
 996 kumpf          1.60     if (isEmptyImethodresponseTag)
 997                         {
 998                             MessageLoaderParms mlParms("Common.XmlReader.EXPECTED_OPEN",
 999                                 "Expected open of $0 element", "IMETHODRESPONSE");
1000                             throw XmlValidationError(parser.getLine(), mlParms);
1001                         }
1002                         else if (XmlReader::getErrorElement(parser, cimException))
1003 mike           1.2      {
1004 kumpf          1.76         return new CIMCreateInstanceResponseMessage(
1005 kumpf          1.60             messageId,
1006                                 cimException,
1007                                 QueueIdStack(),
1008 kumpf          1.76             CIMObjectPath());
1009 mike           1.2      }
1010                         else if (XmlReader::testStartTag(parser, entry, "IRETURNVALUE"))
1011                         {
1012 kumpf          1.60         CIMObjectPath instanceName;
1013                             XmlReader::getInstanceNameElement(parser, instanceName);
1014 mike           1.2  
1015 kumpf          1.60         XmlReader::expectEndTag(parser, "IRETURNVALUE");
1016 mike           1.2  
1017 kumpf          1.76         return new CIMCreateInstanceResponseMessage(
1018 kumpf          1.60             messageId,
1019                                 cimException,
1020                                 QueueIdStack(),
1021 kumpf          1.76             instanceName);
1022 mike           1.2      }
1023                         else
1024                         {
1025 kumpf          1.76         MessageLoaderParms mlParms(
1026                                 "Client.CIMOperationResponseDecoder."
1027                                     "EXPECTED_ERROR_OR_IRETURNVALUE_ELEMENT",
1028 kumpf          1.60             "expected ERROR or IRETURNVALUE element");
1029 humberto       1.43 
1030 kumpf          1.60         throw XmlValidationError(parser.getLine(), mlParms);
1031 mike           1.2      }
1032                     }
1033                     
1034 kumpf          1.76 CIMGetInstanceResponseMessage*
1035                         CIMOperationResponseDecoder::_decodeGetInstanceResponse(
1036                             XmlParser& parser,
1037                             const String& messageId,
1038                             Boolean isEmptyImethodresponseTag)
1039 mike           1.2  {
1040                         XmlEntry entry;
1041 kumpf          1.12     CIMException cimException;
1042 mike           1.2  
1043 kumpf          1.60     if (isEmptyImethodresponseTag)
1044                         {
1045                             MessageLoaderParms mlParms("Common.XmlReader.EXPECTED_OPEN",
1046                                 "Expected open of $0 element", "IMETHODRESPONSE");
1047                             throw XmlValidationError(parser.getLine(), mlParms);
1048                         }
1049                         else if (XmlReader::getErrorElement(parser, cimException))
1050 mike           1.2      {
1051 kumpf          1.76         return new CIMGetInstanceResponseMessage(
1052 kumpf          1.60             messageId,
1053                                 cimException,
1054 mike           1.84             QueueIdStack());
1055 mike           1.2      }
1056 kumpf          1.37     else if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
1057 mike           1.2      {
1058 kumpf          1.60         CIMInstance cimInstance;
1059 mike           1.2  
1060 kumpf          1.60         if ((entry.type == XmlEntry::EMPTY_TAG) ||
1061                                 !XmlReader::getInstanceElement(parser, cimInstance))
1062                             {
1063                                 MessageLoaderParms mlParms(
1064                                     "Client.CIMOperationResponseDecoder.EXPECTED_INSTANCE_ELEMENT",
1065                                     "expected INSTANCE element");
1066                                 throw XmlValidationError(parser.getLine(), mlParms);
1067                             }
1068 mike           1.2  
1069 kumpf          1.60         XmlReader::expectEndTag(parser, "IRETURNVALUE");
1070 mike           1.2  
1071 mike           1.84         CIMGetInstanceResponseMessage* msg = new CIMGetInstanceResponseMessage(
1072 kumpf          1.60             messageId,
1073                                 cimException,
1074 mike           1.84             QueueIdStack());
1075 r.kieninger    1.91         msg->getResponseData().setCimInstance(cimInstance);
1076 mike           1.84         return msg;
1077 mike           1.2      }
1078                         else
1079                         {
1080 kumpf          1.76         MessageLoaderParms mlParms(
1081                                 "Client.CIMOperationResponseDecoder."
1082                                     "EXPECTED_ERROR_OR_IRETURNVALUE_ELEMENT",
1083 kumpf          1.60             "expected ERROR or IRETURNVALUE element");
1084                             throw XmlValidationError(parser.getLine(), mlParms);
1085 mike           1.2      }
1086                     }
1087                     
1088 kumpf          1.76 CIMModifyInstanceResponseMessage*
1089                         CIMOperationResponseDecoder::_decodeModifyInstanceResponse(
1090                             XmlParser& parser,
1091                             const String& messageId,
1092                             Boolean isEmptyImethodresponseTag)
1093 mike           1.2  {
1094                         XmlEntry entry;
1095 kumpf          1.12     CIMException cimException;
1096 mike           1.2  
1097 kumpf          1.60     if (!isEmptyImethodresponseTag)
1098 mike           1.2      {
1099 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
1100                             {
1101 kumpf          1.76             return new CIMModifyInstanceResponseMessage(
1102 kumpf          1.60                 messageId,
1103                                     cimException,
1104 kumpf          1.76                 QueueIdStack());
1105 kumpf          1.60         }
1106                     
1107                             if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
1108                             {
1109                                 if (entry.type != XmlEntry::EMPTY_TAG)
1110                                 {
1111                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
1112                                 }
1113                             }
1114 mike           1.2      }
1115 kumpf          1.60 
1116 kumpf          1.76     return new CIMModifyInstanceResponseMessage(
1117 kumpf          1.60         messageId,
1118                             cimException,
1119 kumpf          1.76         QueueIdStack());
1120 mike           1.2  }
1121                     
1122 kumpf          1.76 CIMEnumerateInstanceNamesResponseMessage*
1123                         CIMOperationResponseDecoder::_decodeEnumerateInstanceNamesResponse(
1124                             XmlParser& parser,
1125                             const String& messageId,
1126                             Boolean isEmptyImethodresponseTag)
1127 mike           1.2  {
1128                         XmlEntry entry;
1129 kumpf          1.12     CIMException cimException;
1130 kumpf          1.60     Array<CIMObjectPath> instanceNames;
1131 mike           1.2  
1132 kumpf          1.60     if (!isEmptyImethodresponseTag)
1133 mike           1.2      {
1134 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
1135                             {
1136 kumpf          1.76             return new CIMEnumerateInstanceNamesResponseMessage(
1137 kumpf          1.60                 messageId,
1138                                     cimException,
1139                                     QueueIdStack(),
1140 kumpf          1.76                 Array<CIMObjectPath>());
1141 kumpf          1.60         }
1142                     
1143                             if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
1144                             {
1145                                 if (entry.type != XmlEntry::EMPTY_TAG)
1146                                 {
1147                                     String className;
1148                                     Array<CIMKeyBinding> keyBindings;
1149                     
1150                                     while (XmlReader::getInstanceNameElement(
1151                                         parser, className, keyBindings))
1152                                     {
1153                                         CIMObjectPath r(
1154                                             String::EMPTY,
1155                                             CIMNamespaceName(),
1156                                             className,
1157                                             keyBindings);
1158                                         instanceNames.append(r);
1159                                     }
1160                     
1161                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
1162 kumpf          1.60             }
1163                             }
1164 mike           1.2      }
1165                     
1166 kumpf          1.76     return new CIMEnumerateInstanceNamesResponseMessage(
1167 kumpf          1.60         messageId,
1168                             cimException,
1169                             QueueIdStack(),
1170 kumpf          1.76         instanceNames);
1171 mike           1.2  }
1172                     
1173 kumpf          1.76 CIMEnumerateInstancesResponseMessage*
1174                         CIMOperationResponseDecoder::_decodeEnumerateInstancesResponse(
1175                             XmlParser& parser,
1176                             const String& messageId,
1177                             Boolean isEmptyImethodresponseTag)
1178 mike           1.2  {
1179                         XmlEntry entry;
1180 kumpf          1.12     CIMException cimException;
1181 kumpf          1.60     Array<CIMInstance> namedInstances;
1182 mike           1.2  
1183 kumpf          1.60     if (!isEmptyImethodresponseTag)
1184 mike           1.2      {
1185 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
1186                             {
1187 kumpf          1.76             return new CIMEnumerateInstancesResponseMessage(
1188 kumpf          1.60                 messageId,
1189                                     cimException,
1190 mike           1.84                 QueueIdStack());
1191 kumpf          1.60         }
1192                     
1193                             if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
1194                             {
1195                                 if (entry.type != XmlEntry::EMPTY_TAG)
1196                                 {
1197                                     CIMInstance namedInstance;
1198                     
1199                                     while (XmlReader::getNamedInstanceElement(
1200                                                parser, namedInstance))
1201                                     {
1202                                         namedInstances.append(namedInstance);
1203                                     }
1204                     
1205                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
1206                                 }
1207                             }
1208 mike           1.2      }
1209                     
1210 mike           1.84     CIMEnumerateInstancesResponseMessage* msg;
1211 kumpf          1.89 
1212 mike           1.84     msg = new CIMEnumerateInstancesResponseMessage(
1213 kumpf          1.60         messageId,
1214                             cimException,
1215 mike           1.84         QueueIdStack());
1216                     
1217 r.kieninger    1.91     msg->getResponseData().setNamedInstances(namedInstances);
1218 mike           1.84     return msg;
1219 mike           1.2  }
1220                     
1221 kumpf          1.76 CIMDeleteInstanceResponseMessage*
1222                         CIMOperationResponseDecoder::_decodeDeleteInstanceResponse(
1223                             XmlParser& parser,
1224                             const String& messageId,
1225                             Boolean isEmptyImethodresponseTag)
1226 mike           1.2  {
1227                         XmlEntry entry;
1228 kumpf          1.12     CIMException cimException;
1229 mike           1.2  
1230 kumpf          1.60     if (!isEmptyImethodresponseTag)
1231 mike           1.2      {
1232 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
1233                             {
1234 kumpf          1.76             return new CIMDeleteInstanceResponseMessage(
1235 kumpf          1.60                 messageId,
1236                                     cimException,
1237 kumpf          1.76                 QueueIdStack());
1238 kumpf          1.60         }
1239                     
1240                             if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
1241                             {
1242                                 if (entry.type != XmlEntry::EMPTY_TAG)
1243                                 {
1244                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
1245                                 }
1246                             }
1247 mike           1.2      }
1248 kumpf          1.60 
1249 kumpf          1.76     return new CIMDeleteInstanceResponseMessage(
1250 kumpf          1.60         messageId,
1251                             cimException,
1252 kumpf          1.76         QueueIdStack());
1253 mike           1.2  }
1254                     
1255 kumpf          1.76 CIMGetPropertyResponseMessage*
1256                         CIMOperationResponseDecoder::_decodeGetPropertyResponse(
1257                             XmlParser& parser,
1258                             const String& messageId,
1259                             Boolean isEmptyImethodresponseTag)
1260 mike           1.2  {
1261                         XmlEntry entry;
1262 kumpf          1.12     CIMException cimException;
1263 kumpf          1.60     CIMValue cimValue(CIMTYPE_STRING, false);
1264 mike           1.2  
1265 kumpf          1.60     if (!isEmptyImethodresponseTag)
1266 mike           1.2      {
1267 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
1268                             {
1269 kumpf          1.76             return new CIMGetPropertyResponseMessage(
1270 kumpf          1.60                 messageId,
1271                                     cimException,
1272                                     QueueIdStack(),
1273 kumpf          1.76                 CIMValue());
1274 kumpf          1.60         }
1275 kumpf          1.14 
1276 kumpf          1.60         if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
1277                             {
1278                                 if (entry.type != XmlEntry::EMPTY_TAG)
1279                                 {
1280                                     if (!XmlReader::getPropertyValue(parser, cimValue))
1281                                     {
1282 kumpf          1.37                     // No value given; just return a null String value
1283 kumpf          1.60                 }
1284 kumpf          1.37 
1285 kumpf          1.60                 XmlReader::expectEndTag(parser, "IRETURNVALUE");
1286                                 }
1287                             }
1288                             else
1289                             {
1290 kumpf          1.14             // No value given; just return a null String value
1291 kumpf          1.60         }
1292                         }
1293 mike           1.2  
1294 kumpf          1.76     return new CIMGetPropertyResponseMessage(
1295 kumpf          1.60         messageId,
1296                             cimException,
1297                             QueueIdStack(),
1298 kumpf          1.76         cimValue);
1299 mike           1.2  }
1300                     
1301 kumpf          1.76 CIMSetPropertyResponseMessage*
1302                         CIMOperationResponseDecoder::_decodeSetPropertyResponse(
1303                             XmlParser& parser,
1304                             const String& messageId,
1305                             Boolean isEmptyImethodresponseTag)
1306 mike           1.2  {
1307                         XmlEntry entry;
1308 kumpf          1.12     CIMException cimException;
1309 mike           1.2  
1310 kumpf          1.60     if (!isEmptyImethodresponseTag)
1311 mike           1.2      {
1312 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
1313                             {
1314 kumpf          1.76             return new CIMSetPropertyResponseMessage(
1315 kumpf          1.60                 messageId,
1316                                     cimException,
1317 kumpf          1.76                 QueueIdStack());
1318 kumpf          1.60         }
1319                     
1320                             if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
1321                             {
1322                                 if (entry.type != XmlEntry::EMPTY_TAG)
1323                                 {
1324                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
1325                                 }
1326                             }
1327 mike           1.2      }
1328 kumpf          1.60 
1329 kumpf          1.76     return new CIMSetPropertyResponseMessage(
1330 kumpf          1.60         messageId,
1331                             cimException,
1332 kumpf          1.76         QueueIdStack());
1333 mike           1.2  }
1334                     
1335 kumpf          1.76 CIMSetQualifierResponseMessage*
1336                         CIMOperationResponseDecoder::_decodeSetQualifierResponse(
1337                             XmlParser& parser,
1338                             const String& messageId,
1339                             Boolean isEmptyImethodresponseTag)
1340 mike           1.2  {
1341                         XmlEntry entry;
1342 kumpf          1.12     CIMException cimException;
1343 mike           1.2  
1344 kumpf          1.60     if (!isEmptyImethodresponseTag)
1345 mike           1.2      {
1346 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
1347                             {
1348 kumpf          1.76             return new CIMSetQualifierResponseMessage(
1349 kumpf          1.60                 messageId,
1350                                     cimException,
1351 kumpf          1.76                 QueueIdStack());
1352 kumpf          1.60         }
1353                     
1354                             if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
1355                             {
1356                                 if (entry.type != XmlEntry::EMPTY_TAG)
1357                                 {
1358                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
1359                                 }
1360                             }
1361 mike           1.2      }
1362 kumpf          1.60 
1363 kumpf          1.76     return new CIMSetQualifierResponseMessage(
1364 kumpf          1.60         messageId,
1365                             cimException,
1366 kumpf          1.76         QueueIdStack());
1367 mike           1.2  }
1368                     
1369 kumpf          1.76 CIMGetQualifierResponseMessage*
1370                         CIMOperationResponseDecoder::_decodeGetQualifierResponse(
1371                             XmlParser& parser,
1372                             const String& messageId,
1373                             Boolean isEmptyImethodresponseTag)
1374 mike           1.2  {
1375                         XmlEntry entry;
1376 kumpf          1.12     CIMException cimException;
1377 mike           1.2  
1378 kumpf          1.60     if (isEmptyImethodresponseTag)
1379                         {
1380                             MessageLoaderParms mlParms("Common.XmlReader.EXPECTED_OPEN",
1381                                 "Expected open of $0 element", "IMETHODRESPONSE");
1382                             throw XmlValidationError(parser.getLine(), mlParms);
1383                         }
1384                         else if (XmlReader::getErrorElement(parser, cimException))
1385 mike           1.2      {
1386 kumpf          1.76         return new CIMGetQualifierResponseMessage(
1387 kumpf          1.60             messageId,
1388                                 cimException,
1389                                 QueueIdStack(),
1390 kumpf          1.76             CIMQualifierDecl());
1391 mike           1.2      }
1392                         else if (XmlReader::testStartTag(parser, entry, "IRETURNVALUE"))
1393                         {
1394 kumpf          1.60         CIMQualifierDecl qualifierDecl;
1395                             XmlReader::getQualifierDeclElement(parser, qualifierDecl);
1396 mike           1.2  
1397 kumpf          1.60         XmlReader::expectEndTag(parser, "IRETURNVALUE");
1398 mike           1.2  
1399 kumpf          1.76         return new CIMGetQualifierResponseMessage(
1400 kumpf          1.60             messageId,
1401                                 cimException,
1402                                 QueueIdStack(),
1403 kumpf          1.76             qualifierDecl);
1404 mike           1.2      }
1405                         else
1406                         {
1407 kumpf          1.76         MessageLoaderParms mlParms(
1408                                 "Client.CIMOperationResponseDecoder."
1409                                     "EXPECTED_ERROR_OR_IRETURNVALUE_ELEMENT",
1410                                 "expected ERROR or IRETURNVALUE element");
1411 kumpf          1.60         throw XmlValidationError(parser.getLine(), mlParms);
1412 mike           1.2      }
1413                     }
1414                     
1415 kumpf          1.76 CIMEnumerateQualifiersResponseMessage*
1416                         CIMOperationResponseDecoder::_decodeEnumerateQualifiersResponse(
1417                             XmlParser& parser,
1418                             const String& messageId,
1419                             Boolean isEmptyImethodresponseTag)
1420 mike           1.2  {
1421                         XmlEntry entry;
1422 kumpf          1.12     CIMException cimException;
1423 kumpf          1.60     Array<CIMQualifierDecl> qualifierDecls;
1424 mike           1.2  
1425 kumpf          1.60     if (!isEmptyImethodresponseTag)
1426 mike           1.2      {
1427 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
1428                             {
1429 kumpf          1.76             return new CIMEnumerateQualifiersResponseMessage(
1430 kumpf          1.60                 messageId,
1431                                     cimException,
1432                                     QueueIdStack(),
1433 kumpf          1.76                 Array<CIMQualifierDecl>());
1434 kumpf          1.60         }
1435                     
1436                             if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
1437                             {
1438                                 if (entry.type != XmlEntry::EMPTY_TAG)
1439                                 {
1440                                     CIMQualifierDecl qualifierDecl;
1441                     
1442                                     while (XmlReader::getQualifierDeclElement(
1443                                                parser, qualifierDecl))
1444                                     {
1445                                         qualifierDecls.append(qualifierDecl);
1446                                     }
1447                     
1448                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
1449                                 }
1450                             }
1451 mike           1.2      }
1452                     
1453 kumpf          1.76     return new CIMEnumerateQualifiersResponseMessage(
1454 kumpf          1.60         messageId,
1455                             cimException,
1456                             QueueIdStack(),
1457 kumpf          1.76         qualifierDecls);
1458 mike           1.2  }
1459                     
1460 kumpf          1.76 CIMDeleteQualifierResponseMessage*
1461                         CIMOperationResponseDecoder::_decodeDeleteQualifierResponse(
1462                             XmlParser& parser,
1463                             const String& messageId,
1464                             Boolean isEmptyImethodresponseTag)
1465 mike           1.2  {
1466                         XmlEntry entry;
1467 kumpf          1.12     CIMException cimException;
1468 mike           1.2  
1469 kumpf          1.60     if (!isEmptyImethodresponseTag)
1470 mike           1.2      {
1471 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
1472                             {
1473 kumpf          1.76             return new CIMDeleteQualifierResponseMessage(
1474 kumpf          1.60                 messageId,
1475                                     cimException,
1476 kumpf          1.76                 QueueIdStack());
1477 kumpf          1.60         }
1478                     
1479                             if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
1480                             {
1481                                 if (entry.type != XmlEntry::EMPTY_TAG)
1482                                 {
1483                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
1484                                 }
1485                             }
1486 mike           1.2      }
1487 kumpf          1.60 
1488 kumpf          1.76     return new CIMDeleteQualifierResponseMessage(
1489 kumpf          1.60         messageId,
1490                             cimException,
1491 kumpf          1.76         QueueIdStack());
1492 mike           1.2  }
1493                     
1494 kumpf          1.76 CIMReferenceNamesResponseMessage*
1495                         CIMOperationResponseDecoder::_decodeReferenceNamesResponse(
1496                             XmlParser& parser,
1497                             const String& messageId,
1498                             Boolean isEmptyImethodresponseTag)
1499 mike           1.2  {
1500                         XmlEntry entry;
1501 kumpf          1.12     CIMException cimException;
1502 kumpf          1.60     Array<CIMObjectPath> objectPaths;
1503 mike           1.2  
1504 kumpf          1.60     if (!isEmptyImethodresponseTag)
1505 mike           1.2      {
1506 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
1507                             {
1508 kumpf          1.76             return new CIMReferenceNamesResponseMessage(
1509 kumpf          1.60                 messageId,
1510                                     cimException,
1511                                     QueueIdStack(),
1512 kumpf          1.76                 Array<CIMObjectPath>());
1513 kumpf          1.60         }
1514                     
1515                             if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
1516                             {
1517                                 if (entry.type != XmlEntry::EMPTY_TAG)
1518                                 {
1519                                     CIMObjectPath objectPath;
1520                     
1521                                     while (XmlReader::getObjectPathElement(parser, objectPath))
1522                                         objectPaths.append(objectPath);
1523                     
1524                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
1525                                 }
1526                             }
1527 mike           1.2      }
1528                     
1529 kumpf          1.76     return new CIMReferenceNamesResponseMessage(
1530 kumpf          1.60         messageId,
1531                             cimException,
1532                             QueueIdStack(),
1533 kumpf          1.76         objectPaths);
1534 mike           1.2  }
1535                     
1536 kumpf          1.76 CIMReferencesResponseMessage*
1537                         CIMOperationResponseDecoder::_decodeReferencesResponse(
1538                             XmlParser& parser,
1539                             const String& messageId,
1540                             Boolean isEmptyImethodresponseTag)
1541 mike           1.2  {
1542                         XmlEntry entry;
1543 kumpf          1.12     CIMException cimException;
1544 kumpf          1.60     Array<CIMObject> objectWithPathArray;
1545 mike           1.2  
1546 kumpf          1.60     if (!isEmptyImethodresponseTag)
1547 mike           1.2      {
1548 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
1549                             {
1550 kumpf          1.76             return new CIMReferencesResponseMessage(
1551 kumpf          1.60                 messageId,
1552                                     cimException,
1553                                     QueueIdStack(),
1554 kumpf          1.76                 Array<CIMObject>());
1555 kumpf          1.60         }
1556                     
1557                             if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
1558                             {
1559                                 if (entry.type != XmlEntry::EMPTY_TAG)
1560                                 {
1561                                     CIMObject objectWithPath;
1562                     
1563                                     while (XmlReader::getValueObjectWithPathElement(
1564                                                parser, objectWithPath))
1565                                     {
1566                                         objectWithPathArray.append(objectWithPath);
1567                                     }
1568                     
1569                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
1570                                 }
1571                             }
1572 mike           1.2      }
1573                     
1574 kumpf          1.76     return new CIMReferencesResponseMessage(
1575 kumpf          1.60         messageId,
1576                             cimException,
1577                             QueueIdStack(),
1578 kumpf          1.76         objectWithPathArray);
1579 mike           1.2  }
1580                     
1581 kumpf          1.76 CIMAssociatorNamesResponseMessage*
1582                         CIMOperationResponseDecoder::_decodeAssociatorNamesResponse(
1583                             XmlParser& parser,
1584                             const String& messageId,
1585                             Boolean isEmptyImethodresponseTag)
1586 mike           1.2  {
1587                         XmlEntry entry;
1588 kumpf          1.12     CIMException cimException;
1589 kumpf          1.60     Array<CIMObjectPath> objectPaths;
1590 mike           1.2  
1591 kumpf          1.60     if (!isEmptyImethodresponseTag)
1592 mike           1.2      {
1593 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
1594                             {
1595 kumpf          1.76             return new CIMAssociatorNamesResponseMessage(
1596 kumpf          1.60                 messageId,
1597                                     cimException,
1598                                     QueueIdStack(),
1599 kumpf          1.76                 Array<CIMObjectPath>());
1600 kumpf          1.60         }
1601                     
1602                             if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
1603                             {
1604                                 if (entry.type != XmlEntry::EMPTY_TAG)
1605                                 {
1606                                     CIMObjectPath objectPath;
1607                     
1608                                     while (XmlReader::getObjectPathElement(parser, objectPath))
1609                                         objectPaths.append(objectPath);
1610                     
1611                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
1612                                 }
1613                             }
1614 mike           1.2      }
1615                     
1616 kumpf          1.76     return new CIMAssociatorNamesResponseMessage(
1617 kumpf          1.60         messageId,
1618                             cimException,
1619                             QueueIdStack(),
1620 kumpf          1.76         objectPaths);
1621 mike           1.2  }
1622                     
1623 kumpf          1.76 CIMAssociatorsResponseMessage*
1624                         CIMOperationResponseDecoder::_decodeAssociatorsResponse(
1625                             XmlParser& parser,
1626                             const String& messageId,
1627                             Boolean isEmptyImethodresponseTag)
1628 mike           1.2  {
1629                         XmlEntry entry;
1630 kumpf          1.12     CIMException cimException;
1631 kumpf          1.60     Array<CIMObject> objectWithPathArray;
1632 mike           1.2  
1633 kumpf          1.60     if (!isEmptyImethodresponseTag)
1634 mike           1.2      {
1635 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
1636                             {
1637 kumpf          1.76             return new CIMAssociatorsResponseMessage(
1638 kumpf          1.60                 messageId,
1639                                     cimException,
1640 r.kieninger    1.91                 QueueIdStack());
1641 kumpf          1.60         }
1642                     
1643                             if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
1644                             {
1645                                 if (entry.type != XmlEntry::EMPTY_TAG)
1646                                 {
1647                                     CIMObject objectWithPath;
1648                     
1649                                     while (XmlReader::getValueObjectWithPathElement(
1650                                                parser, objectWithPath))
1651                                     {
1652                                         objectWithPathArray.append(objectWithPath);
1653                                     }
1654                     
1655                                     XmlReader::expectEndTag(parser, "IRETURNVALUE");
1656                                 }
1657                             }
1658 mike           1.2      }
1659                     
1660 r.kieninger    1.91     CIMAssociatorsResponseMessage* msg;
1661                     
1662                         msg = new CIMAssociatorsResponseMessage(
1663 kumpf          1.60         messageId,
1664                             cimException,
1665 r.kieninger    1.91         QueueIdStack());
1666                     
1667                         msg->getResponseData().setCIMObjects(objectWithPathArray);
1668                     
1669                         return msg;
1670 kumpf          1.10 }
1671                     
1672 kumpf          1.76 CIMExecQueryResponseMessage*
1673                         CIMOperationResponseDecoder::_decodeExecQueryResponse(
1674                             XmlParser& parser,
1675                             const String& messageId,
1676                             Boolean isEmptyImethodresponseTag)
1677 kumpf          1.10 {
1678                         XmlEntry entry;
1679 kumpf          1.12     CIMException cimException;
1680 kumpf          1.60     Array<CIMObject> objectWithPathArray;
1681 kumpf          1.10 
1682 kumpf          1.60     if (!isEmptyImethodresponseTag)
1683 kumpf          1.10     {
1684 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
1685                             {
1686 kumpf          1.76             return new CIMExecQueryResponseMessage(
1687 kumpf          1.60                 messageId,
1688                                     cimException,
1689 r.kieninger    1.91                 QueueIdStack());
1690 kumpf          1.60         }
1691 kumpf          1.10 
1692 kumpf          1.60         if (XmlReader::testStartTagOrEmptyTag(parser, entry, "IRETURNVALUE"))
1693                             {
1694                                 if (entry.type != XmlEntry::EMPTY_TAG)
1695                                 {
1696 kumpf          1.37                 XmlReader::getObjectArray(parser, objectWithPathArray);
1697 kumpf          1.10 
1698 kumpf          1.60                 XmlReader::expectEndTag(parser, "IRETURNVALUE");
1699                                 }
1700                             }
1701 mike           1.2      }
1702 kumpf          1.60 
1703 r.kieninger    1.91     CIMExecQueryResponseMessage* msg;
1704                     
1705                         msg = new CIMExecQueryResponseMessage(
1706 kumpf          1.60         messageId,
1707                             cimException,
1708 r.kieninger    1.91         QueueIdStack());
1709                     
1710                         msg->getResponseData().setCIMObjects(objectWithPathArray);
1711                     
1712                         return msg;
1713 mike           1.2  }
1714                     
1715 kumpf          1.76 CIMInvokeMethodResponseMessage*
1716                         CIMOperationResponseDecoder::_decodeInvokeMethodResponse(
1717                             XmlParser& parser,
1718                             const String& messageId,
1719                             const String& methodName,
1720                             Boolean isEmptyMethodresponseTag)
1721 mike           1.2  {
1722 kumpf          1.12     CIMException cimException;
1723 mike           1.2  
1724 kumpf          1.5      CIMParamValue paramValue;
1725                         Array<CIMParamValue> outParameters;
1726 kumpf          1.6      CIMValue returnValue;
1727 mike           1.2  
1728 kumpf          1.60     if (!isEmptyMethodresponseTag)
1729 mike           1.2      {
1730 kumpf          1.60         if (XmlReader::getErrorElement(parser, cimException))
1731                             {
1732 kumpf          1.76             return new CIMInvokeMethodResponseMessage(
1733 kumpf          1.60                 messageId,
1734                                     cimException,
1735                                     QueueIdStack(),
1736                                     returnValue,
1737                                     outParameters,
1738 kumpf          1.76                 methodName);
1739 kumpf          1.60         }
1740                     
1741 kumpf          1.4          Boolean isReturnValue = false;
1742                             Boolean isParamValue = false;
1743                             Boolean gotReturnValue = false;
1744                     
1745                             while ((isReturnValue =
1746 kumpf          1.6                      XmlReader::getReturnValueElement(parser, returnValue)) ||
1747 kumpf          1.5                 (isParamValue =
1748 kumpf          1.60                     XmlReader::getParamValueElement(parser, paramValue)))
1749 kumpf          1.4          {
1750                                 if (isReturnValue)
1751                                 {
1752                                     if (gotReturnValue)
1753                                     {
1754 kumpf          1.76                     MessageLoaderParms mlParms(
1755                                             "Client.CIMOperationResponseDecoder."
1756                                                 "EXPECTED_RETURNVALUE_ELEMENT",
1757 kumpf          1.60                         "unexpected RETURNVALUE element");
1758                                         throw XmlValidationError(parser.getLine(), mlParms);
1759 kumpf          1.4                  }
1760                                     gotReturnValue = true;
1761                                 }
1762                                 else    // isParamValue == true
1763                                 {
1764 kumpf          1.60                 outParameters.append(paramValue);
1765 kumpf          1.4              }
1766                     
1767                                 isReturnValue = false;
1768                                 isParamValue = false;
1769                             }
1770 kumpf          1.60     }
1771 kumpf          1.4  
1772 kumpf          1.76     return new CIMInvokeMethodResponseMessage(
1773 kumpf          1.60         messageId,
1774                             cimException,
1775                             QueueIdStack(),
1776                             returnValue,
1777                             outParameters,
1778 kumpf          1.76         methodName);
1779 mike           1.2  }
1780                     
1781                     PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2