(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.162 and 1.172

version 1.162, 2008/10/17 07:16:35 version 1.172, 2012/06/06 10:51:38
Line 1 
Line 1 
 //%2006////////////////////////////////////////////////////////////////////////  //%LICENSE////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development  // Licensed to The Open Group (TOG) under one or more contributor license
 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.  // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;  // this work for additional information regarding copyright ownership.
 // IBM Corp.; EMC Corporation, The Open Group.  // Each contributor licenses this file to you under the OpenPegasus Open
 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;  // Source License; you may not use this file except in compliance with the
 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.  // License.
 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;  //
 // EMC Corporation; VERITAS Software Corporation; The Open Group.  // Permission is hereby granted, free of charge, to any person obtaining a
 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;  // copy of this software and associated documentation files (the "Software"),
 // EMC Corporation; Symantec Corporation; The Open Group.  // to deal in the Software without restriction, including without limitation
 //  // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 // Permission is hereby granted, free of charge, to any person obtaining a copy  // and/or sell copies of the Software, and to permit persons to whom the
 // of this software and associated documentation files (the "Software"), to  // Software is furnished to do so, subject to the following conditions:
 // deal in the Software without restriction, including without limitation the  //
 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or  // The above copyright notice and this permission notice shall be included
 // sell copies of the Software, and to permit persons to whom the Software is  // in all copies or substantial portions of the Software.
 // furnished to do so, subject to the following conditions:  //
 //  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN  // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED  // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT  // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR  // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT  // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN  // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION  
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  
 // //
 //==============================================================================  //////////////////////////////////////////////////////////////////////////
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 60 
Line 58 
 #include "StrLit.h" #include "StrLit.h"
 #include "IDFactory.h" #include "IDFactory.h"
 #include "StringConversion.h" #include "StringConversion.h"
   
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 static StrLit _XmlWriterTypeStrings[] =  
 {  
     STRLIT("TYPE=\"boolean\""),   STRLIT("TYPE=\"uint8\""),  
     STRLIT("TYPE=\"sint8\""),     STRLIT("TYPE=\"uint16\""),  
     STRLIT("TYPE=\"sint16\""),    STRLIT("TYPE=\"uint32\""),  
     STRLIT("TYPE=\"sint32\""),    STRLIT("TYPE=\"uint64\""),  
     STRLIT("TYPE=\"sint64\""),    STRLIT("TYPE=\"real32\""),  
     STRLIT("TYPE=\"real64\""),    STRLIT("TYPE=\"char16\""),  
     STRLIT("TYPE=\"string\""),    STRLIT("TYPE=\"datetime\""),  
     STRLIT("TYPE=\"reference\""), STRLIT("TYPE=\"object\""),  
     STRLIT("TYPE=\"instance\"")  
 };  
   
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendLocalNameSpacePathElement() // appendLocalNameSpacePathElement()
Line 738 
Line 722 
  
 void XmlWriter::appendValueObjectWithPathElement( void XmlWriter::appendValueObjectWithPathElement(
     Buffer& out,     Buffer& out,
     const CIMObject& objectWithPath)      const CIMObject& objectWithPath,
       Boolean includeQualifiers,
       Boolean includeClassOrigin,
       const CIMPropertyList& propertyList)
 { {
     out << STRLIT("<VALUE.OBJECTWITHPATH>\n");     out << STRLIT("<VALUE.OBJECTWITHPATH>\n");
  
     appendValueReferenceElement(out, objectWithPath.getPath (), false);     appendValueReferenceElement(out, objectWithPath.getPath (), false);
     appendObjectElement(out, objectWithPath);      appendObjectElement(
           out,
           objectWithPath,
           includeQualifiers,
           includeClassOrigin,
           propertyList);
  
     out << STRLIT("</VALUE.OBJECTWITHPATH>\n");     out << STRLIT("</VALUE.OBJECTWITHPATH>\n");
 } }
Line 831 
Line 823 
  
 void XmlWriter::appendValueNamedInstanceElement( void XmlWriter::appendValueNamedInstanceElement(
     Buffer& out,     Buffer& out,
     const CIMInstance& namedInstance)      const CIMInstance& namedInstance,
       Boolean includeQualifiers,
       Boolean includeClassOrigin,
       const CIMPropertyList& propertyList)
 { {
     out << STRLIT("<VALUE.NAMEDINSTANCE>\n");     out << STRLIT("<VALUE.NAMEDINSTANCE>\n");
  
     appendInstanceNameElement(out, namedInstance.getPath ());     appendInstanceNameElement(out, namedInstance.getPath ());
     appendInstanceElement(out, namedInstance);      appendInstanceElement(
           out,
           namedInstance,
           includeQualifiers,
           includeClassOrigin,
           propertyList);
  
     out << STRLIT("</VALUE.NAMEDINSTANCE>\n");     out << STRLIT("</VALUE.NAMEDINSTANCE>\n");
 } }
Line 917 
Line 917 
  
 void XmlWriter::appendInstanceElement( void XmlWriter::appendInstanceElement(
     Buffer& out,     Buffer& out,
     const CIMConstInstance& instance)      const CIMConstInstance& instance,
       Boolean includeQualifiers,
       Boolean includeClassOrigin,
       const CIMPropertyList& propertyList)
 { {
     CheckRep(instance._rep);     CheckRep(instance._rep);
     const CIMInstanceRep* rep = instance._rep;     const CIMInstanceRep* rep = instance._rep;
Line 929 
Line 932 
         << STRLIT("\" >\n");         << STRLIT("\" >\n");
  
     // Append Instance Qualifiers:     // Append Instance Qualifiers:
       if(includeQualifiers)
       {
     for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)     for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)
         XmlWriter::appendQualifierElement(out, rep->getQualifier(i));         XmlWriter::appendQualifierElement(out, rep->getQualifier(i));
       }
     // Append Properties:      if(propertyList.isNull())
       {
     for (Uint32 i = 0, n = rep->getPropertyCount(); i < n; i++)     for (Uint32 i = 0, n = rep->getPropertyCount(); i < n; i++)
         XmlWriter::appendPropertyElement(out, rep->getProperty(i));          {
               XmlWriter::appendPropertyElement(
                   out,
                   rep->getProperty(i),
                   includeQualifiers,includeClassOrigin);
           }
       }
       else
       {
           for (Uint32 i = 0, n = propertyList.size(); i < n; i++)
           {
               CIMName name = propertyList[i];
               Uint32 pos = rep->_properties.find(
                   propertyList[i],
                   propertyList.getCIMNameTag(i));
               if(pos != PEG_NOT_FOUND)
               {
                   PEG_TRACE((TRC_XML,Tracer::LEVEL4,
                       "XmlWriter::appendInstanceElement"
                           " Filtering the property name:%s for the className:%s"
                       "since it was not filtered by the provider.",
                       (const char *)name.getString().getCString(),
                       (const char *)instance.getClassName().
                           getString().getCString()));
   
                   XmlWriter::appendPropertyElement(
                       out,
                       rep->getProperty(pos),
                       includeQualifiers,includeClassOrigin);
               }
           }
   
       }
  
     // Instance closing element:     // Instance closing element:
  
Line 962 
Line 998 
  
 void XmlWriter::appendObjectElement( void XmlWriter::appendObjectElement(
     Buffer& out,     Buffer& out,
     const CIMConstObject& object)      const CIMConstObject& object,
       Boolean includeQualifiers,
       Boolean includeClassOrigin,
       const CIMPropertyList& propertyList)
 { {
     if (object.isClass())     if (object.isClass())
     {     {
Line 972 
Line 1011 
     else if (object.isInstance())     else if (object.isInstance())
     {     {
         CIMConstInstance i(object);         CIMConstInstance i(object);
         appendInstanceElement(out, i);          appendInstanceElement(
               out,
               i,
               includeQualifiers,
               includeClassOrigin,
               propertyList);
     }     }
     // else PEGASUS_ASSERT(0);     // else PEGASUS_ASSERT(0);
 } }
Line 1007 
Line 1051 
  
 void XmlWriter::appendPropertyElement( void XmlWriter::appendPropertyElement(
     Buffer& out,     Buffer& out,
     const CIMConstProperty& property)      const CIMConstProperty& property,
       Boolean includeQualifiers,
       Boolean includeClassOrigin)
 { {
     CheckRep(property._rep);     CheckRep(property._rep);
     const CIMPropertyRep* rep = property._rep;     const CIMPropertyRep* rep = property._rep;
Line 1078 
Line 1124 
                 // Note that if the macro PEGASUS_SNIA_INTEROP_COMPATIBILITY is                 // Note that if the macro PEGASUS_SNIA_INTEROP_COMPATIBILITY is
                 // defined, then the EmbeddedInstance qualifier will be added                 // defined, then the EmbeddedInstance qualifier will be added
 # ifdef PEGASUS_SNIA_INTEROP_COMPATIBILITY # ifdef PEGASUS_SNIA_INTEROP_COMPATIBILITY
                 if (rep->findQualifier(PEGASUS_QUALIFIERNAME_EMBEDDEDINSTANCE ==                  if (rep->findQualifier(PEGASUS_QUALIFIERNAME_EMBEDDEDINSTANCE)
                         PEG_NOT_FOUND)                          == PEG_NOT_FOUND)
                 {                 {
                     // Note that addQualifiers() cannot be called on a const                     // Note that addQualifiers() cannot be called on a const
                     // CIMQualifierRep.  In this case we really do want to add                     // CIMQualifierRep.  In this case we really do want to add
Line 1099 
Line 1145 
         else         else
         {         {
             out.append(' ');             out.append(' ');
             out << _XmlWriterTypeStrings[rep->getValue().getType()];              out << xmlWriterTypeStrings(rep->getValue().getType());
         }         }
  
         if (rep->getArraySize())         if (rep->getArraySize())
Line 1110 
Line 1156 
             out.append('"');             out.append('"');
         }         }
  
         if (!rep->getClassOrigin().isNull())          if(includeClassOrigin && !rep->getClassOrigin().isNull())
         {         {
             out << STRLIT(" CLASSORIGIN=\"") << rep->getClassOrigin();             out << STRLIT(" CLASSORIGIN=\"") << rep->getClassOrigin();
             out.append('"');             out.append('"');
Line 1122 
Line 1168 
         }         }
  
         out << STRLIT(">\n");         out << STRLIT(">\n");
           if(includeQualifiers)
           {
         for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)         for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)
             XmlWriter::appendQualifierElement(out, rep->getQualifier(i));             XmlWriter::appendQualifierElement(out, rep->getQualifier(i));
           }
  
         XmlWriter::appendValueElement(out, rep->getValue());         XmlWriter::appendValueElement(out, rep->getValue());
  
Line 1140 
Line 1188 
             out << STRLIT(" REFERENCECLASS=\"") << rep->getReferenceClassName();             out << STRLIT(" REFERENCECLASS=\"") << rep->getReferenceClassName();
             out.append('"');             out.append('"');
         }         }
           if(includeClassOrigin && !rep->getClassOrigin().isNull())
         if (!rep->getClassOrigin().isNull())  
         {         {
             out << STRLIT(" CLASSORIGIN=\"") << rep->getClassOrigin();             out << STRLIT(" CLASSORIGIN=\"") << rep->getClassOrigin();
             out.append('"');             out.append('"');
Line 1153 
Line 1200 
         }         }
  
         out << STRLIT(">\n");         out << STRLIT(">\n");
           if(includeQualifiers)
           {
         for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)         for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)
             XmlWriter::appendQualifierElement(out, rep->getQualifier(i));             XmlWriter::appendQualifierElement(out, rep->getQualifier(i));
           }
  
         XmlWriter::appendValueElement(out, rep->getValue());         XmlWriter::appendValueElement(out, rep->getValue());
  
Line 1164 
Line 1213 
     else     else
     {     {
         out << STRLIT("<PROPERTY NAME=\"") << rep->getName() << STRLIT("\" ");         out << STRLIT("<PROPERTY NAME=\"") << rep->getName() << STRLIT("\" ");
           if(includeClassOrigin && !rep->getClassOrigin().isNull())
         if (!rep->getClassOrigin().isNull())  
         {         {
             out << STRLIT(" CLASSORIGIN=\"") << rep->getClassOrigin();             out << STRLIT(" CLASSORIGIN=\"") << rep->getClassOrigin();
             out.append('"');             out.append('"');
Line 1243 
Line 1291 
         else         else
         {         {
             out.append(' ');             out.append(' ');
             out << _XmlWriterTypeStrings[rep->getValue().getType()];              out << xmlWriterTypeStrings(rep->getValue().getType());
         }         }
  
         out << STRLIT(">\n");         out << STRLIT(">\n");
           if(includeQualifiers)
           {
         for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)         for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++)
             XmlWriter::appendQualifierElement(out, rep->getQualifier(i));             XmlWriter::appendQualifierElement(out, rep->getQualifier(i));
           }
  
         XmlWriter::appendValueElement(out, rep->getValue());         XmlWriter::appendValueElement(out, rep->getValue());
  
Line 1290 
Line 1340 
     out << STRLIT("<METHOD NAME=\"") << rep->getName();     out << STRLIT("<METHOD NAME=\"") << rep->getName();
     out << STRLIT("\" ");     out << STRLIT("\" ");
  
     out << _XmlWriterTypeStrings[rep->getType()];      out << xmlWriterTypeStrings(rep->getType());
  
     if (!rep->getClassOrigin().isNull())     if (!rep->getClassOrigin().isNull())
     {     {
Line 1392 
Line 1442 
         {         {
             out << STRLIT("<PARAMETER.ARRAY"             out << STRLIT("<PARAMETER.ARRAY"
                           " NAME=\"") << rep->getName();                           " NAME=\"") << rep->getName();
             out << STRLIT("\" ") << _XmlWriterTypeStrings[rep->getType()];              out << STRLIT("\" ") << xmlWriterTypeStrings(rep->getType());
  
             if (rep->getArraySize())             if (rep->getArraySize())
             {             {
Line 1433 
Line 1483 
     {     {
         out << STRLIT("<PARAMETER"         out << STRLIT("<PARAMETER"
                       " NAME=\"") << rep->getName();                       " NAME=\"") << rep->getName();
         out << STRLIT("\" ") << _XmlWriterTypeStrings[rep->getType()];          out << STRLIT("\" ") << xmlWriterTypeStrings(rep->getType());
  
         out << STRLIT(">\n");         out << STRLIT(">\n");
  
Line 1518 
Line 1568 
     const CIMQualifierRep* rep = qualifier._rep;     const CIMQualifierRep* rep = qualifier._rep;
  
     out << STRLIT("<QUALIFIER NAME=\"") << rep->getName();     out << STRLIT("<QUALIFIER NAME=\"") << rep->getName();
     out << STRLIT("\" ") << _XmlWriterTypeStrings[rep->getValue().getType()];      out << STRLIT("\" ") << xmlWriterTypeStrings(rep->getValue().getType());
  
     if (rep->getPropagated())     if (rep->getPropagated())
     {     {
Line 1565 
Line 1615 
     const CIMQualifierDeclRep* rep = qualifierDecl._rep;     const CIMQualifierDeclRep* rep = qualifierDecl._rep;
  
     out << STRLIT("<QUALIFIER.DECLARATION NAME=\"") << rep->getName();     out << STRLIT("<QUALIFIER.DECLARATION NAME=\"") << rep->getName();
     out << STRLIT("\" ") << _XmlWriterTypeStrings[rep->getValue().getType()];      out << STRLIT("\" ") << xmlWriterTypeStrings(rep->getValue().getType());
  
     if (rep->getValue().isArray())     if (rep->getValue().isArray())
     {     {
Line 1607 
Line 1657 
 //                                 TOINSTANCE   (true|false)   'false' //                                 TOINSTANCE   (true|false)   'false'
 //                                 TRANSLATABLE (true|false)   'false'"> //                                 TRANSLATABLE (true|false)   'false'">
 // //
   //     DEPRECATION NOTE:  The attribute TOINSTANCE is DEPRECATED and MAY be
   //     removed from the QualifierFlavor entity in a future version of this
   //     document.  Use of this qualifier is discouraged.
   //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
 void XmlWriter::appendQualifierFlavorEntity( void XmlWriter::appendQualifierFlavorEntity(
Line 1619 
Line 1673 
     if (!(flavor.hasFlavor (CIMFlavor::TOSUBCLASS)))     if (!(flavor.hasFlavor (CIMFlavor::TOSUBCLASS)))
         out << STRLIT(" TOSUBCLASS=\"false\"");         out << STRLIT(" TOSUBCLASS=\"false\"");
  
     if (flavor.hasFlavor (CIMFlavor::TOINSTANCE))      //if (flavor.hasFlavor (CIMFlavor::TOINSTANCE))
         out << STRLIT(" TOINSTANCE=\"true\"");      //    out << STRLIT(" TOINSTANCE=\"true\"");
  
     if (flavor.hasFlavor (CIMFlavor::TRANSLATABLE))     if (flavor.hasFlavor (CIMFlavor::TRANSLATABLE))
         out << STRLIT(" TRANSLATABLE=\"true\"");         out << STRLIT(" TRANSLATABLE=\"true\"");
Line 1695 
Line 1749 
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const AcceptLanguageList& acceptLanguages,     const AcceptLanguageList& acceptLanguages,
     const ContentLanguageList& contentLanguages,     const ContentLanguageList& contentLanguages,
     Uint32 contentLength)      Uint32 contentLength,
       bool binaryRequest,
       bool binaryResponse)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
  
Line 1713 
Line 1769 
     {     {
         out << STRLIT("POST /cimom HTTP/1.1\r\n");         out << STRLIT("POST /cimom HTTP/1.1\r\n");
     }     }
     out << STRLIT("HOST: ") << host << STRLIT("\r\n"      out << STRLIT("HOST: ") << host << STRLIT("\r\n");
                   "Content-Type: application/xml; charset=\"utf-8\"\r\n");  
       if (binaryRequest)
       {
           // Tell the server that the payload is encoded in the OpenPegasus
           // binary protocol.
           out << STRLIT("Content-Type: application/x-openpegasus\r\n");
       }
       else
       {
           out << STRLIT("Content-Type: application/xml; charset=utf-8\r\n");
       }
   
       if (binaryResponse)
       {
           // Tell the server that this client accepts the OpenPegasus binary
           // protocol.
           out << STRLIT("Accept: application/x-openpegasus\r\n");
       }
   
     OUTPUT_CONTENTLENGTH(out, contentLength);     OUTPUT_CONTENTLENGTH(out, contentLength);
     if (acceptLanguages.size() > 0)     if (acceptLanguages.size() > 0)
     {     {
Line 1738 
Line 1812 
     if (!clientTransferEncodingOff || *clientTransferEncodingOff != '0')     if (!clientTransferEncodingOff || *clientTransferEncodingOff != '0')
 #endif #endif
  
       if (!binaryResponse)
       {
           // The binary protocol does not allow chunking.
     out << STRLIT("TE: chunked, trailers\r\n");     out << STRLIT("TE: chunked, trailers\r\n");
       }
  
     if (httpMethod == HTTP_METHOD_M_POST)     if (httpMethod == HTTP_METHOD_M_POST)
     {     {
Line 1773 
Line 1851 
      HttpMethod httpMethod,      HttpMethod httpMethod,
      const ContentLanguageList& contentLanguages,      const ContentLanguageList& contentLanguages,
      Uint32 contentLength,      Uint32 contentLength,
      Uint64 serverResponseTime)       Uint64 serverResponseTime,
        bool binaryResponse)
 { {
      char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };      // Optimize the typical case for binary messages, circumventing the
       // more expensive logic below.
       if (binaryResponse &&
           contentLength == 0 &&
           httpMethod != HTTP_METHOD_M_POST &&
           contentLanguages.size() == 0)
       {
           static const char HEADERS[] =
               "HTTP/1.1 200 OK\r\n"
               "Content-Type: application/x-openpegasus\r\n"
               "content-length: 0000000000\r\n"
               "CIMOperation: MethodResponse\r\n"
               "\r\n";
   
           // The HTTP processor fills in the content-length value later.
           // It searches for a field matching "content-length" (so the first
           // character must be lower case).
           out.append(HEADERS, sizeof(HEADERS) - 1);
           return;
       }
   
      out << STRLIT("HTTP/1.1 " HTTP_STATUS_OK "\r\n");      out << STRLIT("HTTP/1.1 " HTTP_STATUS_OK "\r\n");
  
 #ifndef PEGASUS_DISABLE_PERFINST #ifndef PEGASUS_DISABLE_PERFINST
Line 1786 
Line 1885 
      }      }
 #endif #endif
  
      out << STRLIT("Content-Type: application/xml; charset=\"utf-8\"\r\n");       if (binaryResponse)
        {
           // According to MIME RFC, the "x-" prefix should be used for all
           // non-registered values.
            out << STRLIT("Content-Type: application/x-openpegasus\r\n");
        }
        else
        {
            out << STRLIT("Content-Type: application/xml; charset=utf-8\r\n");
        }
   
      OUTPUT_CONTENTLENGTH(out, contentLength);      OUTPUT_CONTENTLENGTH(out, contentLength);
  
      if (contentLanguages.size() > 0)      if (contentLanguages.size() > 0)
Line 1796 
Line 1905 
      }      }
      if (httpMethod == HTTP_METHOD_M_POST)      if (httpMethod == HTTP_METHOD_M_POST)
      {      {
            char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
   
          out << STRLIT("Ext:\r\n"          out << STRLIT("Ext:\r\n"
                        "Cache-Control: no-cache\r\n"                        "Cache-Control: no-cache\r\n"
                        "Man: http://www.dmtf.org/cim/mapping/http/v1.0; ns=");                        "Man: http://www.dmtf.org/cim/mapping/http/v1.0; ns=");
Line 2120 
Line 2231 
     Buffer& out,     Buffer& out,
     const CIMException& cimException)     const CIMException& cimException)
 { {
     Tracer::traceCIMException(TRC_XML_WRITER, Tracer::LEVEL2, cimException);      Tracer::traceCIMException(TRC_XML, Tracer::LEVEL2, cimException);
  
     out << STRLIT("<ERROR CODE=\"") << Uint32(cimException.getCode());     out << STRLIT("<ERROR CODE=\"") << Uint32(cimException.getCode());
     out.append('"');     out.append('"');
Line 2188 
Line 2299 
     }     }
     else     else
     {     {
         out << STRLIT(" PARAM") << _XmlWriterTypeStrings[type];          out << STRLIT(" PARAM") << xmlWriterTypeStrings(type);
     }     }
 } }
  
Line 2508 
Line 2619 
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const String& authenticationHeader,     const String& authenticationHeader,
     const AcceptLanguageList& httpAcceptLanguages,     const AcceptLanguageList& httpAcceptLanguages,
     const ContentLanguageList& httpContentLanguages)      const ContentLanguageList& httpContentLanguages,
       bool binaryResponse)
 { {
     Buffer out;     Buffer out;
     Buffer tmp;     Buffer tmp;
Line 2537 
Line 2649 
         httpMethod,         httpMethod,
         httpAcceptLanguages,         httpAcceptLanguages,
         httpContentLanguages,         httpContentLanguages,
         out.size());          out.size(),
           false,
           binaryResponse);
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2609 
Line 2723 
         tmp,         tmp,
         httpMethod,         httpMethod,
         cimException.getContentLanguages(),         cimException.getContentLanguages(),
         out.size());          out.size(),
           false);
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2630 
Line 2745 
     const String& authenticationHeader,     const String& authenticationHeader,
     const AcceptLanguageList& httpAcceptLanguages,     const AcceptLanguageList& httpAcceptLanguages,
     const ContentLanguageList& httpContentLanguages,     const ContentLanguageList& httpContentLanguages,
     const Buffer& body)      const Buffer& body,
       bool binaryResponse)
 { {
     Buffer out;     Buffer out;
     Buffer tmp;     Buffer tmp;
Line 2653 
Line 2769 
         httpMethod,         httpMethod,
         httpAcceptLanguages,         httpAcceptLanguages,
         httpContentLanguages,         httpContentLanguages,
         out.size());          out.size(),
           false,
           binaryResponse);
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2741 
Line 2859 
     appendMethodResponseHeader(tmp,     appendMethodResponseHeader(tmp,
         httpMethod,         httpMethod,
         cimException.getContentLanguages(),         cimException.getContentLanguages(),
         out.size());          out.size(), false);
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2783 
Line 2901 
       out << STRLIT("POST ") << requestUri << STRLIT(" HTTP/1.1\r\n");       out << STRLIT("POST ") << requestUri << STRLIT(" HTTP/1.1\r\n");
     }     }
     out << STRLIT("HOST: ") << host << STRLIT("\r\n"     out << STRLIT("HOST: ") << host << STRLIT("\r\n"
                   "Content-Type: application/xml; charset=\"utf-8\"\r\n");                    "Content-Type: application/xml; charset=utf-8\r\n");
     OUTPUT_CONTENTLENGTH(out, contentLength);     OUTPUT_CONTENTLENGTH(out, contentLength);
  
     if (acceptLanguages.size() > 0)     if (acceptLanguages.size() > 0)
Line 2847 
Line 2965 
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
  
     out << STRLIT("HTTP/1.1 " HTTP_STATUS_OK "\r\n"     out << STRLIT("HTTP/1.1 " HTTP_STATUS_OK "\r\n"
                   "Content-Type: application/xml; charset=\"utf-8\"\r\n");                    "Content-Type: application/xml; charset=utf-8\r\n");
     OUTPUT_CONTENTLENGTH(out, contentLength);     OUTPUT_CONTENTLENGTH(out, contentLength);
  
     if (contentLanguages.size() > 0)     if (contentLanguages.size() > 0)


Legend:
Removed from v.1.162  
changed lines
  Added in v.1.172

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2