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

Diff for /pegasus/src/Pegasus/Common/XmlWriter.cpp between version 1.57 and 1.98

version 1.57, 2002/05/15 20:04:10 version 1.98, 2003/10/16 23:26:05
Line 1 
Line 1 
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001 BMC Software, Hewlett-Packard Company, IBM,  // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
 // The Open Group, Tivoli Systems // The Open Group, Tivoli Systems
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
Line 26 
Line 26 
 // Modified By: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com) // Modified By: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
 //              Nag Boranna, Hewlett-Packard Company (nagaraja_boranna@hp.com) //              Nag Boranna, Hewlett-Packard Company (nagaraja_boranna@hp.com)
 //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
   //              Carol Ann Krug Graves, Hewlett-Packard Company
   //                  (carolann_graves@hp.com)
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 55 
Line 57 
 #include "XmlParser.h" #include "XmlParser.h"
 #include "Tracer.h" #include "Tracer.h"
 #include <Pegasus/Common/StatisticalData.h> #include <Pegasus/Common/StatisticalData.h>
   #include "CommonUTF.h"
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 70 
Line 73 
     return out;     return out;
 } }
  
 Array<Sint8>& operator<<(Array<Sint8>& out, Char16 x)  Array<Sint8>& operator<<(Array<Sint8>& out, const Char16& x)
 { {
     XmlWriter::append(out, x);     XmlWriter::append(out, x);
     return out;     return out;
Line 100 
Line 103 
     return out;     return out;
 } }
  
 inline void _appendChar(Array<Sint8>& out, Char16 c)  Array<Sint8>& operator<<(Array<Sint8>& out, const CIMName& name)
 { {
     out.append(Sint8(c));      XmlWriter::append(out, name.getString ());
       return out;
   }
   
   
   // l10n
   Array<Sint8>& operator<<(Array<Sint8>& out, const AcceptLanguages& al)
   {
       XmlWriter::append(out, al.toString ());
       return out;
   }
   
   // l10n
   Array<Sint8>& operator<<(Array<Sint8>& out, const ContentLanguages& cl)
   {
       XmlWriter::append(out, cl.toString ());
       return out;
   }
   
   
   PEGASUS_STD(ostream)& operator<<(PEGASUS_STD(ostream)& os, const CIMDateTime& x)
   {
       return os << x.toString();
   }
   
   PEGASUS_STD(ostream)& operator<<(PEGASUS_STD(ostream)& os, const CIMName& name)
   {
       os << name.getString();
       return os;
   }
   
   PEGASUS_STD(ostream)& operator<<(PEGASUS_STD(ostream)& os,
       const CIMNamespaceName& name)
   {
       os << name.getString();
       return os;
 } }
  
 inline void _appendSpecialChar(Array<Sint8>& out, Char16 c)  static inline void _appendChar(Array<Sint8>& out, const Char16& c)
   {
       // We need to convert the Char16 to UTF8 then append the UTF8
       // character into the array.
       // NOTE: The UTF8 character could be several bytes long.
       // WARNING: This function will put in replacement character for
       // all characters that have surogate pairs.
       Uint8 str[6];
       memset(str,0x00,sizeof(str));
       Uint8* charIN = (Uint8 *)&c;
   
       const Uint16 *strsrc = (Uint16 *)charIN;
       Uint16 *endsrc = (Uint16 *)&charIN[1];
   
       Uint8 *strtgt = (Uint8 *)str;
       Uint8 *endtgt = (Uint8 *)&str[5];
   
       UTF16toUTF8(&strsrc,
                   endsrc,
                   &strtgt,
                   endtgt);
   
       out.append((Sint8 *)str,trailingBytesForUTF8[Uint32(str[0])]+1);
   }
   
   static inline void _appendSpecialChar(Array<Sint8>& out, const Char16& c)
   {
       if ( ((c < Char16(0x20)) && (c >= Char16(0x00))) || (c == Char16(0x7f)) )
       {
           char charref[7];
           sprintf(charref, "&#%u;", (Uint16)c);
           out.append(charref, strlen(charref));
       }
       else
       {
           switch (c)
           {
               case '&':
                   out.append("&amp;", 5);
                   break;
   
               case '<':
                   out.append("&lt;", 4);
                   break;
   
               case '>':
                   out.append("&gt;", 4);
                   break;
   
               case '"':
                   out.append("&quot;", 6);
                   break;
   
               case '\'':
                   out.append("&apos;", 6);
                   break;
   
               default:
 { {
     // ATTN-B: Only UTF-8 handled for now.                      // We need to convert the Char16 to UTF8 then append the UTF8
                       // character into the array.
                       // NOTE: The UTF8 character could be several bytes long.
                       // WARNING: This function will put in replacement character for
                       // all characters that have surogate pairs.
                       Uint8 str[6];
                       memset(str,0x00,sizeof(str));
                       Uint8* charIN = (Uint8 *)&c;
   
                       const Uint16 *strsrc = (Uint16 *)charIN;
                       Uint16 *endsrc = (Uint16 *)&charIN[1];
  
                       Uint8 *strtgt = (Uint8 *)str;
                       Uint8 *endtgt = (Uint8 *)&str[5];
   
                       UTF16toUTF8(&strsrc,
                                   endsrc,
                                   &strtgt,
                                   endtgt);
   
                       Uint32 number1 = trailingBytesForUTF8[Uint32(str[0])]+1;
   
                       out.append((Sint8 *)str,number1);
                   }
           }
       }
   }
   
   static inline void _appendSpecialChar(Array<Sint8>& out, char c)
   {
       if ( ((c < Char16(0x20)) && (c >= Char16(0x00))) || (c == Char16(0x7f)) )
       {
           char charref[7];
           sprintf(charref, "&#%u;", (Uint8)c);
           out.append(charref, strlen(charref));
       }
       else
       {
     switch (c)     switch (c)
     {     {
         case '&':         case '&':
Line 135 
Line 266 
             out.append(Sint8(c));             out.append(Sint8(c));
     }     }
 } }
   }
   
  
 static inline void _appendSpecialChar(PEGASUS_STD(ostream)& os, char c) static inline void _appendSpecialChar(PEGASUS_STD(ostream)& os, char c)
 { {
       if ( (c < Char16(0x20)) || (c == Char16(0x7f)) )
       {
           char charref[7];
           sprintf(charref, "&#%u;", (Uint8)c);
           os << charref;
       }
       else
       {
     switch (c)     switch (c)
     {     {
         case '&':         case '&':
Line 164 
Line 305 
             os << c;             os << c;
     }     }
 } }
   }
   
   void _appendSurrogatePair(Array<Sint8>& out, Uint16 high, Uint16 low)
   {
       Uint8 str[6];
       Uint8 charIN[5];
       memset(str,0x00,sizeof(str));
       memcpy(&charIN,&high,2);
       memcpy(&charIN[2],&low,2);
       const Uint16 *strsrc = (Uint16 *)charIN;
       Uint16 *endsrc = (Uint16 *)&charIN[3];
   
       Uint8 *strtgt = (Uint8 *)str;
       Uint8 *endtgt = (Uint8 *)&str[5];
   
       UTF16toUTF8(&strsrc,
                   endsrc,
                   &strtgt,
                   endtgt);
   
       Uint32 number1 = trailingBytesForUTF8[Uint32(str[0])]+1;
       out.append((Sint8 *)str,number1);
   }
  
 static inline void _appendSpecial(PEGASUS_STD(ostream)& os, const char* str) static inline void _appendSpecial(PEGASUS_STD(ostream)& os, const char* str)
 { {
Line 171 
Line 335 
         _appendSpecialChar(os, *str++);         _appendSpecialChar(os, *str++);
 } }
  
 void XmlWriter::append(Array<Sint8>& out, Char16 x)  void XmlWriter::append(Array<Sint8>& out, const Char16& x)
 { {
     _appendChar(out, x);     _appendChar(out, x);
 } }
Line 198 
Line 362 
 void XmlWriter::append(Array<Sint8>& out, Uint64 x) void XmlWriter::append(Array<Sint8>& out, Uint64 x)
 { {
     char buffer[32];  // Should need 21 chars max     char buffer[32];  // Should need 21 chars max
     // I know I shouldn't put platform flags here, but the other way is too hard      sprintf(buffer, "%" PEGASUS_64BIT_CONVERSION_WIDTH "u", x);
 #if defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC)  
     sprintf(buffer, "%I64u", x);  
 #else  
     sprintf(buffer, "%llu", x);  
 #endif  
     append(out, buffer);     append(out, buffer);
 } }
  
 void XmlWriter::append(Array<Sint8>& out, Sint64 x) void XmlWriter::append(Array<Sint8>& out, Sint64 x)
 { {
     char buffer[32];  // Should need 21 chars max     char buffer[32];  // Should need 21 chars max
     // I know I shouldn't put platform flags here, but the other way is too hard      sprintf(buffer, "%" PEGASUS_64BIT_CONVERSION_WIDTH "d", x);
 #if defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC)  
     sprintf(buffer, "%I64d", x);  
 #else  
     sprintf(buffer, "%lld", x);  
 #endif  
     append(out, buffer);     append(out, buffer);
 } }
  
Line 235 
Line 389 
  
 void XmlWriter::append(Array<Sint8>& out, const String& str) void XmlWriter::append(Array<Sint8>& out, const String& str)
 { {
     const Char16* tmp = str.getData();      for (Uint32 i = 0; i < str.size(); i++)
       {
           Uint16 c = str[i];
           if(((c >= FIRST_HIGH_SURROGATE) && (c <= LAST_HIGH_SURROGATE)) ||
              ((c >= FIRST_LOW_SURROGATE) && (c <= LAST_LOW_SURROGATE)))
           {
               Char16 highSurrogate = str[i];
               Char16 lowSurrogate = str[++i];
  
     while (*tmp)              _appendSurrogatePair(out, Uint16(highSurrogate),Uint16(lowSurrogate));
         _appendChar(out, *tmp++);          }
           else
           {
               _appendChar(out, str[i]);
           }
       }
 } }
  
 void XmlWriter::append(Array<Sint8>& out, const Indentor& x) void XmlWriter::append(Array<Sint8>& out, const Indentor& x)
Line 247 
Line 413 
         out.append(' ');         out.append(' ');
 } }
  
 void XmlWriter::appendSpecial(Array<Sint8>& out, Char16 x)  void XmlWriter::appendSpecial(Array<Sint8>& out, const Char16& x)
 { {
     _appendSpecialChar(out, x);     _appendSpecialChar(out, x);
 } }
  
 void XmlWriter::appendSpecial(Array<Sint8>& out, char x) void XmlWriter::appendSpecial(Array<Sint8>& out, char x)
 { {
     _appendSpecialChar(out, Char16(x));      _appendSpecialChar(out, x);
 } }
  
 void XmlWriter::appendSpecial(Array<Sint8>& out, const char* str) void XmlWriter::appendSpecial(Array<Sint8>& out, const char* str)
Line 265 
Line 431 
  
 void XmlWriter::appendSpecial(Array<Sint8>& out, const String& str) void XmlWriter::appendSpecial(Array<Sint8>& out, const String& str)
 { {
     const Char16* tmp = str.getData();      for (Uint32 i = 0; i < str.size(); i++)
       {
           Uint16 c = str[i];
   
           if(((c >= FIRST_HIGH_SURROGATE) && (c <= LAST_HIGH_SURROGATE)) ||
              ((c >= FIRST_LOW_SURROGATE) && (c <= LAST_LOW_SURROGATE)))
           {
               Char16 highSurrogate = str[i];
               Char16 lowSurrogate = str[++i];
  
     while (*tmp)              _appendSurrogatePair(out, Uint16(highSurrogate),Uint16(lowSurrogate));
         _appendSpecialChar(out, *tmp++);          }
           else
           {
               _appendSpecialChar(out, str[i]);
           }
       }
   }
   
   // chuck start
   
   // See http://www.ietf.org/rfc/rfc2396.txt section 2
   // Reserved characters = ';' '/' '?' ':' '@' '&' '=' '+' '$' ','
   // Excluded characters:
   //   Control characters = 0x00-0x1f, 0x7f
   //   Space character = 0x20
   //   Delimiters = '<' '>' '#' '%' '"'
   //   Unwise = '{' '}' '|' '\\' '^' '[' ']' '`'
   //
   
   static inline void _encodeURIChar(String& outString, Sint8 char8)
   {
       Uint8 c = (Uint8)char8;
   
   #ifndef PEGASUS_DO_NOT_IMPLEMENT_URI_ENCODING
       if ( ((c <= 0x20) && (c >= 0x00)) ||    // Control characters + space char
            ( (c >= 0x22) && (c <= 0x26) ) ||  // '"' '#' '$' '%' '&'
            (c == 0x2b) ||                     // '+'
            (c == 0x2c) ||                     // ','
            (c == 0x2f) ||                     // '/'
            ( (c >= 0x3a) && (c <= 0x40) ) ||  // ':' ';' '<' '=' '>' '?' '@'
            ( (c >= 0x5b) && (c <= 0x5e) ) ||  // '[' '\\' ']' '^'
            (c == 0x60) ||                     // '`'
            ( (c >= 0x7b) && (c <= 0x7d) ) ||  // '{' '|' '}'
   //       (c == 0x7f) )                      // Control character
            (c >= 0x7f) )                      // Control character or non US-ASCII (UTF-8)
       {
           char hexencoding[4];
   
           sprintf(hexencoding, "%%%X%X", c/16, c%16);
           outString.append(hexencoding);
       }
       else
   #endif
       {
           outString.append((Uint16)c);
       }
   }
   
   String XmlWriter::encodeURICharacters(Array<Sint8> uriString)
   {
       String encodedString;
   
       for (Uint32 i=0; i<uriString.size(); i++)
       {
           _encodeURIChar(encodedString, uriString[i]);
       }
   
       return encodedString;
   }
   
   String XmlWriter::encodeURICharacters(String uriString)
   {
       String encodedString;
   
   /* i18n remove - did not handle surrogate pairs
       for (Uint32 i=0; i<uriString.size(); i++)
       {
           _encodeURIChar(encodedString, uriString[i]);
       }
   */
   
       // See the "CIM Operations over HTTP" spec, section 3.3.2 and
       // 3.3.3, for the treatment of non US-ASCII (UTF-8) chars
   
       // First, convert to UTF-8 (include handling of surrogate pairs)
       Array<Sint8> utf8;
       for (Uint32 i = 0; i < uriString.size(); i++)
       {
           Uint16 c = uriString[i];
   
           if(((c >= FIRST_HIGH_SURROGATE) && (c <= LAST_HIGH_SURROGATE)) ||
              ((c >= FIRST_LOW_SURROGATE) && (c <= LAST_LOW_SURROGATE)))
           {
               Char16 highSurrogate = uriString[i];
               Char16 lowSurrogate = uriString[++i];
   
               _appendSurrogatePair(utf8, Uint16(highSurrogate),Uint16(lowSurrogate));
           }
           else
           {
               _appendChar(utf8, uriString[i]);
           }
       }
   
       // Second, escape the non HTTP-safe chars
       for (Uint32 i=0; i<utf8.size(); i++)
       {
           _encodeURIChar(encodedString, utf8[i]);
       }
   
       return encodedString;
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Line 281 
Line 555 
  
 void XmlWriter::appendLocalNameSpacePathElement( void XmlWriter::appendLocalNameSpacePathElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const String& nameSpace)      const CIMNamespaceName& nameSpace)
 { {
     out << "<LOCALNAMESPACEPATH>\n";     out << "<LOCALNAMESPACEPATH>\n";
  
     char* tmp = nameSpace.allocateCString();      char* nameSpaceCopy = strdup(nameSpace.getString().getCStringUTF8());
   #if defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC) || \
     for (char* p = strtok(tmp, "/"); p; p = strtok(NULL, "/"))      defined(PEGASUS_OS_HPUX) || \
       defined(PEGASUS_OS_LINUX)
       char *last;
       for (const char* p = strtok_r(nameSpaceCopy, "/", &last); p;
            p = strtok_r(NULL, "/", &last))
   #else
       for (const char* p = strtok(nameSpaceCopy, "/"); p; p = strtok(NULL, "/"))
   #endif
     {     {
         out << "<NAMESPACE NAME=\"" << p << "\"/>\n";         out << "<NAMESPACE NAME=\"" << p << "\"/>\n";
     }     }
       free(nameSpaceCopy);
     delete [] tmp;  
  
     out << "</LOCALNAMESPACEPATH>\n";     out << "</LOCALNAMESPACEPATH>\n";
 } }
Line 308 
Line 588 
 void XmlWriter::appendNameSpacePathElement( void XmlWriter::appendNameSpacePathElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const String& host,     const String& host,
     const String& nameSpace)      const CIMNamespaceName& nameSpace)
 { {
     out << "<NAMESPACEPATH>\n";     out << "<NAMESPACEPATH>\n";
     out << "<HOST>" << host << "</HOST>\n";     out << "<HOST>" << host << "</HOST>\n";
Line 328 
Line 608 
  
 void XmlWriter::appendClassNameElement( void XmlWriter::appendClassNameElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const String& className)      const CIMName& className)
 { {
     out << "<CLASSNAME NAME=\"" << className << "\"/>\n";     out << "<CLASSNAME NAME=\"" << className << "\"/>\n";
 } }
Line 345 
Line 625 
  
 void XmlWriter::appendInstanceNameElement( void XmlWriter::appendInstanceNameElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMReference& instanceName)      const CIMObjectPath& instanceName)
 { {
     out << "<INSTANCENAME CLASSNAME=\"" << instanceName.getClassName() << "\">\n";     out << "<INSTANCENAME CLASSNAME=\"" << instanceName.getClassName() << "\">\n";
  
     Array<KeyBinding> keyBindings = instanceName.getKeyBindings();      Array<CIMKeyBinding> keyBindings = instanceName.getKeyBindings();
     for (Uint32 i = 0, n = keyBindings.size(); i < n; i++)     for (Uint32 i = 0, n = keyBindings.size(); i < n; i++)
     {     {
         out << "<KEYBINDING NAME=\"" << keyBindings[i].getName() << "\">\n";         out << "<KEYBINDING NAME=\"" << keyBindings[i].getName() << "\">\n";
  
         if (keyBindings[i].getType() == KeyBinding::REFERENCE)          if (keyBindings[i].getType() == CIMKeyBinding::REFERENCE)
         {         {
             CIMReference ref = keyBindings[i].getValue();              CIMObjectPath ref = keyBindings[i].getValue();
             appendValueReferenceElement(out, ref, true);             appendValueReferenceElement(out, ref, true);
         }         }
         else {         else {
             out << "<KEYVALUE VALUETYPE=\"";             out << "<KEYVALUE VALUETYPE=\"";
             out << KeyBinding::typeToString(keyBindings[i].getType());              out << keyBindingTypeToString(keyBindings[i].getType());
             out << "\">";             out << "\">";
  
             // fixed the special character problem - Markus             // fixed the special character problem - Markus
Line 384 
Line 664 
  
 void XmlWriter::appendClassPathElement( void XmlWriter::appendClassPathElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMReference& classPath)      const CIMObjectPath& classPath)
 { {
     out << "<CLASSPATH>\n";     out << "<CLASSPATH>\n";
     appendNameSpacePathElement(out,     appendNameSpacePathElement(out,
Line 404 
Line 684 
  
 void XmlWriter::appendInstancePathElement( void XmlWriter::appendInstancePathElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMReference& instancePath)      const CIMObjectPath& instancePath)
 { {
     out << "<INSTANCEPATH>\n";     out << "<INSTANCEPATH>\n";
     appendNameSpacePathElement(out,     appendNameSpacePathElement(out,
Line 424 
Line 704 
  
 void XmlWriter::appendLocalClassPathElement( void XmlWriter::appendLocalClassPathElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMReference& classPath)      const CIMObjectPath& classPath)
 { {
     out << "<LOCALCLASSPATH>\n";     out << "<LOCALCLASSPATH>\n";
     appendLocalNameSpacePathElement(out, classPath.getNameSpace());     appendLocalNameSpacePathElement(out, classPath.getNameSpace());
Line 442 
Line 722 
  
 void XmlWriter::appendLocalInstancePathElement( void XmlWriter::appendLocalInstancePathElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMReference& instancePath)      const CIMObjectPath& instancePath)
 { {
     out << "<LOCALINSTANCEPATH>\n";     out << "<LOCALINSTANCEPATH>\n";
     appendLocalNameSpacePathElement(out, instancePath.getNameSpace());     appendLocalNameSpacePathElement(out, instancePath.getNameSpace());
Line 461 
Line 741 
  
 void XmlWriter::appendLocalObjectPathElement( void XmlWriter::appendLocalObjectPathElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMReference& objectPath)      const CIMObjectPath& objectPath)
 { {
     if (objectPath.isInstanceName())      //
       //  ATTN-CAKG-P2-20020726:  The following condition does not correctly
       //  distinguish instanceNames from classNames in every case
       //  The instanceName of a singleton instance of a keyless class has no
       //  key bindings
       //
       if (objectPath.getKeyBindings ().size () != 0)
     {     {
         appendLocalInstancePathElement(out, objectPath);         appendLocalInstancePathElement(out, objectPath);
     }     }
Line 479 
Line 765 
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 inline void _appendValue(Array<Sint8>& out, Boolean x)  static inline void _appendValue(Array<Sint8>& out, Boolean x)
 { {
     XmlWriter::append(out, x);     XmlWriter::append(out, x);
 } }
  
 inline void _appendValue(Array<Sint8>& out, Uint8 x)  static inline void _appendValue(Array<Sint8>& out, Uint8 x)
 { {
     XmlWriter::append(out, Uint32(x));     XmlWriter::append(out, Uint32(x));
 } }
  
 inline void _appendValue(Array<Sint8>& out, Sint8 x)  static inline void _appendValue(Array<Sint8>& out, Sint8 x)
 { {
     XmlWriter::append(out, Sint32(x));     XmlWriter::append(out, Sint32(x));
 } }
  
 inline void _appendValue(Array<Sint8>& out, Uint16 x)  static inline void _appendValue(Array<Sint8>& out, Uint16 x)
 { {
     XmlWriter::append(out, Uint32(x));     XmlWriter::append(out, Uint32(x));
 } }
  
 inline void _appendValue(Array<Sint8>& out, Sint16 x)  static inline void _appendValue(Array<Sint8>& out, Sint16 x)
 { {
     XmlWriter::append(out, Sint32(x));     XmlWriter::append(out, Sint32(x));
 } }
  
 inline void _appendValue(Array<Sint8>& out, Uint32 x)  static inline void _appendValue(Array<Sint8>& out, Uint32 x)
 { {
     XmlWriter::append(out, x);     XmlWriter::append(out, x);
 } }
  
 inline void _appendValue(Array<Sint8>& out, Sint32 x)  static inline void _appendValue(Array<Sint8>& out, Sint32 x)
 { {
     XmlWriter::append(out, x);     XmlWriter::append(out, x);
 } }
  
 inline void _appendValue(Array<Sint8>& out, Uint64 x)  static inline void _appendValue(Array<Sint8>& out, Uint64 x)
 { {
     XmlWriter::append(out, x);     XmlWriter::append(out, x);
 } }
  
 inline void _appendValue(Array<Sint8>& out, Sint64 x)  static inline void _appendValue(Array<Sint8>& out, Sint64 x)
 { {
     XmlWriter::append(out, x);     XmlWriter::append(out, x);
 } }
  
 inline void _appendValue(Array<Sint8>& out, Real32 x)  static inline void _appendValue(Array<Sint8>& out, Real32 x)
 { {
     XmlWriter::append(out, Real64(x));     XmlWriter::append(out, Real64(x));
 } }
  
 inline void _appendValue(Array<Sint8>& out, Real64 x)  static inline void _appendValue(Array<Sint8>& out, Real64 x)
 { {
     XmlWriter::append(out, x);     XmlWriter::append(out, x);
 } }
  
 inline void _appendValue(Array<Sint8>& out, Char16 x)  static inline void _appendValue(Array<Sint8>& out, const Char16& x)
 { {
     XmlWriter::appendSpecial(out, x);     XmlWriter::appendSpecial(out, x);
 } }
  
 inline void _appendValue(Array<Sint8>& out, const String& x)  static inline void _appendValue(Array<Sint8>& out, const String& x)
 { {
     XmlWriter::appendSpecial(out, x);     XmlWriter::appendSpecial(out, x);
 } }
  
 inline void _appendValue(Array<Sint8>& out, const CIMDateTime& x)  static inline void _appendValue(Array<Sint8>& out, const CIMDateTime& x)
 { {
     out << x.getString();  //ATTN: append() method?      out << x.toString();  //ATTN: append() method?
 } }
  
 inline void _appendValue(Array<Sint8>& out, const CIMReference& x)  static inline void _appendValue(Array<Sint8>& out, const CIMObjectPath& x)
 { {
     XmlWriter::appendValueReferenceElement(out, x, true);     XmlWriter::appendValueReferenceElement(out, x, true);
 } }
  
 void _appendValueArray(Array<Sint8>& out, const CIMReference* p, Uint32 size)  void _appendValueArray(Array<Sint8>& out, const CIMObjectPath* p, Uint32 size)
 { {
     out << "<VALUE.REFARRAY>\n";     out << "<VALUE.REFARRAY>\n";
     while (size--)     while (size--)
Line 604 
Line 890 
     {     {
         switch (value.getType())         switch (value.getType())
         {         {
             case CIMType::BOOLEAN:              case CIMTYPE_BOOLEAN:
             {             {
                 Array<Boolean> a;                 Array<Boolean> a;
                 value.get(a);                 value.get(a);
Line 612 
Line 898 
                 break;                 break;
             }             }
  
             case CIMType::UINT8:              case CIMTYPE_UINT8:
             {             {
                 Array<Uint8> a;                 Array<Uint8> a;
                 value.get(a);                 value.get(a);
Line 620 
Line 906 
                 break;                 break;
             }             }
  
             case CIMType::SINT8:              case CIMTYPE_SINT8:
             {             {
                 Array<Sint8> a;                 Array<Sint8> a;
                 value.get(a);                 value.get(a);
Line 628 
Line 914 
                 break;                 break;
             }             }
  
             case CIMType::UINT16:              case CIMTYPE_UINT16:
             {             {
                 Array<Uint16> a;                 Array<Uint16> a;
                 value.get(a);                 value.get(a);
Line 636 
Line 922 
                 break;                 break;
             }             }
  
             case CIMType::SINT16:              case CIMTYPE_SINT16:
             {             {
                 Array<Sint16> a;                 Array<Sint16> a;
                 value.get(a);                 value.get(a);
Line 644 
Line 930 
                 break;                 break;
             }             }
  
             case CIMType::UINT32:              case CIMTYPE_UINT32:
             {             {
                 Array<Uint32> a;                 Array<Uint32> a;
                 value.get(a);                 value.get(a);
Line 652 
Line 938 
                 break;                 break;
             }             }
  
             case CIMType::SINT32:              case CIMTYPE_SINT32:
             {             {
                 Array<Sint32> a;                 Array<Sint32> a;
                 value.get(a);                 value.get(a);
Line 660 
Line 946 
                 break;                 break;
             }             }
  
             case CIMType::UINT64:              case CIMTYPE_UINT64:
             {             {
                 Array<Uint64> a;                 Array<Uint64> a;
                 value.get(a);                 value.get(a);
Line 668 
Line 954 
                 break;                 break;
             }             }
  
             case CIMType::SINT64:              case CIMTYPE_SINT64:
             {             {
                 Array<Sint64> a;                 Array<Sint64> a;
                 value.get(a);                 value.get(a);
Line 676 
Line 962 
                 break;                 break;
             }             }
  
             case CIMType::REAL32:              case CIMTYPE_REAL32:
             {             {
                 Array<Real32> a;                 Array<Real32> a;
                 value.get(a);                 value.get(a);
Line 684 
Line 970 
                 break;                 break;
             }             }
  
             case CIMType::REAL64:              case CIMTYPE_REAL64:
             {             {
                 Array<Real64> a;                 Array<Real64> a;
                 value.get(a);                 value.get(a);
Line 692 
Line 978 
                 break;                 break;
             }             }
  
             case CIMType::CHAR16:              case CIMTYPE_CHAR16:
             {             {
                 Array<Char16> a;                 Array<Char16> a;
                 value.get(a);                 value.get(a);
Line 700 
Line 986 
                 break;                 break;
             }             }
  
             case CIMType::STRING:              case CIMTYPE_STRING:
             {             {
                 Array<String> a;                 Array<String> a;
                 value.get(a);                 value.get(a);
Line 708 
Line 994 
                 break;                 break;
             }             }
  
             case CIMType::DATETIME:              case CIMTYPE_DATETIME:
             {             {
                 Array<CIMDateTime> a;                 Array<CIMDateTime> a;
                 value.get(a);                 value.get(a);
Line 716 
Line 1002 
                 break;                 break;
             }             }
  
             case CIMType::REFERENCE:              case CIMTYPE_REFERENCE:
             {             {
                 Array<CIMReference> a;                  Array<CIMObjectPath> a;
                 value.get(a);                 value.get(a);
                 _appendValueArray(out, a.getData(), a.size());                 _appendValueArray(out, a.getData(), a.size());
                 break;                 break;
             }             }
  
             default:             default:
                 throw CIMValueInvalidType();                  PEGASUS_ASSERT(false);
         }         }
     }     }
     else if (value.getType() == CIMType::REFERENCE)      else if (value.getType() == CIMTYPE_REFERENCE)
     {     {
         // Has to be separate because it uses VALUE.REFERENCE tag         // Has to be separate because it uses VALUE.REFERENCE tag
         CIMReference v;          CIMObjectPath v;
         value.get(v);         value.get(v);
         _appendValue(out, v);         _appendValue(out, v);
     }     }
Line 741 
Line 1027 
  
         switch (value.getType())         switch (value.getType())
         {         {
             case CIMType::BOOLEAN:              case CIMTYPE_BOOLEAN:
             {             {
                 Boolean v;                 Boolean v;
                 value.get(v);                 value.get(v);
Line 749 
Line 1035 
                 break;                 break;
             }             }
  
             case CIMType::UINT8:              case CIMTYPE_UINT8:
             {             {
                 Uint8 v;                 Uint8 v;
                 value.get(v);                 value.get(v);
Line 757 
Line 1043 
                 break;                 break;
             }             }
  
             case CIMType::SINT8:              case CIMTYPE_SINT8:
             {             {
                 Sint8 v;                 Sint8 v;
                 value.get(v);                 value.get(v);
Line 765 
Line 1051 
                 break;                 break;
             }             }
  
             case CIMType::UINT16:              case CIMTYPE_UINT16:
             {             {
                 Uint16 v;                 Uint16 v;
                 value.get(v);                 value.get(v);
Line 773 
Line 1059 
                 break;                 break;
             }             }
  
             case CIMType::SINT16:              case CIMTYPE_SINT16:
             {             {
                 Sint16 v;                 Sint16 v;
                 value.get(v);                 value.get(v);
Line 781 
Line 1067 
                 break;                 break;
             }             }
  
             case CIMType::UINT32:              case CIMTYPE_UINT32:
             {             {
                 Uint32 v;                 Uint32 v;
                 value.get(v);                 value.get(v);
Line 789 
Line 1075 
                 break;                 break;
             }             }
  
             case CIMType::SINT32:              case CIMTYPE_SINT32:
             {             {
                 Sint32 v;                 Sint32 v;
                 value.get(v);                 value.get(v);
Line 797 
Line 1083 
                 break;                 break;
             }             }
  
             case CIMType::UINT64:              case CIMTYPE_UINT64:
             {             {
                 Uint64 v;                 Uint64 v;
                 value.get(v);                 value.get(v);
Line 805 
Line 1091 
                 break;                 break;
             }             }
  
             case CIMType::SINT64:              case CIMTYPE_SINT64:
             {             {
                 Sint64 v;                 Sint64 v;
                 value.get(v);                 value.get(v);
Line 813 
Line 1099 
                 break;                 break;
             }             }
  
             case CIMType::REAL32:              case CIMTYPE_REAL32:
             {             {
                 Real32 v;                 Real32 v;
                 value.get(v);                 value.get(v);
Line 821 
Line 1107 
                 break;                 break;
             }             }
  
             case CIMType::REAL64:              case CIMTYPE_REAL64:
             {             {
                 Real64 v;                 Real64 v;
                 value.get(v);                 value.get(v);
Line 829 
Line 1115 
                 break;                 break;
             }             }
  
             case CIMType::CHAR16:              case CIMTYPE_CHAR16:
             {             {
                 Char16 v;                 Char16 v;
                 value.get(v);                 value.get(v);
Line 837 
Line 1123 
                 break;                 break;
             }             }
  
             case CIMType::STRING:              case CIMTYPE_STRING:
             {             {
                 String v;                 String v;
                 value.get(v);                 value.get(v);
Line 845 
Line 1131 
                 break;                 break;
             }             }
  
             case CIMType::DATETIME:              case CIMTYPE_DATETIME:
             {             {
                 CIMDateTime v;                 CIMDateTime v;
                 value.get(v);                 value.get(v);
Line 854 
Line 1140 
             }             }
  
             default:             default:
                 throw CIMValueInvalidType();                  PEGASUS_ASSERT(false);
         }         }
  
         out << "</VALUE>\n";         out << "</VALUE>\n";
Line 882 
Line 1168 
  
 void XmlWriter::appendValueObjectWithPathElement( void XmlWriter::appendValueObjectWithPathElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMObjectWithPath& objectWithPath)      const CIMObject& objectWithPath)
 { {
     out << "<VALUE.OBJECTWITHPATH>\n";     out << "<VALUE.OBJECTWITHPATH>\n";
  
     appendValueReferenceElement(out, objectWithPath.getReference(), false);      appendValueReferenceElement(out, objectWithPath.getPath (), false);
     appendObjectElement(out, objectWithPath.getObject());      appendObjectElement(out, objectWithPath);
  
     out << "</VALUE.OBJECTWITHPATH>\n";     out << "</VALUE.OBJECTWITHPATH>\n";
 } }
Line 904 
Line 1190 
  
 void XmlWriter::appendValueReferenceElement( void XmlWriter::appendValueReferenceElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMReference& reference,      const CIMObjectPath& reference,
     Boolean putValueWrapper)     Boolean putValueWrapper)
 { {
     if (putValueWrapper)     if (putValueWrapper)
Line 912 
Line 1198 
  
     // See if it is a class or instance reference (instance references have     // See if it is a class or instance reference (instance references have
     // key-bindings; class references do not).     // key-bindings; class references do not).
       //
       //  ATTN-CAKG-P2-20020726:  The following condition does not correctly
       //  distinguish instanceNames from classNames in every case
       //  The instanceName of a singleton instance of a keyless class has no
       //  key bindings
       //
   
       Array<CIMKeyBinding> kbs = reference.getKeyBindings();
  
     KeyBindingArray kbs = reference.getKeyBindingArray();  
     if (kbs.size())     if (kbs.size())
     {     {
         if (reference.getHost().size())         if (reference.getHost().size())
         {         {
             appendInstancePathElement(out, reference);             appendInstancePathElement(out, reference);
         }         }
         else if (reference.getNameSpace().size())          else if (!reference.getNameSpace().isNull())
         {         {
             appendLocalInstancePathElement(out, reference);             appendLocalInstancePathElement(out, reference);
         }         }
Line 935 
Line 1228 
         {         {
             appendClassPathElement(out, reference);             appendClassPathElement(out, reference);
         }         }
         else if (reference.getNameSpace().size())          else if (!reference.getNameSpace().isNull())
         {         {
             appendLocalClassPathElement(out, reference);             appendLocalClassPathElement(out, reference);
         }         }
Line 950 
Line 1243 
 } }
  
 void XmlWriter::printValueReferenceElement( void XmlWriter::printValueReferenceElement(
     const CIMReference& reference,      const CIMObjectPath& reference,
     PEGASUS_STD(ostream)& os)     PEGASUS_STD(ostream)& os)
 { {
     Array<Sint8> tmp;     Array<Sint8> tmp;
Line 969 
Line 1262 
  
 void XmlWriter::appendValueNamedInstanceElement( void XmlWriter::appendValueNamedInstanceElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMNamedInstance& namedInstance)      const CIMInstance& namedInstance)
 { {
     out << "<VALUE.NAMEDINSTANCE>\n";     out << "<VALUE.NAMEDINSTANCE>\n";
  
     appendInstanceNameElement(out, namedInstance.getInstanceName());      appendInstanceNameElement(out, namedInstance.getPath ());
     appendInstanceElement(out, namedInstance.getInstance());      appendInstanceElement(out, namedInstance);
  
     out << "</VALUE.NAMEDINSTANCE>\n";     out << "</VALUE.NAMEDINSTANCE>\n";
 } }
Line 1050 
Line 1343 
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMConstObject& object)     const CIMConstObject& object)
 { {
     // ATTN-RK-P3-20020515: This could use some work      if (object.isClass())
     try  
     {     {
         CIMConstClass c(object);         CIMConstClass c(object);
         appendClassElement(out, c);         appendClassElement(out, c);
     }     }
     catch (DynamicCastFailed)      else if (object.isInstance())
     {  
         try  
         {         {
             CIMConstInstance i(object);             CIMConstInstance i(object);
             appendInstanceElement(out, i);             appendInstanceElement(out, i);
         }         }
         catch (DynamicCastFailed)      // else PEGASUS_ASSERT(0);
         {  
             PEGASUS_ASSERT(0);  
         }  
     }  
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Line 1298 
Line 1584 
  
 void XmlWriter::appendQualifierFlavorEntity( void XmlWriter::appendQualifierFlavorEntity(
     Array<Sint8>& out,     Array<Sint8>& out,
     Uint32 flavor)      const CIMFlavor & flavor)
 { {
     if (!(flavor & CIMFlavor::OVERRIDABLE))      if (!(flavor.hasFlavor (CIMFlavor::OVERRIDABLE)))
         out << " OVERRIDABLE=\"false\"";         out << " OVERRIDABLE=\"false\"";
  
     if (!(flavor & CIMFlavor::TOSUBCLASS))      if (!(flavor.hasFlavor (CIMFlavor::TOSUBCLASS)))
         out << " TOSUBCLASS=\"false\"";         out << " TOSUBCLASS=\"false\"";
  
     if (flavor & CIMFlavor::TOINSTANCE)      if (flavor.hasFlavor (CIMFlavor::TOINSTANCE))
         out << " TOINSTANCE=\"true\"";         out << " TOINSTANCE=\"true\"";
  
     if (flavor & CIMFlavor::TRANSLATABLE)      if (flavor.hasFlavor (CIMFlavor::TRANSLATABLE))
         out << " TRANSLATABLE=\"true\"";         out << " TRANSLATABLE=\"true\"";
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
   // appendScopeElement()
   //
   //     <!ELEMENT SCOPE EMPTY>
   //     <!ATTLIST SCOPE
   //              CLASS        (true|false)      'false'
   //              ASSOCIATION  (true|false)      'false'
   //              REFERENCE    (true|false)      'false'
   //              PROPERTY     (true|false)      'false'
   //              METHOD       (true|false)      'false'
   //              PARAMETER    (true|false)      'false'
   //              INDICATION   (true|false)      'false'>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendScopeElement(
       Array<Sint8>& out,
       const CIMScope & scope)
   {
       if (!(scope.equal (CIMScope ())))
       {
           out << "<SCOPE";
   
           if (scope.hasScope (CIMScope::CLASS))
               out << " CLASS=\"true\"";
   
           if (scope.hasScope (CIMScope::ASSOCIATION))
               out << " ASSOCIATION=\"true\"";
   
           if (scope.hasScope (CIMScope::REFERENCE))
               out << " REFERENCE=\"true\"";
   
           if (scope.hasScope (CIMScope::PROPERTY))
               out << " PROPERTY=\"true\"";
   
           if (scope.hasScope (CIMScope::METHOD))
               out << " METHOD=\"true\"";
   
           if (scope.hasScope (CIMScope::PARAMETER))
               out << " PARAMETER=\"true\"";
   
           if (scope.hasScope (CIMScope::INDICATION))
               out << " INDICATION=\"true\"";
   
           out << "/>";
       }
   }
   
   // l10n - added content language and accept language support to
   // the header methods below
   
   //------------------------------------------------------------------------------
   //
 // appendMethodCallHeader() // appendMethodCallHeader()
 // //
 //     Build HTTP method call request header. //     Build HTTP method call request header.
Line 1324 
Line 1662 
 void XmlWriter::appendMethodCallHeader( void XmlWriter::appendMethodCallHeader(
     Array<Sint8>& out,     Array<Sint8>& out,
     const char* host,     const char* host,
     const char* cimMethod,      const CIMName& cimMethod,
     const String& cimObject,     const String& cimObject,
     const String& authenticationHeader,     const String& authenticationHeader,
       HttpMethod httpMethod,
       const AcceptLanguages & acceptLanguages,
       const ContentLanguages & contentLanguages,
     Uint32 contentLength)     Uint32 contentLength)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
  
       // ATTN: KS 20020926 - Temporary change to issue only POST. This may
       // be changed in the DMTF CIM Operations standard in the future.
       // If we kept M-Post we would have to retry with Post. Does not
       // do that in client today. Permanent change is to retry until spec
       // updated. This change is temp to finish tests or until the retry
       // installed.  Required because of change to wbemservices cimom
       if (httpMethod == HTTP_METHOD_M_POST)
       {
     out << "M-POST /cimom HTTP/1.1\r\n";     out << "M-POST /cimom HTTP/1.1\r\n";
       }
       else
       {
           out << "POST /cimom HTTP/1.1\r\n";
       }
     out << "HOST: " << host << "\r\n";     out << "HOST: " << host << "\r\n";
     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";
     out << "Content-Length: " << contentLength << "\r\n";     out << "Content-Length: " << contentLength << "\r\n";
       if (acceptLanguages.size() > 0)
       {
           out << "Accept-Language: " << acceptLanguages << "\r\n";
       }
       if (contentLanguages.size() > 0)
       {
           out << "Content-Language: " << contentLanguages << "\r\n";
       }
       if (httpMethod == HTTP_METHOD_M_POST)
       {
     out << "Man: http://www.dmtf.org/cim/mapping/http/v1.0; ns=";     out << "Man: http://www.dmtf.org/cim/mapping/http/v1.0; ns=";
     out << nn <<"\r\n";     out << nn <<"\r\n";
     out << nn << "-CIMOperation: MethodCall\r\n";     out << nn << "-CIMOperation: MethodCall\r\n";
     out << nn << "-CIMMethod: " << cimMethod << "\r\n";          out << nn << "-CIMMethod: "
     out << nn << "-CIMObject: " << cimObject << "\r\n";              << encodeURICharacters(cimMethod.getString()) << "\r\n";
           out << nn << "-CIMObject: " << encodeURICharacters(cimObject) << "\r\n";
       }
       else
       {
           out << "CIMOperation: MethodCall\r\n";
           out << "CIMMethod: " << encodeURICharacters(cimMethod.getString())
               << "\r\n";
           out << "CIMObject: " << encodeURICharacters(cimObject) << "\r\n";
       }
   
     if (authenticationHeader.size())     if (authenticationHeader.size())
     {     {
         out << authenticationHeader << "\r\n";         out << authenticationHeader << "\r\n";
Line 1347 
Line 1721 
     out << "\r\n";     out << "\r\n";
 } }
  
   
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendMethodResponseHeader() // appendMethodResponseHeader()
Line 1357 
Line 1732 
  
 void XmlWriter::appendMethodResponseHeader( void XmlWriter::appendMethodResponseHeader(
     Array<Sint8>& out,     Array<Sint8>& out,
       HttpMethod httpMethod,
       const ContentLanguages & contentLanguages,
     Uint32 contentLength)     Uint32 contentLength)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
Line 1365 
Line 1742 
     STAT_SERVERTIME     STAT_SERVERTIME
     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";
     out << "Content-Length: " << contentLength << "\r\n";     out << "Content-Length: " << contentLength << "\r\n";
       if (contentLanguages.size() > 0)
       {
           out << "Content-Language: " << contentLanguages << "\r\n";
       }
       if (httpMethod == HTTP_METHOD_M_POST)
       {
     out << "Ext:\r\n";     out << "Ext:\r\n";
     out << "Cache-Control: no-cache\r\n";     out << "Cache-Control: no-cache\r\n";
     out << "Man: http://www.dmtf.org/cim/mapping/http/v1.0; ns=";     out << "Man: http://www.dmtf.org/cim/mapping/http/v1.0; ns=";
     out << nn <<"\r\n";     out << nn <<"\r\n";
     out << nn << "-CIMOperation: MethodResponse\r\n\r\n";     out << nn << "-CIMOperation: MethodResponse\r\n\r\n";
 } }
       else
       {
           out << "CIMOperation: MethodResponse\r\n\r\n";
       }
   }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
Line 1402 
Line 1790 
         // ATTN-RK-P3-20020404: It is critical that this text not contain '\n'         // ATTN-RK-P3-20020404: It is critical that this text not contain '\n'
         // ATTN-RK-P3-20020404: Need to encode this value properly.  (See         // ATTN-RK-P3-20020404: Need to encode this value properly.  (See
         // CIM/HTTP Specification section 3.3.2         // CIM/HTTP Specification section 3.3.2
         out << PEGASUS_HTTPHEADERTAG_ERRORDETAIL ": " << errorDetail << "\r\n";          out << PEGASUS_HTTPHEADERTAG_ERRORDETAIL ": "
               << encodeURICharacters(errorDetail) << "\r\n";
     }     }
     out << "\r\n";     out << "\r\n";
 } }
Line 1444 
Line 1833 
 //    out << "</BODY></HTML>\r\n"; //    out << "</BODY></HTML>\r\n";
 } }
  
   #ifdef PEGASUS_KERBEROS_AUTHENTICATION
   //------------------------------------------------------------------------------
   //
   // appendOKResponseHeader()
   //
   //     Build HTTP authentication response header for unauthorized requests.
   //
   //     Returns OK message in the following format:
   //
   //        HTTP/1.1 200 OK
   //        WWW-Authenticate: Negotiate "token"
   //        <HTML><HEAD>
   //        <TITLE>200 OK</TITLE>
   //        </HEAD><BODY BGCOLOR="#99cc99">
   //        <H2>TEST200 OK</H2>
   //        <HR>
   //        </BODY></HTML>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendOKResponseHeader(
       Array<Sint8>& out,
       const String& content)
   {
       out << "HTTP/1.1 " HTTP_STATUS_OK "\r\n";
       out << content << "\r\n";
       out << "\r\n";
   
   //ATTN: We may need to include the following line, so that the browsers
   //      can display the error message.
   //    out << "<HTML><HEAD>\r\n";
   //    out << "<TITLE>" << "200 OK" <<  "</TITLE>\r\n";
   //    out << "</HEAD><BODY BGCOLOR=\"#99cc99\">\r\n";
   //    out << "<H2>TEST" << "200 OK" << "</H2>\r\n";
   //    out << "<HR>\r\n";
   //    out << "</BODY></HTML>\r\n";
   }
   #endif
   
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // _appendMessageElementBegin() // _appendMessageElementBegin()
Line 1505 
Line 1933 
  
 void XmlWriter::_appendMethodCallElementBegin( void XmlWriter::_appendMethodCallElementBegin(
     Array<Sint8>& out,     Array<Sint8>& out,
     const char* name)      const CIMName& name)
 { {
     out << "<METHODCALL NAME=\"" << name << "\">\n";     out << "<METHODCALL NAME=\"" << name << "\">\n";
 } }
Line 1528 
Line 1956 
  
 void XmlWriter::_appendIMethodCallElementBegin( void XmlWriter::_appendIMethodCallElementBegin(
     Array<Sint8>& out,     Array<Sint8>& out,
     const char* name)      const CIMName& name)
 { {
     out << "<IMETHODCALL NAME=\"" << name << "\">\n";     out << "<IMETHODCALL NAME=\"" << name << "\">\n";
 } }
Line 1597 
Line 2025 
  
 void XmlWriter::_appendMethodResponseElementBegin( void XmlWriter::_appendMethodResponseElementBegin(
     Array<Sint8>& out,     Array<Sint8>& out,
     const char* name)      const CIMName& name)
 { {
     out << "<METHODRESPONSE NAME=\"" << name << "\">\n";     out << "<METHODRESPONSE NAME=\"" << name << "\">\n";
 } }
Line 1620 
Line 2048 
  
 void XmlWriter::_appendIMethodResponseElementBegin( void XmlWriter::_appendIMethodResponseElementBegin(
     Array<Sint8>& out,     Array<Sint8>& out,
     const char* name)      const CIMName& name)
 { {
     out << "<IMETHODRESPONSE NAME=\"" << name << "\">\n";     out << "<IMETHODRESPONSE NAME=\"" << name << "\">\n";
 } }
Line 1641 
Line 2069 
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMException& cimException)     const CIMException& cimException)
 { {
     PEG_TRACE_STRING(TRC_XML_WRITER, Tracer::LEVEL2,      Tracer::traceCIMException(TRC_XML_WRITER, Tracer::LEVEL2, cimException);
                      cimException.getTraceDescription());  
  
     out << "<ERROR";     out << "<ERROR";
     out << " CODE=\"" << Uint32(cimException.getCode()) << "\"";     out << " CODE=\"" << Uint32(cimException.getCode()) << "\"";
     String description = cimException.getDescription();      String description = TraceableCIMException(cimException).getDescription();
     if (description != String::EMPTY)     if (description != String::EMPTY)
     {     {
         out << " DESCRIPTION=\"";         out << " DESCRIPTION=\"";
Line 1673 
Line 2100 
     out << "<RETURNVALUE";     out << "<RETURNVALUE";
  
     CIMType type = value.getType();     CIMType type = value.getType();
     if (type != CIMType::NONE)      out << " PARAMTYPE=\"" << cimTypeToString (type) << "\"";
     {  
         out << " PARAMTYPE=\"" << type.toString() << "\"";  
     }  
  
     out << ">\n";     out << ">\n";
  
Line 1778 
Line 2202 
 void XmlWriter::appendClassNameIParameter( void XmlWriter::appendClassNameIParameter(
     Array<Sint8>& out,     Array<Sint8>& out,
     const char* name,     const char* name,
     const String& className)      const CIMName& className)
 { {
     _appendIParamValueElementBegin(out, name);     _appendIParamValueElementBegin(out, name);
   
       //
       //  A NULL (unassigned) value for a parameter is specified by an
       //  <IPARAMVALUE> element with no subelement
       //
       if (!className.isNull ())
       {
     appendClassNameElement(out, className);     appendClassNameElement(out, className);
       }
   
     _appendIParamValueElementEnd(out);     _appendIParamValueElementEnd(out);
 } }
  
Line 1794 
Line 2227 
 void XmlWriter::appendInstanceNameIParameter( void XmlWriter::appendInstanceNameIParameter(
     Array<Sint8>& out,     Array<Sint8>& out,
     const char* name,     const char* name,
     const CIMReference& instanceName)      const CIMObjectPath& instanceName)
 { {
     _appendIParamValueElementBegin(out, name);     _appendIParamValueElementBegin(out, name);
     appendInstanceNameElement(out, instanceName);     appendInstanceNameElement(out, instanceName);
Line 1804 
Line 2237 
 void XmlWriter::appendObjectNameIParameter( void XmlWriter::appendObjectNameIParameter(
     Array<Sint8>& out,     Array<Sint8>& out,
     const char* name,     const char* name,
     const CIMReference& objectName)      const CIMObjectPath& objectName)
 { {
     if (objectName.isClassName())      //
       //  ATTN-CAKG-P2-20020726:  The following condition does not correctly
       //  distinguish instanceNames from classNames in every case
       //  The instanceName of a singleton instance of a keyless class also
       //  has no key bindings
       //
       if (objectName.getKeyBindings ().size () == 0)
     {     {
         XmlWriter::appendClassNameIParameter(         XmlWriter::appendClassNameIParameter(
             out, name, objectName.getClassName());             out, name, objectName.getClassName());
Line 1859 
Line 2298 
 void XmlWriter::appendNamedInstanceIParameter( void XmlWriter::appendNamedInstanceIParameter(
     Array<Sint8>& out,     Array<Sint8>& out,
     const char* name,     const char* name,
     const CIMNamedInstance& namedInstance)      const CIMInstance& namedInstance)
 { {
     _appendIParamValueElementBegin(out, name);     _appendIParamValueElementBegin(out, name);
     appendValueNamedInstanceElement(out, namedInstance);     appendValueNamedInstanceElement(out, namedInstance);
Line 1877 
Line 2316 
 //========================================================== //==========================================================
 void XmlWriter::appendPropertyNameIParameter( void XmlWriter::appendPropertyNameIParameter(
     Array<Sint8>& out,     Array<Sint8>& out,
     const String& propertyName)      const CIMName& propertyName)
 { {
     _appendIParamValueElementBegin(out, "PropertyName");     _appendIParamValueElementBegin(out, "PropertyName");
     out << "<VALUE>" << propertyName << "</VALUE>\n";     out << "<VALUE>" << propertyName << "</VALUE>\n";
Line 1910 
Line 2349 
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMPropertyList& propertyList)     const CIMPropertyList& propertyList)
 { {
     // ATTN: P3 KS 4 Mar 2002 - As check shouldn't we check for null property list  
     _appendIParamValueElementBegin(out, "PropertyList");     _appendIParamValueElementBegin(out, "PropertyList");
  
       //
       //  A NULL (unassigned) value for a parameter is specified by an
       //  <IPARAMVALUE> element with no subelement
       //
       if (!propertyList.isNull ())
       {
     out << "<VALUE.ARRAY>\n";     out << "<VALUE.ARRAY>\n";
     for (Uint32 i = 0; i < propertyList.getNumProperties(); i++)          for (Uint32 i = 0; i < propertyList.size(); i++)
     {     {
         out << "<VALUE>" << propertyList.getPropertyName(i) << "</VALUE>\n";              out << "<VALUE>" << propertyList[i] << "</VALUE>\n";
     }     }
     out << "</VALUE.ARRAY>\n";     out << "</VALUE.ARRAY>\n";
       }
  
     _appendIParamValueElementEnd(out);     _appendIParamValueElementEnd(out);
 } }
Line 1957 
Line 2402 
     return out;     return out;
 } }
  
   // l10n - add content language support to the format methods below
   
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // XmlWriter::formatSimpleMethodReqMessage() // XmlWriter::formatSimpleMethodReqMessage()
Line 1966 
Line 2413 
 // ATTN-RK-P1-20020228: Need to complete copy elimination optimization // ATTN-RK-P1-20020228: Need to complete copy elimination optimization
 Array<Sint8> XmlWriter::formatSimpleMethodReqMessage( Array<Sint8> XmlWriter::formatSimpleMethodReqMessage(
     const char* host,     const char* host,
     const String& nameSpace,      const CIMNamespaceName& nameSpace,
     const CIMReference& path,      const CIMObjectPath& path,
     const char* methodName,      const CIMName& methodName,
     const Array<CIMParamValue>& parameters,     const Array<CIMParamValue>& parameters,
     const String& messageId,     const String& messageId,
     const String& authenticationHeader)      HttpMethod httpMethod,
       const String& authenticationHeader,
       const AcceptLanguages& httpAcceptLanguages,
       const ContentLanguages& httpContentLanguages)
 { {
     Array<Sint8> out;     Array<Sint8> out;
     Array<Sint8> tmp;     Array<Sint8> tmp;
     CIMReference localObjectPath = path;      CIMObjectPath localObjectPath = path;
     localObjectPath.setNameSpace(nameSpace);      localObjectPath.setNameSpace(nameSpace.getString());
       localObjectPath.setHost(String::EMPTY);
  
     _appendMessageElementBegin(out, messageId);     _appendMessageElementBegin(out, messageId);
     _appendSimpleReqElementBegin(out);     _appendSimpleReqElementBegin(out);
Line 1994 
Line 2445 
         tmp,         tmp,
         host,         host,
         methodName,         methodName,
         localObjectPath.toString(false),          localObjectPath.toString(),
         authenticationHeader,         authenticationHeader,
           httpMethod,
           httpAcceptLanguages,
           httpContentLanguages,
         out.size());         out.size());
     tmp << out;     tmp << out;
  
Line 2003 
Line 2457 
 } }
  
 Array<Sint8> XmlWriter::formatSimpleMethodRspMessage( Array<Sint8> XmlWriter::formatSimpleMethodRspMessage(
     const char* methodName,      const CIMName& methodName,
     const String& messageId,     const String& messageId,
       HttpMethod httpMethod,
       const ContentLanguages & httpContentLanguages,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
     Array<Sint8> out;     Array<Sint8> out;
Line 2018 
Line 2474 
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendMethodResponseHeader(tmp, out.size());      appendMethodResponseHeader(tmp,
           httpMethod,
           httpContentLanguages,
           out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2031 
Line 2490 
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 Array<Sint8> XmlWriter::formatSimpleMethodErrorRspMessage( Array<Sint8> XmlWriter::formatSimpleMethodErrorRspMessage(
     const String& methodName,      const CIMName& methodName,
     const String& messageId,     const String& messageId,
       HttpMethod httpMethod,
     const CIMException& cimException)     const CIMException& cimException)
 { {
     ArrayDestroyer<char> tmp1(methodName.allocateCString());  
     Array<Sint8> out;     Array<Sint8> out;
     Array<Sint8> tmp;     Array<Sint8> tmp;
  
     _appendMessageElementBegin(out, messageId);     _appendMessageElementBegin(out, messageId);
     _appendSimpleRspElementBegin(out);     _appendSimpleRspElementBegin(out);
     _appendMethodResponseElementBegin(out, tmp1.getPointer());      _appendMethodResponseElementBegin(out, methodName);
     _appendErrorElement(out, cimException);     _appendErrorElement(out, cimException);
     _appendMethodResponseElementEnd(out);     _appendMethodResponseElementEnd(out);
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendMethodResponseHeader(tmp, out.size());  // l10n
       appendMethodResponseHeader(tmp,
           httpMethod,
           cimException.getContentLanguages(),
           out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2061 
Line 2524 
  
 Array<Sint8> XmlWriter::formatSimpleIMethodReqMessage( Array<Sint8> XmlWriter::formatSimpleIMethodReqMessage(
     const char* host,     const char* host,
     const String& nameSpace,      const CIMNamespaceName& nameSpace,
     const char* iMethodName,      const CIMName& iMethodName,
     const String& messageId,     const String& messageId,
       HttpMethod httpMethod,
     const String& authenticationHeader,     const String& authenticationHeader,
       const AcceptLanguages& httpAcceptLanguages,
       const ContentLanguages& httpContentLanguages,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
     Array<Sint8> out;     Array<Sint8> out;
Line 2073 
Line 2539 
     _appendMessageElementBegin(out, messageId);     _appendMessageElementBegin(out, messageId);
     _appendSimpleReqElementBegin(out);     _appendSimpleReqElementBegin(out);
     _appendIMethodCallElementBegin(out, iMethodName);     _appendIMethodCallElementBegin(out, iMethodName);
     appendLocalNameSpacePathElement(out, nameSpace);      appendLocalNameSpacePathElement(out, nameSpace.getString());
     out << body;     out << body;
     _appendIMethodCallElementEnd(out);     _appendIMethodCallElementEnd(out);
     _appendSimpleReqElementEnd(out);     _appendSimpleReqElementEnd(out);
Line 2083 
Line 2549 
         tmp,         tmp,
         host,         host,
         iMethodName,         iMethodName,
         nameSpace,          nameSpace.getString(),
         authenticationHeader,         authenticationHeader,
           httpMethod,
           httpAcceptLanguages,
           httpContentLanguages,
         out.size());         out.size());
     tmp << out;     tmp << out;
  
Line 2098 
Line 2567 
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 Array<Sint8> XmlWriter::formatSimpleIMethodRspMessage( Array<Sint8> XmlWriter::formatSimpleIMethodRspMessage(
     const char* iMethodName,      const CIMName& iMethodName,
     const String& messageId,     const String& messageId,
       HttpMethod httpMethod,
       const ContentLanguages & httpContentLanguages,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
     Array<Sint8> out;     Array<Sint8> out;
Line 2118 
Line 2589 
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendMethodResponseHeader(tmp, out.size());      appendMethodResponseHeader(tmp,
                    httpMethod,
                    httpContentLanguages,
            out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2131 
Line 2605 
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 Array<Sint8> XmlWriter::formatSimpleIMethodErrorRspMessage( Array<Sint8> XmlWriter::formatSimpleIMethodErrorRspMessage(
     const String& iMethodName,      const CIMName& iMethodName,
     const String& messageId,     const String& messageId,
       HttpMethod httpMethod,
     const CIMException& cimException)     const CIMException& cimException)
 { {
     ArrayDestroyer<char> tmp1(iMethodName.allocateCString());  
     Array<Sint8> out;     Array<Sint8> out;
     Array<Sint8> tmp;     Array<Sint8> tmp;
  
     _appendMessageElementBegin(out, messageId);     _appendMessageElementBegin(out, messageId);
     _appendSimpleRspElementBegin(out);     _appendSimpleRspElementBegin(out);
     _appendIMethodResponseElementBegin(out, tmp1.getPointer());      _appendIMethodResponseElementBegin(out, iMethodName);
     _appendErrorElement(out, cimException);     _appendErrorElement(out, cimException);
     _appendIMethodResponseElementEnd(out);     _appendIMethodResponseElementEnd(out);
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendMethodResponseHeader(tmp, out.size());  // l10n
       appendMethodResponseHeader(tmp,
            httpMethod,
            cimException.getContentLanguages(),
            out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2171 
Line 2649 
     Array<Sint8>& out,     Array<Sint8>& out,
     const char* requestUri,     const char* requestUri,
     const char* host,     const char* host,
     const char* cimMethod,      const CIMName& cimMethod,
       HttpMethod httpMethod,
     const String& authenticationHeader,     const String& authenticationHeader,
       const AcceptLanguages& acceptLanguages,
       const ContentLanguages& contentLanguages,
     Uint32 contentLength)     Uint32 contentLength)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
  
       if (httpMethod == HTTP_METHOD_M_POST)
       {
     out << "M-POST " << requestUri << " HTTP/1.1\r\n";     out << "M-POST " << requestUri << " HTTP/1.1\r\n";
       }
       else
       {
           out << "POST " << requestUri << " HTTP/1.1\r\n";
       }
     out << "HOST: " << host << "\r\n";     out << "HOST: " << host << "\r\n";
     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";
     out << "Content-Length: " << contentLength << "\r\n";     out << "Content-Length: " << contentLength << "\r\n";
       if (acceptLanguages.size() > 0)
       {
           out << "Accept-Language: " << acceptLanguages << "\r\n";
       }
       if (contentLanguages.size() > 0)
       {
           out << "Content-Language: " << contentLanguages << "\r\n";
       }
       if (httpMethod == HTTP_METHOD_M_POST)
       {
     out << "Man: http://www.hp.com; ns=";     out << "Man: http://www.hp.com; ns=";
     out << nn <<"\r\n";     out << nn <<"\r\n";
     out << nn << "-CIMExport: MethodRequest\r\n";     out << nn << "-CIMExport: MethodRequest\r\n";
     out << nn << "-CIMExportMethod: " << cimMethod << "\r\n";     out << nn << "-CIMExportMethod: " << cimMethod << "\r\n";
       }
       else
       {
           out << "CIMExport: MethodRequest\r\n";
           out << "CIMExportMethod: " << cimMethod << "\r\n";
       }
   
     if (authenticationHeader.size())     if (authenticationHeader.size())
     {     {
         out << authenticationHeader << "\r\n";         out << authenticationHeader << "\r\n";
Line 2202 
Line 2707 
  
 void XmlWriter::appendEMethodResponseHeader( void XmlWriter::appendEMethodResponseHeader(
     Array<Sint8>& out,     Array<Sint8>& out,
       HttpMethod httpMethod,
       const ContentLanguages& contentLanguages,
     Uint32 contentLength)     Uint32 contentLength)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
Line 2209 
Line 2716 
     out << "HTTP/1.1 " HTTP_STATUS_OK "\r\n";     out << "HTTP/1.1 " HTTP_STATUS_OK "\r\n";
     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";
     out << "Content-Length: " << contentLength << "\r\n";     out << "Content-Length: " << contentLength << "\r\n";
       if (contentLanguages.size() > 0)
       {
           out << "Content-Language: " << contentLanguages << "\r\n";
       }
       if (httpMethod == HTTP_METHOD_M_POST)
       {
     out << "Ext:\r\n";     out << "Ext:\r\n";
     out << "Cache-Control: no-cache\r\n";     out << "Cache-Control: no-cache\r\n";
     out << "Man: http://www.dmtf.org/cim/mapping/http/v1.0; ns=";     out << "Man: http://www.dmtf.org/cim/mapping/http/v1.0; ns=";
     out << nn <<"\r\n";     out << nn <<"\r\n";
     out << nn << "-CIMExport: MethodResponse\r\n\r\n";     out << nn << "-CIMExport: MethodResponse\r\n\r\n";
 } }
       else
       {
           out << "CIMExport: MethodResponse\r\n\r\n";
       }
   }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
Line 2249 
Line 2767 
  
 void XmlWriter::_appendEMethodCallElementBegin( void XmlWriter::_appendEMethodCallElementBegin(
     Array<Sint8>& out,     Array<Sint8>& out,
     const char* name)      const CIMName& name)
 { {
     out << "<EXPMETHODCALL NAME=\"" << name << "\">\n";     out << "<EXPMETHODCALL NAME=\"" << name << "\">\n";
 } }
Line 2262 
Line 2780 
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
   // _appendEParamValueElementBegin()
   // _appendEParamValueElementEnd()
   //
   //     <!ELEMENT EXPPARAMVALUE (INSTANCE)>
   //     <!ATTLIST EXPPARAMVALUE
   //         %CIMName;>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::_appendEParamValueElementBegin(
       Array<Sint8>& out,
       const char* name)
   {
       out << "<EXPPARAMVALUE NAME=\"" << name << "\">\n";
   }
   
   void XmlWriter::_appendEParamValueElementEnd(
       Array<Sint8>& out)
   {
       out << "</EXPPARAMVALUE>\n";
   }
   
   //------------------------------------------------------------------------------
   //
   // appendInstanceEParameter()
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendInstanceEParameter(
       Array<Sint8>& out,
       const char* name,
       const CIMInstance& instance)
   {
       _appendEParamValueElementBegin(out, name);
       appendInstanceElement(out, instance);
       _appendEParamValueElementEnd(out);
   }
   
   //------------------------------------------------------------------------------
   //
 // _appendSimpleExportRspElementBegin() // _appendSimpleExportRspElementBegin()
 // _appendSimpleExportRspElementEnd() // _appendSimpleExportRspElementEnd()
 // //
Line 2293 
Line 2851 
  
 void XmlWriter::_appendEMethodResponseElementBegin( void XmlWriter::_appendEMethodResponseElementBegin(
     Array<Sint8>& out,     Array<Sint8>& out,
     const char* name)      const CIMName& name)
 { {
     out << "<EXPMETHODRESPONSE NAME=\"" << name << "\">\n";     out << "<EXPMETHODRESPONSE NAME=\"" << name << "\">\n";
 } }
Line 2313 
Line 2871 
 Array<Sint8> XmlWriter::formatSimpleEMethodReqMessage( Array<Sint8> XmlWriter::formatSimpleEMethodReqMessage(
     const char* requestUri,     const char* requestUri,
     const char* host,     const char* host,
     const char* eMethodName,      const CIMName& eMethodName,
     const String& messageId,     const String& messageId,
       HttpMethod httpMethod,
     const String& authenticationHeader,     const String& authenticationHeader,
       const AcceptLanguages& httpAcceptLanguages,
       const ContentLanguages& httpContentLanguages,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
     Array<Sint8> out;     Array<Sint8> out;
Line 2334 
Line 2895 
         requestUri,         requestUri,
         host,         host,
         eMethodName,         eMethodName,
           httpMethod,
         authenticationHeader,         authenticationHeader,
           httpAcceptLanguages,
           httpContentLanguages,
         out.size());         out.size());
     tmp << out;     tmp << out;
  
Line 2348 
Line 2912 
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 Array<Sint8> XmlWriter::formatSimpleEMethodRspMessage( Array<Sint8> XmlWriter::formatSimpleEMethodRspMessage(
     const char* eMethodName,      const CIMName& eMethodName,
     const String& messageId,     const String& messageId,
       HttpMethod httpMethod,
       const ContentLanguages& httpContentLanguages,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
     Array<Sint8> out;     Array<Sint8> out;
Line 2363 
Line 2929 
     _appendSimpleExportRspElementEnd(out);     _appendSimpleExportRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendEMethodResponseHeader(tmp, out.size());      appendEMethodResponseHeader(tmp,
           httpMethod,
           httpContentLanguages,
           out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2376 
Line 2945 
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 Array<Sint8> XmlWriter::formatSimpleEMethodErrorRspMessage( Array<Sint8> XmlWriter::formatSimpleEMethodErrorRspMessage(
     const String& eMethodName,      const CIMName& eMethodName,
     const String& messageId,     const String& messageId,
       HttpMethod httpMethod,
     const CIMException& cimException)     const CIMException& cimException)
 { {
     ArrayDestroyer<char> tmp1(eMethodName.allocateCString());  
     Array<Sint8> out;     Array<Sint8> out;
     Array<Sint8> tmp;     Array<Sint8> tmp;
  
     _appendMessageElementBegin(out, messageId);     _appendMessageElementBegin(out, messageId);
     _appendSimpleExportRspElementBegin(out);     _appendSimpleExportRspElementBegin(out);
     _appendEMethodResponseElementBegin(out, tmp1.getPointer());      _appendEMethodResponseElementBegin(out, eMethodName);
     _appendErrorElement(out, cimException);     _appendErrorElement(out, cimException);
     _appendEMethodResponseElementEnd(out);     _appendEMethodResponseElementEnd(out);
     _appendSimpleExportRspElementEnd(out);     _appendSimpleExportRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendEMethodResponseHeader(tmp, out.size());  // l10n
       appendEMethodResponseHeader(tmp,
            httpMethod,
            cimException.getContentLanguages(),
                    out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2562 
Line 3135 
     return buffer;     return buffer;
 } }
  
   //------------------------------------------------------------------------------
   //
   // XmlWriter::keyBindingTypeToString
   //
   //------------------------------------------------------------------------------
   const char* XmlWriter::keyBindingTypeToString (CIMKeyBinding::Type type)
   {
       switch (type)
       {
           case CIMKeyBinding::BOOLEAN:
               return "boolean";
   
           case CIMKeyBinding::STRING:
               return "string";
   
           case CIMKeyBinding::NUMERIC:
               return "numeric";
   
           case CIMKeyBinding::REFERENCE:
           default:
               PEGASUS_ASSERT(false);
       }
   
       return "unknown";
   }
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.57  
changed lines
  Added in v.1.98

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2