2013-12-31 19:36:07 +00:00
|
|
|
#include "se/CreateResponse.hpp"
|
|
|
|
#include "se/StandardCommandType.hpp"
|
|
|
|
#include "se/EPPDateFormatter.hpp"
|
|
|
|
|
|
|
|
const std::string CreateResponse::OBJ()
|
|
|
|
{
|
|
|
|
static std::string expr = "OBJ";
|
|
|
|
return expr;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string CreateResponse::CRE_DATA_EXPR()
|
|
|
|
{
|
|
|
|
static std::string expr = DataResponse::RES_DATA_EXPR() + "/OBJ:creData";
|
|
|
|
return expr;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string CreateResponse::CR_DATE_EXPR()
|
|
|
|
{
|
|
|
|
static std::string expr = DataResponse::RES_DATA_EXPR() + "/OBJ:crDate/text()";
|
|
|
|
return expr;
|
|
|
|
}
|
|
|
|
|
|
|
|
CreateResponse::CreateResponse(const ObjectType* objectType)
|
|
|
|
: DataResponse(StandardCommandType::CREATE(), objectType)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
void CreateResponse::fromXML(XMLDocument *xmlDoc) throw (ParsingException)
|
|
|
|
{
|
|
|
|
DataResponse::fromXML(xmlDoc);
|
|
|
|
|
|
|
|
if (!(resultArray[0].succeeded())) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
std::string crDateStr = xmlDoc->getNodeValue(crDateExpr());
|
2014-01-17 01:46:48 +00:00
|
|
|
crDate = std::auto_ptr<XMLGC::XMLGregorianCalendar>(EPPDateFormatter::fromXSDateTime(crDateStr));
|
2013-12-31 19:36:07 +00:00
|
|
|
}
|
|
|
|
catch (IllegalArgException& iae)
|
|
|
|
{
|
|
|
|
maintLogger->LOG_WARNING(iae.getMessage());
|
|
|
|
throw ParsingException(iae.getMessage());
|
|
|
|
}
|
|
|
|
}
|