version 1.144, 2009/12/15 11:39:34
|
version 1.145, 2012/02/28 14:06:49
|
|
|
| |
if (!CIMName::legal(name)) | if (!CIMName::legal(name)) |
{ | { |
#ifdef PEGASUS_SNIA_INTEROP_TEST |
|
// In testing, replace illegal CIMName with this value to avoid the |
|
// exception and let xml parsing continue. THIS IS TEMP. |
|
name = "BADNAMESUBSTITUTEDBYPEGASUSCLIENT"; |
|
#else |
|
|
|
char buffer[MESSAGE_SIZE]; | char buffer[MESSAGE_SIZE]; |
sprintf(buffer, "%s.NAME", elementName); | sprintf(buffer, "%s.NAME", elementName); |
| |
|
|
buffer); | buffer); |
| |
throw XmlSemanticError(lineNumber, mlParms); | throw XmlSemanticError(lineNumber, mlParms); |
|
|
#endif |
|
} | } |
| |
return CIMNameCast(name); | return CIMNameCast(name); |
|
|
| |
if (!CIMName::legal(name)) | if (!CIMName::legal(name)) |
{ | { |
#ifdef PEGASUS_SNIA_INTEROP_TEST |
|
name = "PEGASUS_SUBSTITUED_THIS_FOR_BAD_NAME"; |
|
return name; |
|
#endif |
|
|
|
char buffer[MESSAGE_SIZE]; | char buffer[MESSAGE_SIZE]; |
sprintf(buffer, "%s.REFERENCECLASS", elementName); | sprintf(buffer, "%s.REFERENCECLASS", elementName); |
| |
|
|
| |
try | try |
{ | { |
// KS 20021002 - Exception if no datetime value. Test for |
|
// zero length and leave the NULL value in the variable |
|
// Bugzilla 137 Adds the following if line. |
|
// Expect this to become permanent but test only for now |
|
#ifdef PEGASUS_SNIA_INTEROP_TEST |
|
if (valueStringLen != 0) | if (valueStringLen != 0) |
#endif |
{ |
tmp.set(valueString); | tmp.set(valueString); |
} | } |
|
} |
catch (InvalidDateTimeFormatException&) | catch (InvalidDateTimeFormatException&) |
{ | { |
MessageLoaderParms mlParms( | MessageLoaderParms mlParms( |
|
|
| |
expectEndTag(parser, "VALUE"); | expectEndTag(parser, "VALUE"); |
} | } |
#ifdef PEGASUS_SNIA_INTEROP_TEST |
value = stringToValue(parser.getLine(),valueString,valueStringLen,type); |
// KS 20021004 - tries to put value in even if empty. |
|
// Think this is general problem with empty value |
|
// Need to check meaning of (#PCDATA) - Does it allow empty. |
|
// Bugzilla tbd |
|
if (!empty) |
|
#endif |
|
value = stringToValue( |
|
parser.getLine(), |
|
valueString, |
|
valueStringLen, |
|
type); |
|
| |
return true; | return true; |
} | } |
|
|
| |
if (!testStartTag(parser, entry, "HOST")) | if (!testStartTag(parser, entry, "HOST")) |
return false; | return false; |
#ifdef PEGASUS_SNIA_INTEROP_TEST |
|
// Temp code to allow empty HOST field. |
|
// SNIA CIMOMs return empty field particularly on enumerateinstance. |
|
// Simply substitute a string for the empty. |
|
if (!parser.next(entry)) |
|
throw XmlException(XmlException::UNCLOSED_TAGS, parser.getLine()); |
|
|
|
if (entry.type == XmlEntry::CONTENT) |
|
host = String(entry.text); |
|
else |
|
{ |
|
parser.putBack(entry); |
|
host = "HOSTNAMEINSERTEDBYPEGASUSCLIENT"; |
|
} |
|
|
|
#else |
|
| |
if (!parser.next(entry) || entry.type != XmlEntry::CONTENT) | if (!parser.next(entry) || entry.type != XmlEntry::CONTENT) |
{ | { |
|
|
} | } |
| |
host = String(entry.text); | host = String(entry.text); |
#endif |
|
expectEndTag(parser, "HOST"); | expectEndTag(parser, "HOST"); |
return true; | return true; |
} | } |