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

Diff for /pegasus/src/Pegasus/ExportClient/CIMExportResponseDecoder.cpp between version 1.19.6.1 and 1.19.6.2

version 1.19.6.1, 2003/07/29 15:08:29 version 1.19.6.2, 2003/08/13 19:39:51
Line 42 
Line 42 
 #include <Pegasus/Common/Exception.h> #include <Pegasus/Common/Exception.h>
 #include "CIMExportResponseDecoder.h" #include "CIMExportResponseDecoder.h"
  
   // l10n
   #include <Pegasus/Common/MessageLoader.h>
   
 PEGASUS_USING_STD; PEGASUS_USING_STD;
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
Line 107 
Line 110 
  
    if (httpMessage->message.size() == 0)    if (httpMessage->message.size() == 0)
    {    {
   
        // l10n
   
        // CIMClientMalformedHTTPException* malformedHTTPException =
        // new CIMClientMalformedHTTPException("Empty HTTP response message.");
   
        MessageLoaderParms mlParms("ExportClient.CIMExportResponseDecoder.EMPTY_RESPONSE", "Empty HTTP response message.");
        String mlString(MessageLoader::getMessage(mlParms));
   
         CIMClientMalformedHTTPException* malformedHTTPException =         CIMClientMalformedHTTPException* malformedHTTPException =
             new CIMClientMalformedHTTPException("Empty HTTP response message.")         new CIMClientMalformedHTTPException(mlString);
 ;  
         ClientExceptionMessage * response =         ClientExceptionMessage * response =
             new ClientExceptionMessage(malformedHTTPException);             new ClientExceptionMessage(malformedHTTPException);
  
Line 131 
Line 143 
         startLine, httpVersion, statusCode, reasonPhrase);         startLine, httpVersion, statusCode, reasonPhrase);
     if (!parsableMessage)     if (!parsableMessage)
     {     {
   
         // l10n
   
         // CIMClientMalformedHTTPException* malformedHTTPException = new
         //   CIMClientMalformedHTTPException("Malformed HTTP response message.");
   
         MessageLoaderParms mlParms("ExportClient.CIMExportResponseDecoder.MALFORMED_RESPONSE", "Malformed HTTP response message.");
         String mlString(MessageLoader::getMessage(mlParms));
   
         CIMClientMalformedHTTPException* malformedHTTPException = new         CIMClientMalformedHTTPException* malformedHTTPException = new
             CIMClientMalformedHTTPException("Malformed HTTP response message.")           CIMClientMalformedHTTPException(mlString);
 ;  
         ClientExceptionMessage * response =         ClientExceptionMessage * response =
             new ClientExceptionMessage(malformedHTTPException);             new ClientExceptionMessage(malformedHTTPException);
  
Line 185 
Line 206 
          // ATTN-SF-P3-20030115: Need to create a specific exception          // ATTN-SF-P3-20030115: Need to create a specific exception
          // to indicate Authentication failure. See JAGae53944.          // to indicate Authentication failure. See JAGae53944.
  
          const String ERROR_MESSAGE = "Authentication failed.";        // l10n
         // const String ERROR_MESSAGE = "Authentication failed.";
   
         MessageLoaderParms mlParms("ExportClient.CIMExportResponseDecoder.AUTHENTICATION_FAILED", "Authentication failed.");
         String ERROR_MESSAGE(MessageLoader::getMessage(mlParms));
   
          CannotConnectException* cannotConnectException =          CannotConnectException* cannotConnectException =
             new CannotConnectException(ERROR_MESSAGE);             new CannotConnectException(ERROR_MESSAGE);
          ClientExceptionMessage * response =          ClientExceptionMessage * response =
Line 235 
Line 261 
    if (!HTTPMessage::lookupHeader(    if (!HTTPMessage::lookupHeader(
           headers, "CIMExport", cimOperation, true))           headers, "CIMExport", cimOperation, true))
    {    {
   
        // l10n
   
        // CIMClientMalformedHTTPException* malformedHTTPException = new
        //    CIMClientMalformedHTTPException("Missing CIMOperation HTTP header");
   
         MessageLoaderParms mlParms("ExportClient.CIMExportResponseDecoder.MISSING_CIMOP_HEADER", "Missing $0 HTTP header", "CIMOperation");
         String mlString(MessageLoader::getMessage(mlParms));
   
       CIMClientMalformedHTTPException* malformedHTTPException = new       CIMClientMalformedHTTPException* malformedHTTPException = new
             CIMClientMalformedHTTPException("Missing CIMOperation HTTP header")           CIMClientMalformedHTTPException(mlString);
 ;  
           ClientExceptionMessage * response =
               new ClientExceptionMessage(malformedHTTPException);
   
           _outputQueue->enqueue(response);
         return;
      }
   
      //
      // Search for "Content-Type" header:
      //
   
      String cimContentType;
   
      if (!HTTPMessage::lookupHeader(
             headers, "Content-Type", cimContentType, true))
      {
         CIMClientMalformedHTTPException* malformedHTTPException = new
               CIMClientMalformedHTTPException("Missing CIMContentType HTTP header");
         ClientExceptionMessage * response =         ClientExceptionMessage * response =
             new ClientExceptionMessage(malformedHTTPException);             new ClientExceptionMessage(malformedHTTPException);
  
Line 245 
Line 298 
       return;       return;
    }    }
  
   
    //    //
    // Zero-terminate the message:    // Zero-terminate the message:
    //    //
Line 264 
Line 318 
  
    if (!String::equalNoCase(cimOperation, "MethodResponse"))    if (!String::equalNoCase(cimOperation, "MethodResponse"))
    {    {
   
        // l10n
   
        // CIMClientMalformedHTTPException* malformedHTTPException =
        //    new CIMClientMalformedHTTPException(
        //         String("Received CIMOperation HTTP header value \"") +
        //         cimOperation + "\", expected \"MethodResponse\"");
   
         MessageLoaderParms mlParms("ExportClient.CIMExportResponseDecoder.EXPECTED_METHODRESPONSE", "Received $0 HTTP header value \"$1\", expected \"$2\"", "CIMOperation", cimOperation, "MethodResponse");
         String mlString(MessageLoader::getMessage(mlParms));
   
       CIMClientMalformedHTTPException* malformedHTTPException =       CIMClientMalformedHTTPException* malformedHTTPException =
             new CIMClientMalformedHTTPException(          new CIMClientMalformedHTTPException(mlString);
                 String("Received CIMOperation HTTP header value \"") +  
                 cimOperation + "\", expected \"MethodResponse\"");  
       ClientExceptionMessage * response =       ClientExceptionMessage * response =
           new ClientExceptionMessage(malformedHTTPException);           new ClientExceptionMessage(malformedHTTPException);
  
Line 316 
Line 380 
       String messageId;       String messageId;
       String protocolVersion;       String protocolVersion;
  
       if (!XmlReader::getMessageStartTag(parser, messageId, protocolVersion))        if (!XmlReader::getMessageStartTag(parser, messageId, protocolVersion)) {
          throw XmlValidationError(  
             parser.getLine(), "expected MESSAGE element");          // l10n
   
           // throw XmlValidationError(
           // parser.getLine(), "expected MESSAGE element");
   
           MessageLoaderParms mlParms("ExportClient.CIMExportResponseDecoder.EXPECTED_ELEMENT", "expected $0 element", "MESSAGE");
           String mlString(MessageLoader::getMessage(mlParms));
   
           throw XmlValidationError(parser.getLine(), mlString);
   
         }
  
       if (!String::equalNoCase(protocolVersion, "1.0"))       if (!String::equalNoCase(protocolVersion, "1.0"))
       {       {
   
           // l10n
   
           // CIMClientResponseException* responseException =
           //     new CIMClientResponseException(
           //          String("Received unsupported protocol version \"") +
           //          protocolVersion + "\", expected \"1.0\"");
   
           MessageLoaderParms mlParms("ExportClient.CIMExportResponseDecoder.UNSUPPORTED_PROTOCOL", "Received unsupported protocol version \"$0\", expected \"1.0\"", protocolVersion);
           String mlString(MessageLoader::getMessage(mlParms));
   
          CIMClientResponseException* responseException =          CIMClientResponseException* responseException =
                 new CIMClientResponseException(            new CIMClientResponseException(mlString);
                     String("Received unsupported protocol version \"") +  
                     protocolVersion + "\", expected \"1.0\"");  
          ClientExceptionMessage * response =          ClientExceptionMessage * response =
                 new ClientExceptionMessage(responseException);                 new ClientExceptionMessage(responseException);
  
Line 352 
Line 436 
           else           else
           {           {
                 // Unrecognized IMethodResponse name attribute                 // Unrecognized IMethodResponse name attribute
                 throw XmlValidationError(parser.getLine(),  
                     String("Unrecognized IMethodResponse name \"") +              // l10n
                         iMethodResponseName + "\"");  
               // throw XmlValidationError(parser.getLine(),
               //   String("Unrecognized IMethodResponse name \"") +
               //          iMethodResponseName + "\"");
   
               MessageLoaderParms mlParms("ExportClient.CIMExportResponseDecoder.UNRECOGNIZED_IMETH", "Unrecognized $0 name \"$1\"", "IMethodResponse", iMethodResponseName);
               String mlString(MessageLoader::getMessage(mlParms));
   
               throw XmlValidationError(parser.getLine(), mlString);
            }            }
  
             //             //
Line 365 
Line 457 
         }         }
         else         else
         {         {
             throw XmlValidationError(parser.getLine(),  
                 "expected METHODRESPONSE or IMETHODRESPONSE element");            // l10n
   
             // throw XmlValidationError(parser.getLine(),
             //   "expected METHODRESPONSE or IMETHODRESPONSE element");
   
             MessageLoaderParms mlParms("ExportClient.CIMExportResponseDecoder.EXPECTED_ELEMENT_OR", "expected $0 or $1 element", "METHODRESPONSE", "IMETHODRESPONSE");
             String mlString(MessageLoader::getMessage(mlParms));
   
             throw XmlValidationError(parser.getLine(), mlString);
         }         }
  
         //         //


Legend:
Removed from v.1.19.6.1  
changed lines
  Added in v.1.19.6.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2