(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.38 and 1.80

version 1.38, 2002/03/28 00:59:04 version 1.80, 2002/09/13 21:40:42
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)
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
   #include <Pegasus/Common/Config.h>
 #include <cstdlib> #include <cstdlib>
 #include <cstdio> #include <cstdio>
   #include "Constants.h"
 #include "Destroyer.h" #include "Destroyer.h"
 #include "CIMClass.h" #include "CIMClass.h"
   #include "CIMClassRep.h"
 #include "CIMInstance.h" #include "CIMInstance.h"
   #include "CIMInstanceRep.h"
   #include "CIMProperty.h"
   #include "CIMPropertyRep.h"
   #include "CIMMethod.h"
   #include "CIMMethodRep.h"
   #include "CIMParameter.h"
   #include "CIMParameterRep.h"
   #include "CIMParamValue.h"
   #include "CIMParamValueRep.h"
   #include "CIMQualifier.h"
   #include "CIMQualifierRep.h"
 #include "CIMQualifierDecl.h" #include "CIMQualifierDecl.h"
   #include "CIMQualifierDeclRep.h"
   #include "CIMValue.h"
 #include "XmlWriter.h" #include "XmlWriter.h"
 #include "XmlParser.h" #include "XmlParser.h"
   #include "Tracer.h"
   #include <Pegasus/Common/StatisticalData.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 52 
Line 72 
     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 82 
Line 102 
     return out;     return out;
 } }
  
 inline void _appendChar(Array<Sint8>& out, Char16 c)  Array<Sint8>& operator<<(Array<Sint8>& out, const CIMName& name)
   {
       XmlWriter::append(out, name.getString ());
       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 _appendChar(Array<Sint8>& out, const Char16& c)
 { {
     out.append(Sint8(c));     out.append(Sint8(c));
 } }
  
 inline void _appendSpecialChar(Array<Sint8>& out, Char16 c)  inline void _appendSpecialChar(Array<Sint8>& out, const Char16& c)
 { {
     // ATTN-B: Only UTF-8 handled for now.     // ATTN-B: Only UTF-8 handled for now.
  
Line 153 
Line 197 
         _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);
 } }
  
   void XmlWriter::append(Array<Sint8>& out, Boolean x)
   {
       append(out, (x ? "TRUE" : "FALSE"));
   }
   
 void XmlWriter::append(Array<Sint8>& out, Uint32 x) void XmlWriter::append(Array<Sint8>& out, Uint32 x)
 { {
     char buffer[32];     char buffer[32];
       sprintf(buffer, "%u", x);
       append(out, buffer);
   }
   
   void XmlWriter::append(Array<Sint8>& out, Sint32 x)
   {
       char buffer[32];
     sprintf(buffer, "%d", x);     sprintf(buffer, "%d", x);
     append(out, buffer);     append(out, buffer);
 } }
  
   void XmlWriter::append(Array<Sint8>& out, Uint64 x)
   {
       char buffer[32];  // Should need 21 chars max
       // I know I shouldn't put platform flags here, but the other way is too hard
   #if defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC)
       sprintf(buffer, "%I64u", x);
   #else
       sprintf(buffer, "%llu", x);
   #endif
       append(out, buffer);
   }
   
   void XmlWriter::append(Array<Sint8>& out, Sint64 x)
   {
       char buffer[32];  // Should need 21 chars max
       // I know I shouldn't put platform flags here, but the other way is too hard
   #if defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC)
       sprintf(buffer, "%I64d", x);
   #else
       sprintf(buffer, "%lld", x);
   #endif
       append(out, buffer);
   }
   
   void XmlWriter::append(Array<Sint8>& out, Real64 x)
   {
       char buffer[128];
       // %e gives '[-]m.dddddde+/-xx', which seems compatible with CIM/XML spec
       sprintf(buffer, "%e", x);
       append(out, buffer);
   }
   
 void XmlWriter::append(Array<Sint8>& out, const char* str) void XmlWriter::append(Array<Sint8>& out, const char* str)
 { {
     while (*str)     while (*str)
Line 173 
Line 261 
  
 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++)
       {
     while (*tmp)          _appendChar(out, str[i]);
         _appendChar(out, *tmp++);      }
 } }
  
 void XmlWriter::append(Array<Sint8>& out, const Indentor& x) void XmlWriter::append(Array<Sint8>& out, const Indentor& x)
Line 185 
Line 273 
         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);
 } }
Line 197 
Line 285 
  
 void XmlWriter::appendSpecial(Array<Sint8>& out, const char* str) void XmlWriter::appendSpecial(Array<Sint8>& out, const char* str)
 { {
     while (*str)      while (*str)
         _appendSpecialChar(out, *str++);          _appendSpecialChar(out, *str++);
   }
   
   void XmlWriter::appendSpecial(Array<Sint8>& out, const String& str)
   {
       for (Uint32 i = 0; i < str.size(); i++)
       {
           _appendSpecialChar(out, str[i]);
       }
   }
   
   //------------------------------------------------------------------------------
   //
   // appendLocalNameSpacePathElement()
   //
   //     <!ELEMENT LOCALNAMESPACEPATH (NAMESPACE+)>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendLocalNameSpacePathElement(
       Array<Sint8>& out,
       const CIMNamespaceName& nameSpace)
   {
       out << "<LOCALNAMESPACEPATH>\n";
   
       char* nameSpaceCopy = strdup(nameSpace.getString().getCString());
       for (const char* p = strtok(nameSpaceCopy, "/"); p; p = strtok(NULL, "/"))
       {
           out << "<NAMESPACE NAME=\"" << p << "\"/>\n";
       }
       delete nameSpaceCopy;
   
       out << "</LOCALNAMESPACEPATH>\n";
   }
   
   //------------------------------------------------------------------------------
   //
   // appendNameSpacePathElement()
   //
   //     <!ELEMENT NAMESPACEPATH (HOST,LOCALNAMESPACEPATH)>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendNameSpacePathElement(
       Array<Sint8>& out,
       const String& host,
       const CIMNamespaceName& nameSpace)
   {
       out << "<NAMESPACEPATH>\n";
       out << "<HOST>" << host << "</HOST>\n";
       appendLocalNameSpacePathElement(out, nameSpace);
       out << "</NAMESPACEPATH>\n";
   }
   
   //------------------------------------------------------------------------------
   //
   // appendClassNameElement()
   //
   //     <!ELEMENT CLASSNAME EMPTY>
   //     <!ATTLIST CLASSNAME
   //              %CIMName;>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendClassNameElement(
       Array<Sint8>& out,
       const CIMName& className)
   {
       out << "<CLASSNAME NAME=\"" << className << "\"/>\n";
   }
   
   //------------------------------------------------------------------------------
   //
   // appendInstanceNameElement()
   //
   //    <!ELEMENT INSTANCENAME (KEYBINDING*|KEYVALUE?|VALUE.REFERENCE?)>
   //    <!ATTLIST INSTANCENAME
   //              %ClassName;>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendInstanceNameElement(
       Array<Sint8>& out,
       const CIMObjectPath& instanceName)
   {
       out << "<INSTANCENAME CLASSNAME=\"" << instanceName.getClassName() << "\">\n";
   
       Array<CIMKeyBinding> keyBindings = instanceName.getKeyBindings();
       for (Uint32 i = 0, n = keyBindings.size(); i < n; i++)
       {
           out << "<KEYBINDING NAME=\"" << keyBindings[i].getName() << "\">\n";
   
           if (keyBindings[i].getType() == CIMKeyBinding::REFERENCE)
           {
               CIMObjectPath ref = keyBindings[i].getValue();
               appendValueReferenceElement(out, ref, true);
           }
           else {
               out << "<KEYVALUE VALUETYPE=\"";
               out << keyBindingTypeToString(keyBindings[i].getType());
               out << "\">";
   
               // fixed the special character problem - Markus
   
               appendSpecial(out, keyBindings[i].getValue());
               out << "</KEYVALUE>\n";
           }
           out << "</KEYBINDING>\n";
       }
       out << "</INSTANCENAME>\n";
   }
   
   //------------------------------------------------------------------------------
   //
   // appendClassPathElement()
   //
   //     <!ELEMENT CLASSPATH (NAMESPACEPATH,CLASSNAME)>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendClassPathElement(
       Array<Sint8>& out,
       const CIMObjectPath& classPath)
   {
       out << "<CLASSPATH>\n";
       appendNameSpacePathElement(out,
                                  classPath.getHost(),
                                  classPath.getNameSpace());
       appendClassNameElement(out, classPath.getClassName());
       out << "</CLASSPATH>\n";
   }
   
   //------------------------------------------------------------------------------
   //
   // appendInstancePathElement()
   //
   //     <!ELEMENT INSTANCEPATH (NAMESPACEPATH,INSTANCENAME)>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendInstancePathElement(
       Array<Sint8>& out,
       const CIMObjectPath& instancePath)
   {
       out << "<INSTANCEPATH>\n";
       appendNameSpacePathElement(out,
                                  instancePath.getHost(),
                                  instancePath.getNameSpace());
       appendInstanceNameElement(out, instancePath);
       out << "</INSTANCEPATH>\n";
   }
   
   //------------------------------------------------------------------------------
   //
   // appendLocalClassPathElement()
   //
   //     <!ELEMENT LOCALCLASSPATH (LOCALNAMESPACEPATH, CLASSNAME)>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendLocalClassPathElement(
       Array<Sint8>& out,
       const CIMObjectPath& classPath)
   {
       out << "<LOCALCLASSPATH>\n";
       appendLocalNameSpacePathElement(out, classPath.getNameSpace());
       appendClassNameElement(out, classPath.getClassName());
       out << "</LOCALCLASSPATH>\n";
   }
   
   //------------------------------------------------------------------------------
   //
   // appendLocalInstancePathElement()
   //
   //     <!ELEMENT LOCALINSTANCEPATH (LOCALNAMESPACEPATH, INSTANCENAME)>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendLocalInstancePathElement(
       Array<Sint8>& out,
       const CIMObjectPath& instancePath)
   {
       out << "<LOCALINSTANCEPATH>\n";
       appendLocalNameSpacePathElement(out, instancePath.getNameSpace());
       appendInstanceNameElement(out, instancePath);
       out << "</LOCALINSTANCEPATH>\n";
   }
   
   //------------------------------------------------------------------------------
   //
   // appendLocalObjectPathElement()
   //
   //     If the reference refers to an instance, write a LOCALINSTANCEPATH;
   //     otherwise write a LOCALCLASSPATH.
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendLocalObjectPathElement(
       Array<Sint8>& out,
       const CIMObjectPath& objectPath)
   {
       //
       //  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);
       }
       else
       {
           appendLocalClassPathElement(out, objectPath);
       }
   }
   
   //------------------------------------------------------------------------------
   //
   // Helper functions for appendValueElement()
   //
   //------------------------------------------------------------------------------
   
   inline void _appendValue(Array<Sint8>& out, Boolean x)
   {
       XmlWriter::append(out, x);
   }
   
   inline void _appendValue(Array<Sint8>& out, Uint8 x)
   {
       XmlWriter::append(out, Uint32(x));
   }
   
   inline void _appendValue(Array<Sint8>& out, Sint8 x)
   {
       XmlWriter::append(out, Sint32(x));
   }
   
   inline void _appendValue(Array<Sint8>& out, Uint16 x)
   {
       XmlWriter::append(out, Uint32(x));
   }
   
   inline void _appendValue(Array<Sint8>& out, Sint16 x)
   {
       XmlWriter::append(out, Sint32(x));
   }
   
   inline void _appendValue(Array<Sint8>& out, Uint32 x)
   {
       XmlWriter::append(out, x);
   }
   
   inline void _appendValue(Array<Sint8>& out, Sint32 x)
   {
       XmlWriter::append(out, x);
   }
   
   inline void _appendValue(Array<Sint8>& out, Uint64 x)
   {
       XmlWriter::append(out, x);
   }
   
   inline void _appendValue(Array<Sint8>& out, Sint64 x)
   {
       XmlWriter::append(out, x);
   }
   
   inline void _appendValue(Array<Sint8>& out, Real32 x)
   {
       XmlWriter::append(out, Real64(x));
   }
   
   inline void _appendValue(Array<Sint8>& out, Real64 x)
   {
       XmlWriter::append(out, x);
   }
   
   inline void _appendValue(Array<Sint8>& out, const Char16& x)
   {
       XmlWriter::appendSpecial(out, x);
   }
   
   inline void _appendValue(Array<Sint8>& out, const String& x)
   {
       XmlWriter::appendSpecial(out, x);
   }
   
   inline void _appendValue(Array<Sint8>& out, const CIMDateTime& x)
   {
       out << x.toString();  //ATTN: append() method?
   }
   
   inline void _appendValue(Array<Sint8>& out, const CIMObjectPath& x)
   {
       XmlWriter::appendValueReferenceElement(out, x, true);
   }
   
   void _appendValueArray(Array<Sint8>& out, const CIMObjectPath* p, Uint32 size)
   {
       out << "<VALUE.REFARRAY>\n";
       while (size--)
       {
           _appendValue(out, *p++);
       }
       out << "</VALUE.REFARRAY>\n";
   }
   
   template<class T>
   void _appendValueArray(Array<Sint8>& out, const T* p, Uint32 size)
   {
       out << "<VALUE.ARRAY>\n";
   
       while (size--)
       {
           out << "<VALUE>";
           _appendValue(out, *p++);
           out << "</VALUE>\n";
       }
   
       out << "</VALUE.ARRAY>\n";
   }
   
   //------------------------------------------------------------------------------
   //
   // appendValueElement()
   //
   //    <!ELEMENT VALUE (#PCDATA)>
   //    <!ELEMENT VALUE.ARRAY (VALUE*)>
   //    <!ELEMENT VALUE.REFERENCE
   //        (CLASSPATH|LOCALCLASSPATH|CLASSNAME|INSTANCEPATH|LOCALINSTANCEPATH|
   //         INSTANCENAME)>
   //    <!ELEMENT VALUE.REFARRAY (VALUE.REFERENCE*)>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendValueElement(
       Array<Sint8>& out,
       const CIMValue& value)
   {
       if (value.isNull())
       {
           return;
       }
       if (value.isArray())
       {
           switch (value.getType())
           {
               case CIMTYPE_BOOLEAN:
               {
                   Array<Boolean> a;
                   value.get(a);
                   _appendValueArray(out, a.getData(), a.size());
                   break;
               }
   
               case CIMTYPE_UINT8:
               {
                   Array<Uint8> a;
                   value.get(a);
                   _appendValueArray(out, a.getData(), a.size());
                   break;
               }
   
               case CIMTYPE_SINT8:
               {
                   Array<Sint8> a;
                   value.get(a);
                   _appendValueArray(out, a.getData(), a.size());
                   break;
               }
   
               case CIMTYPE_UINT16:
               {
                   Array<Uint16> a;
                   value.get(a);
                   _appendValueArray(out, a.getData(), a.size());
                   break;
               }
   
               case CIMTYPE_SINT16:
               {
                   Array<Sint16> a;
                   value.get(a);
                   _appendValueArray(out, a.getData(), a.size());
                   break;
               }
   
               case CIMTYPE_UINT32:
               {
                   Array<Uint32> a;
                   value.get(a);
                   _appendValueArray(out, a.getData(), a.size());
                   break;
               }
   
               case CIMTYPE_SINT32:
               {
                   Array<Sint32> a;
                   value.get(a);
                   _appendValueArray(out, a.getData(), a.size());
                   break;
               }
   
               case CIMTYPE_UINT64:
               {
                   Array<Uint64> a;
                   value.get(a);
                   _appendValueArray(out, a.getData(), a.size());
                   break;
               }
   
               case CIMTYPE_SINT64:
               {
                   Array<Sint64> a;
                   value.get(a);
                   _appendValueArray(out, a.getData(), a.size());
                   break;
               }
   
               case CIMTYPE_REAL32:
               {
                   Array<Real32> a;
                   value.get(a);
                   _appendValueArray(out, a.getData(), a.size());
                   break;
               }
   
               case CIMTYPE_REAL64:
               {
                   Array<Real64> a;
                   value.get(a);
                   _appendValueArray(out, a.getData(), a.size());
                   break;
               }
   
               case CIMTYPE_CHAR16:
               {
                   Array<Char16> a;
                   value.get(a);
                   _appendValueArray(out, a.getData(), a.size());
                   break;
               }
   
               case CIMTYPE_STRING:
               {
                   Array<String> a;
                   value.get(a);
                   _appendValueArray(out, a.getData(), a.size());
                   break;
               }
   
               case CIMTYPE_DATETIME:
               {
                   Array<CIMDateTime> a;
                   value.get(a);
                   _appendValueArray(out, a.getData(), a.size());
                   break;
               }
   
               case CIMTYPE_REFERENCE:
               {
                   Array<CIMObjectPath> a;
                   value.get(a);
                   _appendValueArray(out, a.getData(), a.size());
                   break;
               }
   
               default:
                   PEGASUS_ASSERT(false);
           }
       }
       else if (value.getType() == CIMTYPE_REFERENCE)
       {
           // Has to be separate because it uses VALUE.REFERENCE tag
           CIMObjectPath v;
           value.get(v);
           _appendValue(out, v);
       }
       else
       {
           out << "<VALUE>";
   
           switch (value.getType())
           {
               case CIMTYPE_BOOLEAN:
               {
                   Boolean v;
                   value.get(v);
                   _appendValue(out, v);
                   break;
               }
   
               case CIMTYPE_UINT8:
               {
                   Uint8 v;
                   value.get(v);
                   _appendValue(out, v);
                   break;
               }
   
               case CIMTYPE_SINT8:
               {
                   Sint8 v;
                   value.get(v);
                   _appendValue(out, v);
                   break;
               }
   
               case CIMTYPE_UINT16:
               {
                   Uint16 v;
                   value.get(v);
                   _appendValue(out, v);
                   break;
               }
   
               case CIMTYPE_SINT16:
               {
                   Sint16 v;
                   value.get(v);
                   _appendValue(out, v);
                   break;
               }
   
               case CIMTYPE_UINT32:
               {
                   Uint32 v;
                   value.get(v);
                   _appendValue(out, v);
                   break;
               }
   
               case CIMTYPE_SINT32:
               {
                   Sint32 v;
                   value.get(v);
                   _appendValue(out, v);
                   break;
               }
   
               case CIMTYPE_UINT64:
               {
                   Uint64 v;
                   value.get(v);
                   _appendValue(out, v);
                   break;
               }
   
               case CIMTYPE_SINT64:
               {
                   Sint64 v;
                   value.get(v);
                   _appendValue(out, v);
                   break;
               }
   
               case CIMTYPE_REAL32:
               {
                   Real32 v;
                   value.get(v);
                   _appendValue(out, v);
                   break;
               }
   
               case CIMTYPE_REAL64:
               {
                   Real64 v;
                   value.get(v);
                   _appendValue(out, v);
                   break;
               }
   
               case CIMTYPE_CHAR16:
               {
                   Char16 v;
                   value.get(v);
                   _appendValue(out, v);
                   break;
               }
   
               case CIMTYPE_STRING:
               {
                   String v;
                   value.get(v);
                   _appendValue(out, v);
                   break;
               }
   
               case CIMTYPE_DATETIME:
               {
                   CIMDateTime v;
                   value.get(v);
                   _appendValue(out, v);
                   break;
               }
   
               default:
                   PEGASUS_ASSERT(false);
           }
   
           out << "</VALUE>\n";
       }
   }
   
   void XmlWriter::printValueElement(
       const CIMValue& value,
       PEGASUS_STD(ostream)& os)
   {
       Array<Sint8> tmp;
       appendValueElement(tmp, value);
       tmp.append('\0');
       os << tmp.getData() << PEGASUS_STD(endl);
   }
   
   //------------------------------------------------------------------------------
   //
   // appendValueObjectWithPathElement()
   //
   //     <!ELEMENT VALUE.OBJECTWITHPATH
   //         ((CLASSPATH,CLASS)|(INSTANCEPATH,INSTANCE))>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendValueObjectWithPathElement(
       Array<Sint8>& out,
       const CIMObject& objectWithPath)
   {
       out << "<VALUE.OBJECTWITHPATH>\n";
   
       appendValueReferenceElement(out, objectWithPath.getPath (), false);
       appendObjectElement(out, objectWithPath);
   
       out << "</VALUE.OBJECTWITHPATH>\n";
   }
   
   //------------------------------------------------------------------------------
   //
   // appendValueReferenceElement()
   //
   //    <!ELEMENT VALUE.REFERENCE
   //        (CLASSPATH|LOCALCLASSPATH|CLASSNAME|INSTANCEPATH|LOCALINSTANCEPATH|
   //         INSTANCENAME)>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendValueReferenceElement(
       Array<Sint8>& out,
       const CIMObjectPath& reference,
       Boolean putValueWrapper)
   {
       if (putValueWrapper)
           out << "<VALUE.REFERENCE>\n";
   
       // See if it is a class or instance reference (instance references have
       // 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();
   
       if (kbs.size())
       {
           if (reference.getHost().size())
           {
               appendInstancePathElement(out, reference);
           }
           else if (!reference.getNameSpace().isNull())
           {
               appendLocalInstancePathElement(out, reference);
           }
           else
           {
               appendInstanceNameElement(out, reference);
           }
       }
       else
       {
           if (reference.getHost().size())
           {
               appendClassPathElement(out, reference);
           }
           else if (!reference.getNameSpace().isNull())
           {
               appendLocalClassPathElement(out, reference);
           }
           else
           {
               appendClassNameElement(out, reference.getClassName());
           }
       }
   
       if (putValueWrapper)
           out << "</VALUE.REFERENCE>\n";
   }
   
   void XmlWriter::printValueReferenceElement(
       const CIMObjectPath& reference,
       PEGASUS_STD(ostream)& os)
   {
       Array<Sint8> tmp;
       appendValueReferenceElement(tmp, reference, true);
       tmp.append('\0');
       indentedPrint(os, tmp.getData());
   }
   
   //------------------------------------------------------------------------------
   //
   // appendValueNamedInstanceElement()
   //
   //     <!ELEMENT VALUE.NAMEDINSTANCE (INSTANCENAME,INSTANCE)>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendValueNamedInstanceElement(
       Array<Sint8>& out,
       const CIMInstance& namedInstance)
   {
       out << "<VALUE.NAMEDINSTANCE>\n";
   
       appendInstanceNameElement(out, namedInstance.getPath ());
       appendInstanceElement(out, namedInstance);
   
       out << "</VALUE.NAMEDINSTANCE>\n";
   }
   
   //------------------------------------------------------------------------------
   //
   // appendClassElement()
   //
   //     <!ELEMENT CLASS
   //         (QUALIFIER*,(PROPERTY|PROPERTY.ARRAY|PROPERTY.REFERENCE)*,METHOD*)>
   //     <!ATTLIST CLASS
   //         %CIMName;
   //         %SuperClass;>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendClassElement(
       Array<Sint8>& out,
       const CIMConstClass& cimclass)
   {
       cimclass._checkRep();
       cimclass._rep->toXml(out);
 } }
  
 void XmlWriter::appendSpecial(Array<Sint8>& out, const String& str)  void XmlWriter::printClassElement(
       const CIMConstClass& cimclass,
       PEGASUS_STD(ostream)& os)
 { {
     const Char16* tmp = str.getData();      Array<Sint8> tmp;
       appendClassElement(tmp, cimclass);
     while (*tmp)      tmp.append('\0');
         _appendSpecialChar(out, *tmp++);      indentedPrint(os, tmp.getData(), 4);
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendLocalNameSpacePathElement()  // appendInstanceElement()
 // //
 //     <!ELEMENT LOCALNAMESPACEPATH (NAMESPACE+)>  //     <!ELEMENT INSTANCE
   //         (QUALIFIER*,(PROPERTY|PROPERTY.ARRAY|PROPERTY.REFERENCE)*)>
   //     <!ATTLIST INSTANCE
   //         %ClassName;>
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 void XmlWriter::appendLocalNameSpacePathElement(  void XmlWriter::appendInstanceElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const String& nameSpace)      const CIMConstInstance& instance)
 {  
     out << "<LOCALNAMESPACEPATH>\n";  
   
     char* tmp = nameSpace.allocateCString();  
   
     for (char* p = strtok(tmp, "/"); p; p = strtok(NULL, "/"))  
     {     {
         out << "<NAMESPACE NAME=\"" << p << "\"/>\n";      instance._checkRep();
       instance._rep->toXml(out);
     }     }
  
     delete [] tmp;  void XmlWriter::printInstanceElement(
       const CIMConstInstance& instance,
     out << "</LOCALNAMESPACEPATH>\n";      PEGASUS_STD(ostream)& os)
   {
       Array<Sint8> tmp;
       appendInstanceElement(tmp, instance);
       tmp.append('\0');
       os << tmp.getData() << PEGASUS_STD(endl);
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendNameSpacePathElement()  // appendObjectElement()
 // //
 //     <!ELEMENT NAMESPACEPATH (HOST,LOCALNAMESPACEPATH)>  // May refer to a CLASS or an INSTANCE
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 void XmlWriter::appendNameSpacePathElement(  void XmlWriter::appendObjectElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const String& host,      const CIMConstObject& object)
     const String& nameSpace)  
 { {
     out << "<NAMESPACEPATH>\n";      if (object.isClass())
     out << "<HOST>" << host << "</HOST>\n";      {
     appendLocalNameSpacePathElement(out, nameSpace);          CIMConstClass c(object);
     out << "</NAMESPACEPATH>\n";          appendClassElement(out, c);
       }
       else if (object.isInstance())
       {
           CIMConstInstance i(object);
           appendInstanceElement(out, i);
       }
       // else PEGASUS_ASSERT(0);
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendClassNameElement()  // appendPropertyElement()
 // //
 //     <!ELEMENT CLASSNAME EMPTY>  //     <!ELEMENT PROPERTY (QUALIFIER*,VALUE?)>
 //     <!ATTLIST CLASSNAME  //     <!ATTLIST PROPERTY
 //              %CIMName;>  //              %CIMName;
   //              %CIMType;           #REQUIRED
   //              %ClassOrigin;
   //              %Propagated;>
   //
   //     <!ELEMENT PROPERTY.ARRAY (QUALIFIER*,VALUE.ARRAY?)>
   //     <!ATTLIST PROPERTY.ARRAY
   //              %CIMName;
   //              %CIMType;           #REQUIRED
   //              %ArraySize;
   //              %ClassOrigin;
   //              %Propagated;>
   //
   //     <!ELEMENT PROPERTY.REFERENCE (QUALIFIER*,VALUE.REFERENCE?)>
   //     <!ATTLIST PROPERTY.REFERENCE
   //              %CIMName;
   //              %ReferenceClass;
   //              %ClassOrigin;
   //              %Propagated;>
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 void XmlWriter::appendClassNameElement(  void XmlWriter::appendPropertyElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const String& className)      const CIMConstProperty& property)
 { {
     out << "<CLASSNAME NAME=\"" << className << "\"/>\n";      property._checkRep();
       property._rep->toXml(out);
   }
   
   void XmlWriter::printPropertyElement(
       const CIMConstProperty& property,
       PEGASUS_STD(ostream)& os)
   {
       Array<Sint8> tmp;
       appendPropertyElement(tmp, property);
       tmp.append('\0');
       os << tmp.getData() << PEGASUS_STD(endl);
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendInstanceNameElement()  // appendMethodElement()
 // //
 //    <!ELEMENT INSTANCENAME (KEYBINDING*|KEYVALUE?|VALUE.REFERENCE?)>  //     <!ELEMENT METHOD (QUALIFIER*,
 //    <!ATTLIST INSTANCENAME  //         (PARAMETER|PARAMETER.REFERENCE|PARAMETER.ARRAY|PARAMETER.REFARRAY)*)>
 //              %ClassName;>  //     <!ATTLIST METHOD
   //              %CIMName;
   //              %CIMType;          #IMPLIED
   //              %ClassOrigin;
   //              %Propagated;>
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 void XmlWriter::appendInstanceNameElement(  void XmlWriter::appendMethodElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMReference& instanceName)      const CIMConstMethod& method)
 {  
     out << "<INSTANCENAME CLASSNAME=\"" << instanceName.getClassName() << "\">\n";  
   
     Array<KeyBinding> keyBindings = instanceName.getKeyBindings();  
     for (Uint32 i = 0, n = keyBindings.size(); i < n; i++)  
     {     {
         out << "<KEYBINDING NAME=\"" << keyBindings[i].getName() << "\">\n";      method._checkRep();
       method._rep->toXml(out);
   }
  
         if (keyBindings[i].getType() == KeyBinding::REFERENCE)  void XmlWriter::printMethodElement(
       const CIMConstMethod& method,
       PEGASUS_STD(ostream)& os)
         {         {
             CIMReference ref = keyBindings[i].getValue();      Array<Sint8> tmp;
             ref.toXml(out, true);      appendMethodElement(tmp, method);
       tmp.append('\0');
       os << tmp.getData() << PEGASUS_STD(endl);
         }         }
         else {  
             out << "<KEYVALUE VALUETYPE=\"";  
             out << KeyBinding::typeToString(keyBindings[i].getType());  
             out << "\">";  
  
             // fixed the special character problem - Markus  //------------------------------------------------------------------------------
   //
   // appendParameterElement()
   //
   //     <!ELEMENT PARAMETER (QUALIFIER*)>
   //     <!ATTLIST PARAMETER
   //              %CIMName;
   //              %CIMType;      #REQUIRED>
   //
   //     <!ELEMENT PARAMETER.REFERENCE (QUALIFIER*)>
   //     <!ATTLIST PARAMETER.REFERENCE
   //              %CIMName;
   //              %ReferenceClass;>
   //
   //     <!ELEMENT PARAMETER.ARRAY (QUALIFIER*)>
   //     <!ATTLIST PARAMETER.ARRAY
   //              %CIMName;
   //              %CIMType;           #REQUIRED
   //              %ArraySize;>
   //
   //     <!ELEMENT PARAMETER.REFARRAY (QUALIFIER*)>
   //     <!ATTLIST PARAMETER.REFARRAY
   //              %CIMName;
   //              %ReferenceClass;
   //              %ArraySize;>
   //
   //------------------------------------------------------------------------------
  
             appendSpecial(out, keyBindings[i].getValue());  void XmlWriter::appendParameterElement(
             out << "</KEYVALUE>\n";      Array<Sint8>& out,
         }      const CIMConstParameter& parameter)
         out << "</KEYBINDING>\n";  {
       parameter._checkRep();
       parameter._rep->toXml(out);
     }     }
     out << "</INSTANCENAME>\n";  
   void XmlWriter::printParameterElement(
       const CIMConstParameter& parameter,
       PEGASUS_STD(ostream)& os)
   {
       Array<Sint8> tmp;
       appendParameterElement(tmp, parameter);
       tmp.append('\0');
       os << tmp.getData() << PEGASUS_STD(endl);
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendClassPathElement()  // appendParamValueElement()
 // //
 //     <!ELEMENT CLASSPATH (NAMESPACEPATH,CLASSNAME)>  //     <!ELEMENT PARAMVALUE (VALUE|VALUE.REFERENCE|VALUE.ARRAY|VALUE.REFARRAY)?>
   //     <!ATTLIST PARAMVALUE
   //              %CIMName;>
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 void XmlWriter::appendClassPathElement(  void XmlWriter::appendParamValueElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMReference& classPath)      const CIMParamValue& paramValue)
 { {
     out << "<CLASSPATH>\n";      paramValue._checkRep();
     appendNameSpacePathElement(out,      paramValue._rep->toXml(out);
                                classPath.getHost(),  }
                                classPath.getNameSpace());  
     appendClassNameElement(out, classPath.getClassName());  void XmlWriter::printParamValueElement(
     out << "</CLASSPATH>\n";      const CIMParamValue& paramValue,
       PEGASUS_STD(ostream)& os)
   {
       Array<Sint8> tmp;
       appendParamValueElement(tmp, paramValue);
       tmp.append('\0');
       os << tmp.getData() << PEGASUS_STD(endl);
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendInstancePathElement()  // appendQualifierElement()
 // //
 //     <!ELEMENT INSTANCEPATH (NAMESPACEPATH,INSTANCENAME)>  //     <!ELEMENT QUALIFIER (VALUE|VALUE.ARRAY)>
   //     <!ATTLIST QUALIFIER
   //              %CIMName;
   //              %CIMType;               #REQUIRED
   //              %Propagated;
   //              %QualifierFlavor;>
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 void XmlWriter::appendInstancePathElement(  void XmlWriter::appendQualifierElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMReference& instancePath)      const CIMConstQualifier& qualifier)
 { {
     out << "<INSTANCEPATH>\n";      qualifier._checkRep();
     appendNameSpacePathElement(out,      qualifier._rep->toXml(out);
                                instancePath.getHost(),  }
                                instancePath.getNameSpace());  
     appendInstanceNameElement(out, instancePath);  void XmlWriter::printQualifierElement(
     out << "</INSTANCEPATH>\n";      const CIMConstQualifier& qualifier,
       PEGASUS_STD(ostream)& os)
   {
       Array<Sint8> tmp;
       appendQualifierElement(tmp, qualifier);
       tmp.append('\0');
       os << tmp.getData() << PEGASUS_STD(endl);
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendLocalClassPathElement()  // appendQualifierDeclElement()
 // //
 //     <!ELEMENT LOCALCLASSPATH (LOCALNAMESPACEPATH, CLASSNAME)>  //     <!ELEMENT QUALIFIER.DECLARATION (SCOPE?,(VALUE|VALUE.ARRAY)?)>
   //     <!ATTLIST QUALIFIER.DECLARATION
   //              %CIMName;
   //              %CIMType;                       #REQUIRED
   //              ISARRAY        (true|false)     #IMPLIED
   //              %ArraySize;
   //              %QualifierFlavor;>
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 void XmlWriter::appendLocalClassPathElement(  void XmlWriter::appendQualifierDeclElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMReference& classPath)      const CIMConstQualifierDecl& qualifierDecl)
 { {
     out << "<LOCALCLASSPATH>\n";      qualifierDecl._checkRep();
     appendLocalNameSpacePathElement(out, classPath.getNameSpace());      qualifierDecl._rep->toXml(out);
     appendClassNameElement(out, classPath.getClassName());  }
     out << "</LOCALCLASSPATH>\n";  
   void XmlWriter::printQualifierDeclElement(
       const CIMConstQualifierDecl& qualifierDecl,
       PEGASUS_STD(ostream)& os)
   {
       Array<Sint8> tmp;
       appendQualifierDeclElement(tmp, qualifierDecl);
       tmp.append('\0');
       os << tmp.getData() << PEGASUS_STD(endl);
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendLocalInstancePathElement()  // appendQualifierFlavorEntity()
 // //
 //     <!ELEMENT LOCALINSTANCEPATH (LOCALNAMESPACEPATH, INSTANCENAME)>  //     <!ENTITY % QualifierFlavor "OVERRIDABLE  (true|false)   'true'
   //                                 TOSUBCLASS   (true|false)   'true'
   //                                 TOINSTANCE   (true|false)   'false'
   //                                 TRANSLATABLE (true|false)   'false'">
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 void XmlWriter::appendLocalInstancePathElement(  void XmlWriter::appendQualifierFlavorEntity(
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMReference& instancePath)      const CIMFlavor & flavor)
 { {
     out << "<LOCALINSTANCEPATH>\n";      if (!(flavor.hasFlavor (CIMFlavor::OVERRIDABLE)))
     appendLocalNameSpacePathElement(out, instancePath.getNameSpace());          out << " OVERRIDABLE=\"false\"";
     appendInstanceNameElement(out, instancePath);  
     out << "</LOCALINSTANCEPATH>\n";      if (!(flavor.hasFlavor (CIMFlavor::TOSUBCLASS)))
           out << " TOSUBCLASS=\"false\"";
   
       if (flavor.hasFlavor (CIMFlavor::TOINSTANCE))
           out << " TOINSTANCE=\"true\"";
   
       if (flavor.hasFlavor (CIMFlavor::TRANSLATABLE))
           out << " TRANSLATABLE=\"true\"";
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendLocalObjectPathElement()  // appendScopeElement()
 // //
 //     If the reference refers to an instance, write a LOCALINSTANCEPATH;  //     <!ELEMENT SCOPE EMPTY>
 //     otherwise write a LOCALCLASSPATH.  //     <!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::appendLocalObjectPathElement(  void XmlWriter::appendScopeElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     const CIMReference& objectPath)      const CIMScope & scope)
 { {
     if (objectPath.isInstanceName())      if (!(scope.equal (CIMScope ())))
     {  
         appendLocalInstancePathElement(out, objectPath);  
     }  
     else  
     {     {
         appendLocalClassPathElement(out, objectPath);          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 << "/>";
     }     }
 } }
  
Line 422 
Line 1403 
 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,
     Uint32 contentLength)     Uint32 contentLength)
Line 431 
Line 1412 
  
     out << "M-POST /cimom HTTP/1.1\r\n";     out << "M-POST /cimom HTTP/1.1\r\n";
     out << "HOST: " << host << "\r\n";     out << "HOST: " << host << "\r\n";
     out << "Content-CIMType: 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";
     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";
Line 459 
Line 1440 
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
  
     out << "HTTP/1.1 200 OK\r\n";      out << "HTTP/1.1 " HTTP_STATUS_OK "\r\n";
     out << "Content-CIMType: application/xml; charset=\"utf-8\"\r\n";      STAT_SERVERTIME
       out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";
     out << "Content-Length: " << contentLength << "\r\n";     out << "Content-Length: " << contentLength << "\r\n";
     out << "Ext:\r\n";     out << "Ext:\r\n";
     out << "Cache-Control: no-cache\r\n";     out << "Cache-Control: no-cache\r\n";
Line 471 
Line 1453 
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
   // appendHttpErrorResponseHeader()
   //
   //     Build HTTP error response header.
   //
   //     Returns error response message in the following format:
   //
   //        HTTP/1.1 400 Bad Request       (using specified status code)
   //        CIMError: <error type>         (if specified by caller)
   //        PGErrorDetail: <error text>    (if specified by caller)
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendHttpErrorResponseHeader(
       Array<Sint8>& out,
       const String& status,
       const String& cimError,
       const String& errorDetail)
   {
       out << "HTTP/1.1 " << status << "\r\n";
       if (cimError != String::EMPTY)
       {
           out << "CIMError: " << cimError << "\r\n";
       }
       if (errorDetail != String::EMPTY)
       {
           // ATTN-RK-P3-20020404: It is critical that this text not contain '\n'
           // ATTN-RK-P3-20020404: Need to encode this value properly.  (See
           // CIM/HTTP Specification section 3.3.2
           out << PEGASUS_HTTPHEADERTAG_ERRORDETAIL ": " << errorDetail << "\r\n";
       }
       out << "\r\n";
   }
   
   //------------------------------------------------------------------------------
   //
 // appendUnauthorizedResponseHeader() // appendUnauthorizedResponseHeader()
 // //
 //     Build HTTP authentication response header for unauthorized requests. //     Build HTTP authentication response header for unauthorized requests.
Line 492 
Line 1509 
     Array<Sint8>& out,     Array<Sint8>& out,
     const String& content)     const String& content)
 { {
     out << "HTTP/1.1 401 Unauthorized\r\n";      out << "HTTP/1.1 " HTTP_STATUS_UNAUTHORIZED "\r\n";
     out << content << "\r\n";     out << content << "\r\n";
     out << "\r\n";     out << "\r\n";
  
Line 508 
Line 1525 
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendBadRequestResponseHeader()  
 //  
 //     Build HTTP response header for bad requests.  
 //  
 //     Returns Bad Request message in the following format:  
 //  
 //        HTTP/1.1 400 Bad Request  
 //        CIMError: <error text>    (only if specified by caller)  
 //        <HTML><HEAD>  
 //        <TITLE>400 Bad Request</TITLE>  
 //        </HEAD><BODY BGCOLOR="#99cc99">  
 //        <H2>TEST400 Bad Request</H2>  
 //        <HR>  
 //        </BODY></HTML>  
 //  
 //------------------------------------------------------------------------------  
   
 void XmlWriter::appendBadRequestResponseHeader(  
     Array<Sint8>& out,  
     const String& cimError)  
 {  
     out << "HTTP/1.1 400 Bad Request\r\n";  
     if (cimError != String::EMPTY)  
     {  
         out << "CIMError: " << cimError << "\r\n";  
     }  
     out << "\r\n";  
 }  
   
 //------------------------------------------------------------------------------  
 //  
 // appendNotImplementedResponseHeader()  
 //  
 //     Build HTTP 501 Not Implemented response header  
 //  
 //     Returns Not Implemented message in the following format:  
 //  
 //        HTTP/1.1 501 Not Implemented  
 //        <HTML><HEAD>  
 //        <TITLE>501 Not Implemented</TITLE>  
 //        CIMError: <error text>    (only if specified by caller)  
 //        </HEAD><BODY BGCOLOR="#99cc99">  
 //        <H2>TEST501 Not Implemented</H2>  
 //        <HR>  
 //        </BODY></HTML>  
 //  
 //------------------------------------------------------------------------------  
   
 void XmlWriter::appendNotImplementedResponseHeader(  
     Array<Sint8>& out,  
     const String& cimError)  
 {  
     out << "HTTP/1.1 501 Not Implemented\r\n";  
     if (cimError != String::EMPTY)  
     {  
         out << "CIMError: " << cimError << "\r\n";  
     }  
     out << "\r\n";  
 }  
   
 //------------------------------------------------------------------------------  
 //  
 // _appendMessageElementBegin() // _appendMessageElementBegin()
 // _appendMessageElementEnd() // _appendMessageElementEnd()
 // //
Line 629 
Line 1584 
  
 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 652 
Line 1607 
  
 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 721 
Line 1676 
  
 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 744 
Line 1699 
  
 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 763 
Line 1718 
  
 void XmlWriter::_appendErrorElement( void XmlWriter::_appendErrorElement(
     Array<Sint8>& out,     Array<Sint8>& out,
     CIMStatusCode code,      const CIMException& cimException)
     const char* description)  
 { {
       Tracer::traceCIMException(TRC_XML_WRITER, Tracer::LEVEL2, cimException);
   
     out << "<ERROR";     out << "<ERROR";
     out << " CODE=\"" << Uint32(code) << "\"";      out << " CODE=\"" << Uint32(cimException.getCode()) << "\"";
       String description = TraceableCIMException(cimException).getDescription();
       if (description != String::EMPTY)
       {
     out << " DESCRIPTION=\"";     out << " DESCRIPTION=\"";
     appendSpecial(out, description);     appendSpecial(out, description);
     out << "\"/>";          out << "\"";
       }
       out << "/>";
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Line 790 
Line 1751 
     out << "<RETURNVALUE";     out << "<RETURNVALUE";
  
     CIMType type = value.getType();     CIMType type = value.getType();
     if (type != CIMType::NONE)      out << " PARAMTYPE=\"" << cimTypeToString (type) << "\"";
     {  
         out << " PARAMTYPE=\"" << TypeToString(type) << "\"";  
     }  
  
     out << ">\n";     out << ">\n";
  
     // Add value. If no value is Null, do not put <VALUE> tags on      // Add value.
     value.toXml(out, false);      appendValueElement(out, value);
     out << "</RETURNVALUE>\n";     out << "</RETURNVALUE>\n";
 } }
  
Line 838 
Line 1796 
     Boolean flag)     Boolean flag)
 { {
     _appendIParamValueElementBegin(out, name);     _appendIParamValueElementBegin(out, name);
     out << "<VALUE>" << (flag ? "TRUE" : "FALSE") << "</VALUE>\n";      out << "<VALUE>";
       append(out, flag);
       out << "</VALUE>\n";
     _appendIParamValueElementEnd(out);     _appendIParamValueElementEnd(out);
 } }
  
Line 893 
Line 1853 
 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);
     appendClassNameElement(out, className);     appendClassNameElement(out, className);
Line 909 
Line 1869 
 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 919 
Line 1879 
 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 945 
Line 1911 
     const CIMConstClass& cimClass)     const CIMConstClass& cimClass)
 { {
     _appendIParamValueElementBegin(out, name);     _appendIParamValueElementBegin(out, name);
     cimClass.toXml(out);      appendClassElement(out, cimClass);
     _appendIParamValueElementEnd(out);     _appendIParamValueElementEnd(out);
 } }
  
Line 961 
Line 1927 
     const CIMConstInstance& instance)     const CIMConstInstance& instance)
 { {
     _appendIParamValueElementBegin(out, name);     _appendIParamValueElementBegin(out, name);
     instance.toXml(out);      appendInstanceElement(out, instance);
     _appendIParamValueElementEnd(out);     _appendIParamValueElementEnd(out);
 } }
  
Line 974 
Line 1940 
 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);
     namedInstance.toXml(out);      appendValueNamedInstanceElement(out, namedInstance);
     _appendIParamValueElementEnd(out);     _appendIParamValueElementEnd(out);
 } }
  
Line 992 
Line 1958 
 //========================================================== //==========================================================
 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 1011 
Line 1977 
     const CIMValue& value)     const CIMValue& value)
 { {
     _appendIParamValueElementBegin(out, name);     _appendIParamValueElementBegin(out, name);
     value.toXml(out, false);      appendValueElement(out, value);
     _appendIParamValueElementEnd(out);     _appendIParamValueElementEnd(out);
 } }
  
Line 1029 
Line 1995 
     _appendIParamValueElementBegin(out, "PropertyList");     _appendIParamValueElementBegin(out, "PropertyList");
  
     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";
  
Line 1050 
Line 2016 
     const CIMConstQualifierDecl& qualifierDecl)     const CIMConstQualifierDecl& qualifierDecl)
 { {
     _appendIParamValueElementBegin(out, name);     _appendIParamValueElementBegin(out, name);
     qualifierDecl.toXml(out);      appendQualifierDeclElement(out, qualifierDecl);
     _appendIParamValueElementEnd(out);     _appendIParamValueElementEnd(out);
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
   // XmlWriter::formatHttpErrorRspMessage()
   //
   //------------------------------------------------------------------------------
   
   Array<Sint8> XmlWriter::formatHttpErrorRspMessage(
       const String& status,
       const String& cimError,
       const String& errorDetail)
   {
       Array<Sint8> out;
   
       appendHttpErrorResponseHeader(out, status, cimError, errorDetail);
   
       return out;
   }
   
   //------------------------------------------------------------------------------
   //
 // XmlWriter::formatSimpleMethodReqMessage() // XmlWriter::formatSimpleMethodReqMessage()
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Line 1063 
Line 2047 
 // 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)     const String& authenticationHeader)
 { {
     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 1081 
Line 2066 
     appendLocalObjectPathElement(out, localObjectPath);     appendLocalObjectPathElement(out, localObjectPath);
     for (Uint32 i=0; i < parameters.size(); i++)     for (Uint32 i=0; i < parameters.size(); i++)
     {     {
         parameters[i].toXml(out);          appendParamValueElement(out, parameters[i]);
     }     }
     _appendMethodCallElementEnd(out);     _appendMethodCallElementEnd(out);
     _appendSimpleReqElementEnd(out);     _appendSimpleReqElementEnd(out);
Line 1091 
Line 2076 
         tmp,         tmp,
         host,         host,
         methodName,         methodName,
         path.toString(false),          localObjectPath.toString(),
         authenticationHeader,         authenticationHeader,
         out.size());         out.size());
     tmp << out;     tmp << out;
Line 1100 
Line 2085 
 } }
  
 Array<Sint8> XmlWriter::formatSimpleMethodRspMessage( Array<Sint8> XmlWriter::formatSimpleMethodRspMessage(
     const char* methodName,      const CIMName& methodName,
     const String& messageId,     const String& messageId,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
Line 1128 
Line 2113 
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 Array<Sint8> XmlWriter::formatSimpleMethodErrorRspMessage( Array<Sint8> XmlWriter::formatSimpleMethodErrorRspMessage(
     const String& methodName,      const CIMName& methodName,
     const String& messageId,     const String& messageId,
     CIMStatusCode code,      const CIMException& cimException)
     const String& description)  
 { {
     ArrayDestroyer<char> tmp1(methodName.allocateCString());  
     ArrayDestroyer<char> tmp2(description.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, code, tmp2.getPointer());      _appendErrorElement(out, cimException);
     _appendMethodResponseElementEnd(out);     _appendMethodResponseElementEnd(out);
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
Line 1160 
Line 2142 
  
 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,
     const String& authenticationHeader,     const String& authenticationHeader,
     const Array<Sint8>& body)     const Array<Sint8>& body)
Line 1172 
Line 2154 
     _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 1182 
Line 2164 
         tmp,         tmp,
         host,         host,
         iMethodName,         iMethodName,
         nameSpace,          nameSpace.getString(),
         authenticationHeader,         authenticationHeader,
         out.size());         out.size());
     tmp << out;     tmp << out;
Line 1197 
Line 2179 
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 Array<Sint8> XmlWriter::formatSimpleIMethodRspMessage( Array<Sint8> XmlWriter::formatSimpleIMethodRspMessage(
     const char* iMethodName,      const CIMName& iMethodName,
     const String& messageId,     const String& messageId,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
Line 1207 
Line 2189 
     _appendMessageElementBegin(out, messageId);     _appendMessageElementBegin(out, messageId);
     _appendSimpleRspElementBegin(out);     _appendSimpleRspElementBegin(out);
     _appendIMethodResponseElementBegin(out, iMethodName);     _appendIMethodResponseElementBegin(out, iMethodName);
       if (body.size() != 0)
       {
     _appendIReturnValueElementBegin(out);     _appendIReturnValueElementBegin(out);
     out << body;     out << body;
     _appendIReturnValueElementEnd(out);     _appendIReturnValueElementEnd(out);
       }
     _appendIMethodResponseElementEnd(out);     _appendIMethodResponseElementEnd(out);
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
Line 1227 
Line 2212 
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 Array<Sint8> XmlWriter::formatSimpleIMethodErrorRspMessage( Array<Sint8> XmlWriter::formatSimpleIMethodErrorRspMessage(
     const String& iMethodName,      const CIMName& iMethodName,
     const String& messageId,     const String& messageId,
     CIMStatusCode code,      const CIMException& cimException)
     const String& description)  
 { {
     ArrayDestroyer<char> tmp1(iMethodName.allocateCString());  
     ArrayDestroyer<char> tmp2(description.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, code, tmp2.getPointer());      _appendErrorElement(out, cimException);
     _appendIMethodResponseElementEnd(out);     _appendIMethodResponseElementEnd(out);
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
Line 1267 
Line 2249 
  
 void XmlWriter::appendEMethodRequestHeader( void XmlWriter::appendEMethodRequestHeader(
     Array<Sint8>& out,     Array<Sint8>& out,
       const char* requestUri,
     const char* host,     const char* host,
     const char* cimMethod,      const CIMName& cimMethod,
     const String& authenticationHeader,     const String& authenticationHeader,
     Uint32 contentLength)     Uint32 contentLength)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
  
     out << "M-POST /cimom HTTP/1.1\r\n";      out << "M-POST " << requestUri << " HTTP/1.1\r\n";
     out << "HOST: " << host << "\r\n";     out << "HOST: " << host << "\r\n";
     out << "Content-CIMType: 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";
     out << "Man: http://www.hp.com; ns=";     out << "Man: http://www.hp.com; ns=";
     out << nn <<"\r\n";     out << nn <<"\r\n";
Line 1303 
Line 2286 
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
  
     out << "HTTP/1.1 200 OK\r\n";      out << "HTTP/1.1 " HTTP_STATUS_OK "\r\n";
     out << "Content-CIMType: 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";
     out << "Ext:\r\n";     out << "Ext:\r\n";
     out << "Cache-Control: no-cache\r\n";     out << "Cache-Control: no-cache\r\n";
Line 1346 
Line 2329 
  
 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 1390 
Line 2373 
  
 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 1408 
Line 2391 
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 Array<Sint8> XmlWriter::formatSimpleEMethodReqMessage( Array<Sint8> XmlWriter::formatSimpleEMethodReqMessage(
       const char* requestUri,
     const char* host,     const char* host,
     const char* eMethodName,      const CIMName& eMethodName,
     const String& messageId,     const String& messageId,
     const String& authenticationHeader,     const String& authenticationHeader,
     const Array<Sint8>& body)     const Array<Sint8>& body)
Line 1427 
Line 2411 
  
     appendEMethodRequestHeader(     appendEMethodRequestHeader(
         tmp,         tmp,
           requestUri,
         host,         host,
         eMethodName,         eMethodName,
         authenticationHeader,         authenticationHeader,
         out.size());         out.size());
     tmp << out;     tmp << out;
  
     return out;      return tmp;
 } }
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Line 1443 
Line 2428 
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 Array<Sint8> XmlWriter::formatSimpleEMethodRspMessage( Array<Sint8> XmlWriter::formatSimpleEMethodRspMessage(
     const char* eMethodName,      const CIMName& eMethodName,
     const String& messageId,     const String& messageId,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
Line 1471 
Line 2456 
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 Array<Sint8> XmlWriter::formatSimpleEMethodErrorRspMessage( Array<Sint8> XmlWriter::formatSimpleEMethodErrorRspMessage(
     const String& eMethodName,      const CIMName& eMethodName,
     const String& messageId,     const String& messageId,
     CIMStatusCode code,      const CIMException& cimException)
     const String& description)  
 { {
     ArrayDestroyer<char> tmp1(eMethodName.allocateCString());  
     ArrayDestroyer<char> tmp2(description.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, code, tmp2.getPointer());      _appendErrorElement(out, cimException);
     _appendEMethodResponseElementEnd(out);     _appendEMethodResponseElementEnd(out);
     _appendSimpleExportRspElementEnd(out);     _appendSimpleExportRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
Line 1659 
Line 2641 
     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.38  
changed lines
  Added in v.1.80

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2