version 1.75, 2005/10/31 17:39:12
|
version 1.81.4.1, 2008/02/11 16:52:12
|
|
|
//%2005//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development | // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. | // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. | // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; | // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
// EMC Corporation; VERITAS Software Corporation; The Open Group. | // EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// 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 |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Mike Brasher (mbrasher@bmc.com) |
|
// |
|
// Modified By: |
|
// Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com) |
|
// Nag Boranna, Hewlett-Packard Company (nagaraja_boranna@hp.com) |
|
// Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
|
// Carol Ann Krug Graves, Hewlett-Packard Company |
|
// (carolann_graves@hp.com) |
|
// Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase1 |
|
// Willis White (whiwill@us.ibm.com) PEP 127 and 128 |
|
// Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase2 |
|
// David Dillard, VERITAS Software Corp. (david.dillard@veritas.com) |
|
// Vijay Eli, vijayeli@in.ibm.com, fix for #2571 |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#ifndef Pegasus_XmlWriter_h | #ifndef Pegasus_XmlWriter_h |
|
|
#include <Pegasus/Common/CIMParamValue.h> | #include <Pegasus/Common/CIMParamValue.h> |
#include <Pegasus/Common/Message.h> | #include <Pegasus/Common/Message.h> |
#include <Pegasus/Common/Linkage.h> | #include <Pegasus/Common/Linkage.h> |
#include <Pegasus/Common/ContentLanguages.h> // l10n |
#include <Pegasus/Common/ContentLanguageList.h> |
#include <Pegasus/Common/AcceptLanguages.h> // l10n |
#include <Pegasus/Common/AcceptLanguageList.h> |
#include <Pegasus/Common/Buffer.h> | #include <Pegasus/Common/Buffer.h> |
|
#include <Pegasus/Common/StrLit.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
const String& cimObject, | const String& cimObject, |
const String& authenticationHeader, | const String& authenticationHeader, |
HttpMethod httpMethod, | HttpMethod httpMethod, |
const AcceptLanguages & acceptLanguages, |
const AcceptLanguageList& acceptLanguages, |
const ContentLanguages & contentLanguages, |
const ContentLanguageList& contentLanguages, |
Uint32 contentLength); | Uint32 contentLength); |
| |
// added to accommodate sending WBEMServerResponseTime PEP #128 | // added to accommodate sending WBEMServerResponseTime PEP #128 |
static void appendMethodResponseHeader( | static void appendMethodResponseHeader( |
Buffer& out, | Buffer& out, |
HttpMethod httpMethod, | HttpMethod httpMethod, |
const ContentLanguages & contentLanguages, |
const ContentLanguageList& contentLanguages, |
Uint32 contentLength, | Uint32 contentLength, |
Uint32 serverResponseTime = 0); |
Uint64 serverResponseTime = 0); |
| |
static void appendHttpErrorResponseHeader( | static void appendHttpErrorResponseHeader( |
Buffer& out, | Buffer& out, |
|
|
Buffer& out, | Buffer& out, |
const String& content); | const String& content); |
#endif | #endif |
|
static void appendParamTypeAndEmbeddedObjAttrib( |
|
Buffer& out, |
|
const CIMType& type); |
| |
static void appendReturnValueElement( | static void appendReturnValueElement( |
Buffer& out, | Buffer& out, |
|
|
const char* name, | const char* name, |
const String& str); | const String& str); |
| |
static void appendQualifierNameIParameter( |
|
Buffer& out, |
|
const char* name, |
|
const String& qualifierName); |
|
|
|
static void appendClassNameIParameter( | static void appendClassNameIParameter( |
Buffer& out, | Buffer& out, |
const char* name, | const char* name, |
|
|
const String& messageId, | const String& messageId, |
HttpMethod httpMethod, | HttpMethod httpMethod, |
const String& authenticationHeader, | const String& authenticationHeader, |
const AcceptLanguages& httpAcceptLanguages, |
const AcceptLanguageList& httpAcceptLanguages, |
const ContentLanguages& httpContentLanguages); |
const ContentLanguageList& httpContentLanguages); |
| |
//PEP 128 - sending serverResponseTime (WBEMServerResponseTime) in respons header |
// PEP 128 - sending serverResponseTime (WBEMServerResponseTime) in |
|
// response header |
static Buffer formatSimpleMethodRspMessage( | static Buffer formatSimpleMethodRspMessage( |
const CIMName& methodName, | const CIMName& methodName, |
const String& messageId, | const String& messageId, |
HttpMethod httpMethod, | HttpMethod httpMethod, |
const ContentLanguages & httpContentLanguages, |
const ContentLanguageList& httpContentLanguages, |
const Buffer& body, | const Buffer& body, |
Uint32 serverResponseTime, |
Uint64 serverResponseTime, |
Boolean isFirst = true, | Boolean isFirst = true, |
Boolean isLast = true); | Boolean isLast = true); |
| |
|
|
const String& messageId, | const String& messageId, |
HttpMethod httpMethod, | HttpMethod httpMethod, |
const String& authenticationHeader, | const String& authenticationHeader, |
const AcceptLanguages& httpAcceptLanguages, |
const AcceptLanguageList& httpAcceptLanguages, |
const ContentLanguages& httpContentLanguages, |
const ContentLanguageList& httpContentLanguages, |
const Buffer& body); | const Buffer& body); |
| |
//PEP 128 - sending serverResponseTime (WBEMServerResponseTime) in respons header |
// PEP 128 - sending serverResponseTime (WBEMServerResponseTime) in |
|
// response header |
static Buffer formatSimpleIMethodRspMessage( | static Buffer formatSimpleIMethodRspMessage( |
const CIMName& iMethodName, | const CIMName& iMethodName, |
const String& messageId, | const String& messageId, |
HttpMethod httpMethod, | HttpMethod httpMethod, |
const ContentLanguages & httpContentLanguages, |
const ContentLanguageList& httpContentLanguages, |
const Buffer& body, | const Buffer& body, |
Uint32 serverResponseTime, |
Uint64 serverResponseTime, |
Boolean isFirst = true, | Boolean isFirst = true, |
Boolean isLast = true); | Boolean isLast = true); |
| |
|
|
const CIMName& cimMethod, | const CIMName& cimMethod, |
HttpMethod httpMethod, | HttpMethod httpMethod, |
const String& authenticationHeader, | const String& authenticationHeader, |
const AcceptLanguages& acceptLanguages, |
const AcceptLanguageList& acceptLanguages, |
const ContentLanguages& contentLanguages, |
const ContentLanguageList& contentLanguages, |
Uint32 contentLength); | Uint32 contentLength); |
| |
static void appendEMethodResponseHeader( | static void appendEMethodResponseHeader( |
Buffer& out, | Buffer& out, |
HttpMethod httpMethod, | HttpMethod httpMethod, |
const ContentLanguages& contentLanguages, |
const ContentLanguageList& contentLanguages, |
Uint32 contentLength); | Uint32 contentLength); |
| |
static Buffer formatSimpleEMethodReqMessage( | static Buffer formatSimpleEMethodReqMessage( |
|
|
const String& messageId, | const String& messageId, |
HttpMethod httpMethod, | HttpMethod httpMethod, |
const String& authenticationHeader, | const String& authenticationHeader, |
const AcceptLanguages& httpAcceptLanguages, |
const AcceptLanguageList& httpAcceptLanguages, |
const ContentLanguages& httpContentLanguages, |
const ContentLanguageList& httpContentLanguages, |
const Buffer& body); | const Buffer& body); |
| |
static Buffer formatSimpleEMethodRspMessage( | static Buffer formatSimpleEMethodRspMessage( |
const CIMName& eMethodName, | const CIMName& eMethodName, |
const String& messageId, | const String& messageId, |
HttpMethod httpMethod, | HttpMethod httpMethod, |
const ContentLanguages& httpContentLanguages, |
const ContentLanguageList& httpContentLanguages, |
const Buffer& body); | const Buffer& body); |
| |
static Buffer formatSimpleEMethodErrorRspMessage( | static Buffer formatSimpleEMethodErrorRspMessage( |
|
|
static void _appendMethodCallElementBegin( | static void _appendMethodCallElementBegin( |
Buffer& out, | Buffer& out, |
const CIMName& name); | const CIMName& name); |
|
|
static void _appendMethodCallElementEnd( | static void _appendMethodCallElementEnd( |
Buffer& out); | Buffer& out); |
| |
|
|
static void _appendEMethodCallElementBegin( | static void _appendEMethodCallElementBegin( |
Buffer& out, | Buffer& out, |
const CIMName& name); | const CIMName& name); |
|
|
static void _appendEMethodCallElementEnd( | static void _appendEMethodCallElementEnd( |
Buffer& out); | Buffer& out); |
| |
|
|
static void _appendEMethodResponseElementBegin( | static void _appendEMethodResponseElementBegin( |
Buffer& out, | Buffer& out, |
const CIMName& name); | const CIMName& name); |
|
|
static void _appendEMethodResponseElementEnd( | static void _appendEMethodResponseElementEnd( |
Buffer& out); | Buffer& out); |
| |
|
|
Buffer& out, | Buffer& out, |
const char* x); | const char* x); |
| |
PEGASUS_COMMON_LINKAGE Buffer& operator<<(Buffer& out, char x); |
inline Buffer& operator<<(Buffer& out, char x) |
|
{ |
|
out.append(x); |
|
return out; |
|
} |
|
|
|
inline Buffer& operator<<(Buffer& out, const char* s) |
|
{ |
|
out.append(s, strlen(s)); |
|
return out; |
|
} |
| |
PEGASUS_COMMON_LINKAGE Buffer& operator<<(Buffer& out, const Char16& x); | PEGASUS_COMMON_LINKAGE Buffer& operator<<(Buffer& out, const Char16& x); |
| |