Update of /cvsroot/epp-rtk/epp-rtk/c++/src In directory usw-pr-cvs1:/tmp/cvs-serv30343/src Modified Files: Tag: epp-0402 config.h epp_Action.h epp_ContactCheck.cc epp_ContactCheck.h epp_ContactCreate.cc epp_ContactCreate.h epp_ContactDelete.cc epp_ContactDelete.h epp_ContactInfo.cc epp_ContactInfo.h epp_ContactTransfer.cc epp_ContactTransfer.h epp_ContactUpdate.cc epp_ContactUpdate.h epp_DomainCheck.cc epp_DomainCheck.h epp_DomainCreate.cc epp_DomainCreate.h epp_DomainDelete.cc epp_DomainDelete.h epp_DomainInfo.cc epp_DomainInfo.h epp_DomainRenew.cc epp_DomainRenew.h epp_DomainTransfer.cc epp_DomainTransfer.h epp_DomainUpdate.cc epp_DomainUpdate.h epp_Hello.cc epp_Hello.h epp_HostCheck.cc epp_HostCheck.h epp_HostCreate.cc epp_HostCreate.h epp_HostDelete.cc epp_HostDelete.h epp_HostInfo.cc epp_HostInfo.h epp_HostUpdate.cc epp_HostUpdate.h epp_Login.cc epp_Login.h epp_Logout.cc epp_Logout.h epp_Poll.cc epp_Poll.h epp_Session.cc epp_Session.h epp_Unspec.h ltoa.h main_contactcheck.cc main_contactcreate.cc main_contactdelete.cc main_contactinfo.cc main_contacttransfer.cc main_contactupdate.cc main_domaincheck.cc main_domaincreate.cc main_domaindelete.cc main_domaininfo.cc main_domainrenew.cc main_domaintransfer.cc main_domainupdate.cc main_hello.cc main_hostcheck.cc main_hostcreate.cc main_hostdelete.cc main_hostinfo.cc main_hostupdate.cc main_login.cc main_loginunspec.cc main_logout.cc main_poll.cc testTools.cc testTools.h Log Message: Back-merging main branch C++ code changes into epp-0402 Index: config.h =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/config.h,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** config.h 19 Jun 2001 19:16:37 -0000 1.1 --- config.h 23 Feb 2002 04:36:05 -0000 1.1.4.1 *************** *** 1,5 **** /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001 Global Name Registry * * This library is free software; you can redistribute it and/or modify it --- 1,5 ---- /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001, 2002 The Global Name Registry, Limited * * This library is free software; you can redistribute it and/or modify it *************** *** 20,24 **** * * EPP RTK ! * GNR Ltd. * 125 High Holborn * London WC1V 6QA --- 20,24 ---- * * EPP RTK ! * The Global Name Registry, Limited * 125 High Holborn * London WC1V 6QA Index: epp_Action.h =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/epp_Action.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** epp_Action.h 9 Jul 2001 14:29:21 -0000 1.3 --- epp_Action.h 23 Feb 2002 04:36:05 -0000 1.3.2.1 *************** *** 1,5 **** /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001 Global Name Registry * * This library is free software; you can redistribute it and/or modify it --- 1,5 ---- /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001, 2002 The Global Name Registry, Limited * * This library is free software; you can redistribute it and/or modify it *************** *** 20,24 **** * * EPP RTK ! * GNR Ltd. * 125 High Holborn * London WC1V 6QA --- 20,24 ---- * * EPP RTK ! * The Global Name Registry, Limited * 125 High Holborn * London WC1V 6QA Index: epp_ContactCheck.cc =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/epp_ContactCheck.cc,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** epp_ContactCheck.cc 9 Jul 2001 14:29:21 -0000 1.4 --- epp_ContactCheck.cc 23 Feb 2002 04:36:05 -0000 1.4.2.1 *************** *** 1,5 **** /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001 Global Name Registry * * This library is free software; you can redistribute it and/or modify it --- 1,5 ---- /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001, 2002 The Global Name Registry, Limited * * This library is free software; you can redistribute it and/or modify it *************** *** 20,24 **** * * EPP RTK ! * GNR Ltd. * 125 High Holborn * London WC1V 6QA --- 20,24 ---- * * EPP RTK ! * The Global Name Registry, Limited * 125 High Holborn * London WC1V 6QA *************** *** 29,37 **** #include "epp_ContactCheck.h" #include <domtools/dom_output.h> ! #include <domtools/dom_tools.h> #include "data/epp_contactXMLbase.h" #include "data/epp_XMLException.h" - #include <dom/DOM.hpp> using namespace domtools; --- 29,36 ---- #include "epp_ContactCheck.h" #include <domtools/dom_output.h> ! #include <domtools/dom_wrapper.h> #include "data/epp_contactXMLbase.h" #include "data/epp_XMLException.h" using namespace domtools; *************** *** 53,57 **** { if(m_request == NULL || m_request->m_cmd == NULL ! || m_request->m_roids == NULL) { throw epp_XMLException(__FILE__, __LINE__, "Missing data in request"); --- 52,56 ---- { if(m_request == NULL || m_request->m_cmd == NULL ! || m_request->m_ids == NULL) { throw epp_XMLException(__FILE__, __LINE__, "Missing data in request"); *************** *** 73,81 **** setCommandSchemaAttributes(xml_request); ! epp::epp_string_seq names = *m_request->m_roids; for(epp::epp_string_seq::iterator i = names.begin(); i != names.end(); i++) { ! xml_request.putTag("contact:roid",*i); } --- 72,80 ---- setCommandSchemaAttributes(xml_request); ! epp::epp_string_seq names = *m_request->m_ids; for(epp::epp_string_seq::iterator i = names.begin(); i != names.end(); i++) { ! xml_request.putTag("contact:id",*i); } *************** *** 97,151 **** } ! void epp_ContactCheck::fromXML(const epp_string & xml) { ! DOM_Document doc = createDOM_Document(xml); ! DOM_Node resNode = getSingleTag(doc, "response"); ! if(resNode.isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find response-element"); } ! epp_Response_ref res = createGenericResponse(resNode); m_response.ref(new epp_ContactCheckRsp()); m_response->m_rsp = res; ! DOM_Node chkDataNode = getresDataInfo(resNode, "chkData"); ! if(chkDataNode.isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find chkData-element"); } ! DOM_NodeList cdNodes = ((DOM_Element*)&chkDataNode)->getElementsByTagNameNS(chkDataNode.getNamespaceURI(), "cd"); ! ! if(cdNodes.getLength() == 0) ! { ! throw epp_XMLException(__FILE__, __LINE__, "Unable to find cd-element(s)"); ! } ! ! m_response->m_results.ref(new epp_check_result_seq); ! for(unsigned int i = 0; i < cdNodes.getLength(); i++) { ! DOM_Node cdNode = cdNodes.item(i); ! ! epp_CheckResult chRes; ! ! string exists; ! getAttribute(cdNode, "x", exists); ! // cout << "exists: " << exists << endl; ! if(exists == "+") ! chRes.m_exists.ref(new epp_boolean(true)); ! else ! chRes.m_exists.ref(new epp_boolean(false)); ! ! string value; ! getNodeData(cdNode, value); ! chRes.m_value.ref(new epp_string(value)); ! // cout << "value: " << *chRes.m_value << endl; ! m_response->m_results->push_back(chRes); } } --- 96,158 ---- } ! ! void epp_ContactCheck::fromXML(const eppobject::epp::epp_string & xml) { ! dom_ptr doc = createDOMDocument(xml); ! dom_ptr responseNode = dom_ptr(doc->getTag("response")); ! ! if(responseNode->isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find response-element"); } ! epp_Response_ref res = createGenericResponse(responseNode); m_response.ref(new epp_ContactCheckRsp()); m_response->m_rsp = res; ! dom_ptr chkDataNode = dom_ptr(getresDataInfo(responseNode, "chkData")); ! if(chkDataNode->isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find chkData-element"); } ! dom_ptr chkChildNode = dom_ptr(chkDataNode->getFirstChildElement()); ! while (!chkChildNode->isNull()) { ! if(chkChildNode->getNodeName() == string(chkDataNode->getPrefix() + ":cd")) ! { ! if(m_response->m_results == NULL) ! m_response->m_results.ref(new epp_check_result_seq); ! ! epp_CheckResult chRes; ! ! string exists = chkChildNode->getAttribute("x"); ! // cout << "exists: " << exists << endl; ! if(exists == "+") ! chRes.m_exists.ref(new epp_boolean(true)); ! else if(exists == "-") ! chRes.m_exists.ref(new epp_boolean(false)); ! else ! throw epp_XMLException(__FILE__, __LINE__, "Empty or unknown x-attribute"); ! ! string value = chkChildNode->getNodeData(); ! if(!value.empty()) ! chRes.m_value.ref(new epp_string(value)); ! else ! throw epp_XMLException(__FILE__, __LINE__, "Empty cd-element"); ! // cout << "value: " << *chRes.m_value << endl; ! ! m_response->m_results->push_back(chRes); ! } // if "cd" ! chkChildNode = dom_ptr(chkChildNode->getNextSiblingElement()); } + + if(m_response->m_results == NULL) + throw epp_XMLException(__FILE__, __LINE__, "Unable to find cd-element(s)"); + } Index: epp_ContactCheck.h =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/epp_ContactCheck.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** epp_ContactCheck.h 9 Jul 2001 14:29:21 -0000 1.3 --- epp_ContactCheck.h 23 Feb 2002 04:36:05 -0000 1.3.2.1 *************** *** 1,5 **** /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001 Global Name Registry * * This library is free software; you can redistribute it and/or modify it --- 1,5 ---- /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001, 2002 The Global Name Registry, Limited * * This library is free software; you can redistribute it and/or modify it *************** *** 20,24 **** * * EPP RTK ! * GNR Ltd. * 125 High Holborn * London WC1V 6QA --- 20,24 ---- * * EPP RTK ! * The Global Name Registry, Limited * 125 High Holborn * London WC1V 6QA Index: epp_ContactCreate.cc =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/epp_ContactCreate.cc,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** epp_ContactCreate.cc 7 Feb 2002 18:19:46 -0000 1.5 --- epp_ContactCreate.cc 23 Feb 2002 04:36:05 -0000 1.5.2.1 *************** *** 1,5 **** /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001 Global Name Registry * * This library is free software; you can redistribute it and/or modify it --- 1,5 ---- /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001, 2002 The Global Name Registry, Limited * * This library is free software; you can redistribute it and/or modify it *************** *** 20,24 **** * * EPP RTK ! * GNR Ltd. * 125 High Holborn * London WC1V 6QA --- 20,24 ---- * * EPP RTK ! * The Global Name Registry, Limited * 125 High Holborn * London WC1V 6QA *************** *** 29,37 **** #include "epp_ContactCreate.h" #include <domtools/dom_output.h> ! #include <domtools/dom_tools.h> #include "data/epp_contactXMLbase.h" #include "data/epp_XMLException.h" - #include <dom/DOM.hpp> using namespace domtools; --- 29,36 ---- #include "epp_ContactCreate.h" #include <domtools/dom_output.h> ! #include <domtools/dom_wrapper.h> #include "data/epp_contactXMLbase.h" #include "data/epp_XMLException.h" using namespace domtools; *************** *** 53,57 **** epp_string epp_ContactCreate::toXML() { ! if(m_request == NULL || m_request->m_cmd == NULL || m_request->m_ascii_address == NULL || m_request->m_email == NULL || m_request->m_auth_info == NULL) --- 52,56 ---- epp_string epp_ContactCreate::toXML() { ! if(m_request == NULL || m_request->m_cmd == NULL || m_request->m_id == NULL || m_request->m_ascii_address == NULL || m_request->m_email == NULL || m_request->m_auth_info == NULL) *************** *** 76,79 **** --- 75,80 ---- setCommandSchemaAttributes(xml_request); + xml_request.putTag("contact:id",*m_request->m_id); + addAddressElement(xml_request, m_request->m_ascii_address, "contact:ascii"); addAddressElement(xml_request, m_request->m_i15d_address, "contact:i15d"); *************** *** 128,137 **** } ! void epp_ContactCreate::fromXML(const epp_string & xml) { ! DOM_Document doc = createDOM_Document(xml); ! DOM_Node resNode = getSingleTag(doc, "response"); ! if(resNode.isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find response-element"); --- 129,140 ---- } ! ! void epp_ContactCreate::fromXML(const eppobject::epp::epp_string & xml) { ! dom_ptr doc = createDOMDocument(xml); ! dom_ptr responseNode = dom_ptr(doc->getTag("response")); ! ! if(responseNode->isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find response-element"); *************** *** 140,162 **** m_response.ref(new epp_ContactCreateRsp()); ! epp_Response_ref res = createGenericResponse(resNode); m_response->m_rsp = res; ! DOM_Node creDataNode = getresDataInfo(resNode, "creData"); ! ! if(creDataNode.isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find creData-element"); } ! DOM_Node roidNode = ((DOM_Element*)&creDataNode)->getElementsByTagNameNS(creDataNode.getNamespaceURI(), "roid").item(0); ! if(roidNode.isNull()) { ! throw epp_XMLException(__FILE__, __LINE__, "Unable to find roid-element"); } ! ! string roid; ! getNodeData(roidNode, roid); ! m_response->m_roid.ref(new epp_roid(roid)); ! // cout << "roid: " << *m_response->m_roid << endl; } --- 143,165 ---- m_response.ref(new epp_ContactCreateRsp()); ! epp_Response_ref res = createGenericResponse(responseNode); m_response->m_rsp = res; ! dom_ptr creDataNode = dom_ptr(getresDataInfo(responseNode, "creData")); ! ! if(creDataNode->isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find creData-element"); } + + dom_ptr creChildNode = dom_ptr(creDataNode->getFirstChildElement()); ! if(!creChildNode->isNull() && creChildNode->getNodeName() == string(creDataNode->getPrefix() + ":id")) { ! m_response->m_id.ref(new epp_string(creChildNode->getNodeData())); ! // cout << "id: " << *m_response->m_id << endl; } ! else ! throw epp_XMLException(__FILE__, __LINE__, "Unable to find id-element"); ! } Index: epp_ContactCreate.h =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/epp_ContactCreate.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** epp_ContactCreate.h 9 Jul 2001 14:29:21 -0000 1.3 --- epp_ContactCreate.h 23 Feb 2002 04:36:05 -0000 1.3.2.1 *************** *** 1,5 **** /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001 Global Name Registry * * This library is free software; you can redistribute it and/or modify it --- 1,5 ---- /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001, 2002 The Global Name Registry, Limited * * This library is free software; you can redistribute it and/or modify it *************** *** 20,24 **** * * EPP RTK ! * GNR Ltd. * 125 High Holborn * London WC1V 6QA --- 20,24 ---- * * EPP RTK ! * The Global Name Registry, Limited * 125 High Holborn * London WC1V 6QA Index: epp_ContactDelete.cc =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/epp_ContactDelete.cc,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** epp_ContactDelete.cc 9 Jul 2001 14:29:21 -0000 1.5 --- epp_ContactDelete.cc 23 Feb 2002 04:36:05 -0000 1.5.2.1 *************** *** 1,5 **** /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001 Global Name Registry * * This library is free software; you can redistribute it and/or modify it --- 1,5 ---- /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001, 2002 The Global Name Registry, Limited * * This library is free software; you can redistribute it and/or modify it *************** *** 20,24 **** * * EPP RTK ! * GNR Ltd. * 125 High Holborn * London WC1V 6QA --- 20,24 ---- * * EPP RTK ! * The Global Name Registry, Limited * 125 High Holborn * London WC1V 6QA *************** *** 29,37 **** #include "epp_ContactDelete.h" #include <domtools/dom_output.h> ! #include <domtools/dom_tools.h> #include "data/epp_contactXMLbase.h" #include "data/epp_XMLException.h" - #include <dom/DOM.hpp> using namespace domtools; --- 29,36 ---- #include "epp_ContactDelete.h" #include <domtools/dom_output.h> ! #include <domtools/dom_wrapper.h> #include "data/epp_contactXMLbase.h" #include "data/epp_XMLException.h" using namespace domtools; *************** *** 54,58 **** { if(m_request == NULL || m_request->m_cmd == NULL ! || m_request->m_roid == NULL) { throw epp_XMLException(__FILE__, __LINE__, "Missing data in request"); --- 53,57 ---- { if(m_request == NULL || m_request->m_cmd == NULL ! || m_request->m_id == NULL) { throw epp_XMLException(__FILE__, __LINE__, "Missing data in request"); *************** *** 73,77 **** setCommandSchemaAttributes(xml_request); ! xml_request.putTag("contact:roid",*m_request->m_roid); xml_request.endTag("contact:delete"); --- 72,76 ---- setCommandSchemaAttributes(xml_request); ! xml_request.putTag("contact:id",*m_request->m_id); xml_request.endTag("contact:delete"); *************** *** 91,105 **** } ! void epp_ContactDelete::fromXML(const epp_string & xml) { ! DOM_Document doc = createDOM_Document(xml); ! DOM_Node resNode = getSingleTag(doc, "response"); ! if(resNode.isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find response-element"); } ! epp_Response_ref res = createGenericResponse(resNode); m_response.ref(new epp_ContactDeleteRsp(res)); --- 90,105 ---- } ! void epp_ContactDelete::fromXML(const eppobject::epp::epp_string & xml) { ! dom_ptr doc = createDOMDocument(xml); ! dom_ptr responseNode = dom_ptr(doc->getTag("response")); ! ! if(responseNode->isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find response-element"); } ! epp_Response_ref res = createGenericResponse(responseNode); m_response.ref(new epp_ContactDeleteRsp(res)); Index: epp_ContactDelete.h =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/epp_ContactDelete.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** epp_ContactDelete.h 9 Jul 2001 14:29:21 -0000 1.3 --- epp_ContactDelete.h 23 Feb 2002 04:36:05 -0000 1.3.2.1 *************** *** 1,5 **** /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001 Global Name Registry * * This library is free software; you can redistribute it and/or modify it --- 1,5 ---- /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001, 2002 The Global Name Registry, Limited * * This library is free software; you can redistribute it and/or modify it *************** *** 20,24 **** * * EPP RTK ! * GNR Ltd. * 125 High Holborn * London WC1V 6QA --- 20,24 ---- * * EPP RTK ! * The Global Name Registry, Limited * 125 High Holborn * London WC1V 6QA Index: epp_ContactInfo.cc =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/epp_ContactInfo.cc,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** epp_ContactInfo.cc 7 Feb 2002 18:19:46 -0000 1.7 --- epp_ContactInfo.cc 23 Feb 2002 04:36:05 -0000 1.7.2.1 *************** *** 1,5 **** /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001 Global Name Registry * * This library is free software; you can redistribute it and/or modify it --- 1,5 ---- /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001, 2002 The Global Name Registry, Limited * * This library is free software; you can redistribute it and/or modify it *************** *** 20,24 **** * * EPP RTK ! * GNR Ltd. * 125 High Holborn * London WC1V 6QA --- 20,24 ---- * * EPP RTK ! * The Global Name Registry, Limited * 125 High Holborn * London WC1V 6QA *************** *** 29,37 **** #include "epp_ContactInfo.h" #include <domtools/dom_output.h> ! #include <domtools/dom_tools.h> #include "data/epp_contactXMLbase.h" #include "data/epp_XMLException.h" - #include <dom/DOM.hpp> using namespace domtools; --- 29,36 ---- #include "epp_ContactInfo.h" #include <domtools/dom_output.h> ! #include <domtools/dom_wrapper.h> #include "data/epp_contactXMLbase.h" #include "data/epp_XMLException.h" using namespace domtools; *************** *** 53,57 **** { if(m_request == NULL || m_request->m_cmd == NULL ! || m_request->m_roid == NULL) { throw epp_XMLException(__FILE__, __LINE__, "Missing data in request"); --- 52,56 ---- { if(m_request == NULL || m_request->m_cmd == NULL ! || m_request->m_id == NULL) { throw epp_XMLException(__FILE__, __LINE__, "Missing data in request"); *************** *** 72,76 **** setCommandSchemaAttributes(xml_request); ! xml_request.putTag("contact:roid",*m_request->m_roid); xml_request.endTag("contact:info"); --- 71,75 ---- setCommandSchemaAttributes(xml_request); ! xml_request.putTag("contact:id",*m_request->m_id); xml_request.endTag("contact:info"); *************** *** 90,99 **** } ! void epp_ContactInfo::fromXML(const epp_string & xml) { ! DOM_Document doc = createDOM_Document(xml); ! DOM_Node resNode = getSingleTag(doc, "response"); ! if(resNode.isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find response-element"); --- 89,100 ---- } ! ! void epp_ContactInfo::fromXML(const eppobject::epp::epp_string & xml) { ! dom_ptr doc = createDOMDocument(xml); ! dom_ptr responseNode = dom_ptr(doc->getTag("response")); ! ! if(responseNode->isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find response-element"); *************** *** 102,245 **** m_response.ref(new epp_ContactInfoRsp()); ! epp_Response_ref res = createGenericResponse(resNode); m_response->m_rsp = res; - DOM_Node infDataNode = getresDataInfo(resNode, "infData"); ! if(infDataNode.isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find infData-element"); } - DOM_NodeList elemNodes = infDataNode.getChildNodes(); ! if(elemNodes.getLength() == 0) ! { ! throw epp_XMLException(__FILE__, __LINE__, "Empty infData-element"); ! } ! DOMString elemPrefix = infDataNode.getPrefix(); ! // <FIXME>This might not always work in all namespaces... (host:, obj:, osv)...</fixme> ! // <FIXME>Should we check that all mandatory fields present?</fixme> ! for(unsigned int i = 0; i < elemNodes.getLength(); i++) { ! DOM_Node elNode = elemNodes.item(i); ! if(elNode.getNodeName().equals(elemPrefix + ":roid")) { ! string roid; ! getNodeData(elNode, roid); ! m_response->m_roid.ref(new epp_roid(roid)); ! // cout << "roid: " << *m_response->m_roid << endl; ! } ! //<FIXME>linked part of status in new version...</fixme> ! /* else if(elNode.getNodeName().equals(elemPrefix + ":linked")) { ! string linkedtxt; ! getNodeData(elNode, linkedtxt); ! bool linked = false; ! if(linkedtxt == "true") linked = true; ! m_response->m_linked.ref(new epp_boolean(linked)); ! cout << "linked: " << linked << endl; ! }*/ ! else if(elNode.getNodeName().equals(elemPrefix + ":status")) { ! if(m_response->m_status == NULL) ! m_response->m_status.ref(new epp_contact_status_seq); ! ! epp_ContactStatus cStatus; ! string type, lang, value; ! getAttribute(elNode, "s", type); ! getAttribute(elNode, "lang", lang); ! getNodeData(elNode, value); ! ! if(!type.empty()) ! cStatus.m_type.ref(new epp_ContactStatusType(returnStatusEnumType(type))); ! if(!lang.empty()) ! cStatus.m_lang.ref(new epp_string(lang)); ! if(!value.empty()) ! cStatus.m_value.ref(new epp_string(value)); ! ! m_response->m_status->push_back(cStatus); ! // cout << "status: " << type << ", " << lang << ", " << value << endl; ! } ! else if(elNode.getNodeName().equals(elemPrefix + ":ascii")) { ! m_response->m_ascii_address.ref(new epp_ContactNameAddress(parseAddress(elNode))); ! } ! else if(elNode.getNodeName().equals(elemPrefix + ":i15d")) { ! m_response->m_i15d_address.ref(new epp_ContactNameAddress(parseAddress(elNode))); ! } ! else if(elNode.getNodeName().equals(elemPrefix + ":voice")) { ! ! m_response->m_voice.ref(new epp_ContactPhone()); ! string extension, value; ! getAttribute(elNode, "x", extension); ! getNodeData(elNode, value); ! ! if(!extension.empty()) ! m_response->m_voice->m_extension.ref(new epp_string(extension)); ! if(!value.empty()) ! m_response->m_voice->m_value.ref(new epp_string(value)); ! // cout << "voice: " << extension << ", " << value << endl; ! } ! else if(elNode.getNodeName().equals(elemPrefix + ":fax")) { ! m_response->m_fax.ref(new epp_ContactPhone()); ! string extension, value; ! getAttribute(elNode, "x", extension); ! getNodeData(elNode, value); ! ! if(!extension.empty()) ! m_response->m_fax->m_extension.ref(new epp_string(extension)); ! if(!value.empty()) ! m_response->m_fax->m_value.ref(new epp_string(value)); // cout << "fax: " << extension << ", " << value << endl; ! } ! else if(elNode.getNodeName().equals(elemPrefix + ":email")) { ! string email; ! getNodeData(elNode, email); ! m_response->m_email.ref(new epp_string(email)); ! // cout << "email: " << *m_response->m_email << endl; ! } ! else if(elNode.getNodeName().equals(elemPrefix + ":clID")) { ! string clID; ! getNodeData(elNode, clID); ! m_response->m_client_id.ref(new epp_string(clID)); ! // cout << "clID: " << *m_response->m_client_id << endl; ! } ! else if(elNode.getNodeName().equals(elemPrefix + ":crID")) { ! string crID; ! getNodeData(elNode, crID); ! m_response->m_created_by.ref(new epp_string(crID)); ! // cout << "crID: " << *m_response->m_created_by << endl; ! } ! else if(elNode.getNodeName().equals(elemPrefix + ":crDate")) { ! string crDate; ! getNodeData(elNode, crDate); ! m_response->m_created_date.ref(new epp_datetime(crDate)); ! // cout << "crDate: " << *m_response->m_created_date << endl; ! } ! else if(elNode.getNodeName().equals(elemPrefix + ":upID")) { ! string upID; ! getNodeData(elNode, upID); ! m_response->m_updated_by.ref(new epp_string(upID)); ! // cout << "upID: " << *m_response->m_updated_by << endl; ! } ! else if(elNode.getNodeName().equals(elemPrefix + ":upDate")) { ! string upDate; ! getNodeData(elNode, upDate); ! m_response->m_updated_date.ref(new epp_datetime(upDate)); ! // cout << "upDate: " << *m_response->m_updated_date << endl; ! } ! else if(elNode.getNodeName().equals(elemPrefix + ":trDate")) { ! string trDate; ! getNodeData(elNode, trDate); ! m_response->m_transfer_date.ref(new epp_datetime(trDate)); ! // cout << "trDate: " << *m_response->m_transfer_date << endl; ! } ! else if(elNode.getNodeName().equals(elemPrefix + ":authInfo")) { ! m_response->m_auth_info = createAuthInfoObject(elNode); ! } ! } } --- 103,261 ---- m_response.ref(new epp_ContactInfoRsp()); ! epp_Response_ref res = createGenericResponse(responseNode); m_response->m_rsp = res; ! dom_ptr infDataNode = dom_ptr(getresDataInfo(responseNode, "infData")); ! if(infDataNode->isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find infData-element"); } ! dom_ptr infChildNode = dom_ptr(infDataNode->getFirstChildElement()); ! if(infChildNode->isNull()) ! throw epp_XMLException(__FILE__, __LINE__, "Empty infData-element"); ! string elemPrefix = infDataNode->getPrefix(); ! ! while(!infChildNode->isNull()) { ! string nodeName = infChildNode->getNodeName(); ! if(nodeName == string(elemPrefix + ":roid")) ! { ! m_response->m_roid.ref(new epp_roid(infChildNode->getNodeData())); ! // cout << "roid: " << *m_response->m_roid << endl; ! } // if "roid" ! else if(nodeName == string(elemPrefix + ":id")) ! { ! m_response->m_id.ref(new epp_string(infChildNode->getNodeData())); ! // cout << "id: " << *m_response->m_id << endl; ! } // if "id" ! ! else if(nodeName == string(elemPrefix + ":status")) ! { ! if(m_response->m_status == NULL) ! m_response->m_status.ref(new epp_contact_status_seq); ! ! epp_ContactStatus cStatus; ! string type = infChildNode->getAttribute("s"); ! if(!type.empty()) { ! try { ! cStatus.m_type.ref(new epp_ContactStatusType(returnStatusEnumType(type))); ! } ! catch(...) { ! throw epp_XMLException(__FILE__, __LINE__, "Unknown StatusType in response"); ! } ! } ! ! string lang = infChildNode->getAttribute("lang"); ! if(!lang.empty()) ! cStatus.m_lang.ref(new epp_string(lang)); ! ! string value = infChildNode->getNodeData(); ! if(!value.empty()) ! cStatus.m_value.ref(new epp_string(value)); ! ! m_response->m_status->push_back(cStatus); ! // cout << "status: " << type << ", " << lang << ", " << value << endl; ! } // if "status" ! ! else if(nodeName == string(elemPrefix + ":ascii")) ! { ! m_response->m_ascii_address.ref(new epp_ContactNameAddress(parseAddress(infChildNode))); ! } // if "ascii" ! ! else if(nodeName == string(elemPrefix + ":i15d")) ! { ! m_response->m_i15d_address.ref(new epp_ContactNameAddress(parseAddress(infChildNode))); ! } // if "i15d" ! ! else if(nodeName == string(elemPrefix + ":voice")) ! { ! m_response->m_voice.ref(new epp_ContactPhone()); ! ! string extension = infChildNode->getAttribute("x"); ! if(!extension.empty()) ! m_response->m_voice->m_extension.ref(new epp_string(extension)); ! ! string value = infChildNode->getNodeData(); ! if(!value.empty()) ! m_response->m_voice->m_value.ref(new epp_string(value)); ! ! // cout << "voice: " << extension << ", " << value << endl; ! } // if "voice" ! ! else if(nodeName == string(elemPrefix + ":fax")) ! { ! m_response->m_fax.ref(new epp_ContactPhone()); ! ! string extension = infChildNode->getAttribute("x"); ! if(!extension.empty()) ! m_response->m_fax->m_extension.ref(new epp_string(extension)); ! ! string value = infChildNode->getNodeData(); ! if(!value.empty()) ! m_response->m_fax->m_value.ref(new epp_string(value)); ! // cout << "fax: " << extension << ", " << value << endl; ! } // if "fax" ! ! else if(nodeName == string(elemPrefix + ":email")) ! { ! m_response->m_email.ref(new epp_string(infChildNode->getNodeData())); ! // cout << "email: " << *m_response->m_email << endl; ! } // if "email" ! ! else if(nodeName == string(elemPrefix + ":clID")) ! { ! m_response->m_client_id.ref(new epp_string(infChildNode->getNodeData())); ! // cout << "clID: " << *m_response->m_client_id << endl; ! } // if "clID" ! ! else if(nodeName == string(elemPrefix + ":crID")) ! { ! m_response->m_created_by.ref(new epp_string(infChildNode->getNodeData())); ! // cout << "crID: " << *m_response->m_created_by << endl; ! } // if "crID" ! ! else if(nodeName == string(elemPrefix + ":crDate")) ! { ! m_response->m_created_date.ref(new epp_datetime(infChildNode->getNodeData())); ! // cout << "crDate: " << *m_response->m_created_date << endl; ! } // if "crDate" ! ! else if(nodeName == string(elemPrefix + ":upID")) ! { ! m_response->m_updated_by.ref(new epp_string(infChildNode->getNodeData())); ! // cout << "upID: " << *m_response->m_updated_by << endl; ! } // if "upID" ! else if(nodeName == string(elemPrefix + ":upDate")) ! { ! m_response->m_updated_date.ref(new epp_datetime(infChildNode->getNodeData())); ! // cout << "upDate: " << *m_response->m_updated_date << endl; ! } // if "upDate" ! ! else if(nodeName == string(elemPrefix + ":trDate")) ! { ! m_response->m_transfer_date.ref(new epp_datetime(infChildNode->getNodeData())); ! // cout << "trDate: " << *m_response->m_transfer_date << endl; ! } // if "trDate" ! ! else if(nodeName == string(elemPrefix + ":authInfo")) ! { ! m_response->m_auth_info = createAuthInfoObject(infChildNode); ! } // if "authInfo" ! ! infChildNode = dom_ptr(infChildNode->getNextSiblingElement()); ! } // while ! ! // <FIXME>Should we check that all mandatory fields present?</fixme> ! } Index: epp_ContactInfo.h =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/epp_ContactInfo.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** epp_ContactInfo.h 9 Jul 2001 14:29:21 -0000 1.3 --- epp_ContactInfo.h 23 Feb 2002 04:36:05 -0000 1.3.2.1 *************** *** 1,5 **** /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001 Global Name Registry * * This library is free software; you can redistribute it and/or modify it --- 1,5 ---- /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001, 2002 The Global Name Registry, Limited * * This library is free software; you can redistribute it and/or modify it *************** *** 20,24 **** * * EPP RTK ! * GNR Ltd. * 125 High Holborn * London WC1V 6QA --- 20,24 ---- * * EPP RTK ! * The Global Name Registry, Limited * 125 High Holborn * London WC1V 6QA Index: epp_ContactTransfer.cc =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/epp_ContactTransfer.cc,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** epp_ContactTransfer.cc 9 Jul 2001 14:29:21 -0000 1.4 --- epp_ContactTransfer.cc 23 Feb 2002 04:36:05 -0000 1.4.2.1 *************** *** 1,5 **** /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001 Global Name Registry * * This library is free software; you can redistribute it and/or modify it --- 1,5 ---- /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001, 2002 The Global Name Registry, Limited * * This library is free software; you can redistribute it and/or modify it *************** *** 20,24 **** * * EPP RTK ! * GNR Ltd. * 125 High Holborn * London WC1V 6QA --- 20,24 ---- * * EPP RTK ! * The Global Name Registry, Limited * 125 High Holborn * London WC1V 6QA *************** *** 29,37 **** #include "epp_ContactTransfer.h" #include <domtools/dom_output.h> ! #include <domtools/dom_tools.h> #include "data/epp_contactXMLbase.h" #include "data/epp_XMLException.h" - #include <dom/DOM.hpp> using namespace domtools; --- 29,36 ---- #include "epp_ContactTransfer.h" #include <domtools/dom_output.h> ! #include <domtools/dom_wrapper.h> #include "data/epp_contactXMLbase.h" #include "data/epp_XMLException.h" using namespace domtools; *************** *** 54,60 **** { if(m_request == NULL || m_request->m_cmd == NULL ! || m_request->m_roid == NULL || m_request->m_trans == NULL ! || m_request->m_trans->m_op == NULL ! || m_request->m_trans->m_auth_info == NULL) { throw epp_XMLException(__FILE__, __LINE__, "Missing data in request"); --- 53,58 ---- { if(m_request == NULL || m_request->m_cmd == NULL ! || m_request->m_id == NULL || m_request->m_trans == NULL ! || m_request->m_trans->m_op == NULL) { throw epp_XMLException(__FILE__, __LINE__, "Missing data in request"); *************** *** 76,83 **** setCommandSchemaAttributes(xml_request); ! xml_request.putTag("contact:roid",*m_request->m_roid); addAuthInfoElement(xml_request, m_request->m_trans->m_auth_info, "contact:authInfo"); ! ! xml_request.endTag("contact:transfer"); --- 74,80 ---- setCommandSchemaAttributes(xml_request); ! xml_request.putTag("contact:id",*m_request->m_id); addAuthInfoElement(xml_request, m_request->m_trans->m_auth_info, "contact:authInfo"); ! xml_request.endTag("contact:transfer"); *************** *** 97,106 **** } ! void epp_ContactTransfer::fromXML(const epp_string & xml) { ! DOM_Document doc = createDOM_Document(xml); ! DOM_Node resNode = getSingleTag(doc, "response"); ! if(resNode.isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find response-element"); --- 94,104 ---- } ! void epp_ContactTransfer::fromXML(const eppobject::epp::epp_string & xml) { ! dom_ptr doc = createDOMDocument(xml); ! dom_ptr responseNode = dom_ptr(doc->getTag("response")); ! ! if(responseNode->isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find response-element"); *************** *** 109,194 **** m_response.ref(new epp_ContactTransferRsp()); ! epp_Response_ref res = createGenericResponse(resNode); m_response->m_rsp = res; ! DOM_Node creDataNode = getresDataInfo(resNode, "trnData"); ! if(creDataNode.isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find trnData-element"); } ! DOM_Node roidNode = ((DOM_Element*)&creDataNode)->getElementsByTagNameNS(creDataNode.getNamespaceURI(), "roid").item(0); ! if(roidNode.isNull()) ! { ! throw epp_XMLException(__FILE__, __LINE__, "Unable to find roid-element"); ! } ! ! string roid; ! getNodeData(roidNode, roid); ! m_response->m_roid.ref(new epp_roid(roid)); ! // cout << "roid: " << *m_response->m_roid << endl; ! ! DOM_Node trStatusNode = ((DOM_Element*)&creDataNode)->getElementsByTagNameNS(creDataNode.getNamespaceURI(), "trStatus").item(0); ! if(trStatusNode.isNull()) ! { ! throw epp_XMLException(__FILE__, __LINE__, "Unable to find trStatus-element"); ! } ! ! string trStatus; ! getNodeData(trStatusNode, trStatus); ! try { ! m_response->m_transfer_status.ref(new epp_TransferStatusType(returnTransferStatusType(trStatus))); ! } ! catch(...) { ! throw epp_XMLException(__FILE__, __LINE__, "Unknown TransferStatusType in response"); ! } ! // cout << "trStatus: " << trStatus << endl; ! ! DOM_Node reIDNode = ((DOM_Element*)&creDataNode)->getElementsByTagNameNS(creDataNode.getNamespaceURI(), "reID").item(0); ! if(reIDNode.isNull()) { ! throw epp_XMLException(__FILE__, __LINE__, "Unable to find reID-element"); ! } ! ! string reID; ! getNodeData(reIDNode, reID); ! m_response->m_request_client_id.ref(new epp_string(reID)); ! // cout << "reID: " << *m_response->m_request_client_id << endl; ! DOM_Node reDateNode = ((DOM_Element*)&creDataNode)->getElementsByTagNameNS(creDataNode.getNamespaceURI(), "reDate").item(0); ! if(reDateNode.isNull()) ! { ! throw epp_XMLException(__FILE__, __LINE__, "Unable to find reDate-element"); ! } ! ! string reDate; ! getNodeData(reDateNode, reDate); ! m_response->m_request_date.ref(new epp_string(reDate)); ! // cout << "reDate: " << *m_response->m_request_date << endl; ! ! DOM_Node acIDNode = ((DOM_Element*)&creDataNode)->getElementsByTagNameNS(creDataNode.getNamespaceURI(), "acID").item(0); ! if(acIDNode.isNull()) ! { ! throw epp_XMLException(__FILE__, __LINE__, "Unable to find acID-element"); ! } ! ! string acID; ! getNodeData(acIDNode, acID); ! m_response->m_action_client_id.ref(new epp_string(acID)); ! // cout << "acID: " << *m_response->m_action_client_id << endl; ! DOM_Node acDateNode = ((DOM_Element*)&creDataNode)->getElementsByTagNameNS(creDataNode.getNamespaceURI(), "acDate").item(0); ! if(acDateNode.isNull()) ! { ! throw epp_XMLException(__FILE__, __LINE__, "Unable to find acDate-element"); } ! string acDate; ! getNodeData(acDateNode, acDate); ! m_response->m_action_date.ref(new epp_string(acDate)); ! // cout << "acDate: " << *m_response->m_action_date << endl; } --- 107,191 ---- m_response.ref(new epp_ContactTransferRsp()); ! epp_Response_ref res = createGenericResponse(responseNode); m_response->m_rsp = res; ! dom_ptr trnDataNode = dom_ptr(getresDataInfo(responseNode, "trnData")); ! if(trnDataNode->isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find trnData-element"); } ! dom_ptr trnChildNode = dom_ptr(trnDataNode->getFirstChildElement()); + string elemPrefix = trnDataNode->getPrefix(); ! while(!trnChildNode->isNull()) { ! string nodeName = trnChildNode->getNodeName(); ! ! if(nodeName == string(elemPrefix + ":id")) ! { ! m_response->m_id.ref(new epp_string(trnChildNode->getNodeData())); ! // cout << "id: " << *m_response->m_id << endl; ! } // if "id" ! ! else if(nodeName == string(elemPrefix + ":trStatus")) ! { ! string trStatus = trnChildNode->getNodeData(); ! try { ! m_response->m_transfer_status.ref(new epp_TransferStatusType(returnTransferStatusType(trStatus))); ! } ! catch(...) { ! throw epp_XMLException(__FILE__, __LINE__, "Unknown TransferStatusType in response"); ! } ! // cout << "trStatus: " << trStatus << endl; ! } // if "trStatus" ! ! else if(nodeName == string(elemPrefix + ":reID")) ! { ! m_response->m_request_client_id.ref(new epp_string(trnChildNode->getNodeData())); ! // cout << "reID: " << *m_response->m_request_client_id << endl; ! } // if "reID" ! else if(nodeName == string(elemPrefix + ":reDate")) ! { ! m_response->m_request_date.ref(new epp_string(trnChildNode->getNodeData())); ! // cout << "reDate: " << *m_response->m_request_date << endl; ! } // if "reDate" ! else if(nodeName == string(elemPrefix + ":acID")) ! { ! m_response->m_action_client_id.ref(new epp_string(trnChildNode->getNodeData())); ! // cout << "acID: " << *m_response->m_action_client_id << endl; ! } // if "acID" ! ! else if(nodeName == string(elemPrefix + ":acDate")) ! { ! m_response->m_action_date.ref(new epp_string(trnChildNode->getNodeData())); ! // cout << "acDate: " << *m_response->m_action_date << endl; ! } // if "acDate" ! ! trnChildNode = dom_ptr(trnChildNode->getNextSiblingElement()); } ! if(m_response->m_id == NULL) ! throw epp_XMLException(__FILE__, __LINE__, "Unable to find id-element"); ! ! if(m_response->m_transfer_status == NULL) ! throw epp_XMLException(__FILE__, __LINE__, "Unable to find trStatus-element"); ! ! if(m_response->m_request_client_id == NULL) ! throw epp_XMLException(__FILE__, __LINE__, "Unable to find reID-element"); + if(m_response->m_request_date == NULL) + throw epp_XMLException(__FILE__, __LINE__, "Unable to find reDate-element"); + + if(m_response->m_action_client_id == NULL) + throw epp_XMLException(__FILE__, __LINE__, "Unable to find acID-element"); + + if(m_response->m_action_date == NULL) + throw epp_XMLException(__FILE__, __LINE__, "Unable to find acDate-element"); + } + Index: epp_ContactTransfer.h =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/epp_ContactTransfer.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** epp_ContactTransfer.h 9 Jul 2001 14:29:21 -0000 1.3 --- epp_ContactTransfer.h 23 Feb 2002 04:36:05 -0000 1.3.2.1 *************** *** 1,5 **** /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001 Global Name Registry * * This library is free software; you can redistribute it and/or modify it --- 1,5 ---- /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001, 2002 The Global Name Registry, Limited * * This library is free software; you can redistribute it and/or modify it *************** *** 20,24 **** * * EPP RTK ! * GNR Ltd. * 125 High Holborn * London WC1V 6QA --- 20,24 ---- * * EPP RTK ! * The Global Name Registry, Limited * 125 High Holborn * London WC1V 6QA Index: epp_ContactUpdate.cc =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/epp_ContactUpdate.cc,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** epp_ContactUpdate.cc 7 Feb 2002 18:19:46 -0000 1.6 --- epp_ContactUpdate.cc 23 Feb 2002 04:36:05 -0000 1.6.2.1 *************** *** 1,5 **** /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001 Global Name Registry * * This library is free software; you can redistribute it and/or modify it --- 1,5 ---- /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001, 2002 The Global Name Registry, Limited * * This library is free software; you can redistribute it and/or modify it *************** *** 20,24 **** * * EPP RTK ! * GNR Ltd. * 125 High Holborn * London WC1V 6QA --- 20,24 ---- * * EPP RTK ! * The Global Name Registry, Limited * 125 High Holborn * London WC1V 6QA *************** *** 29,37 **** #include "epp_ContactUpdate.h" #include <domtools/dom_output.h> ! #include <domtools/dom_tools.h> #include "data/epp_contactXMLbase.h" #include "data/epp_XMLException.h" - #include <dom/DOM.hpp> using namespace domtools; --- 29,36 ---- #include "epp_ContactUpdate.h" #include <domtools/dom_output.h> ! #include <domtools/dom_wrapper.h> #include "data/epp_contactXMLbase.h" #include "data/epp_XMLException.h" using namespace domtools; *************** *** 54,58 **** { if(m_request == NULL || m_request->m_cmd == NULL ! || m_request->m_roid == NULL) { throw epp_XMLException(__FILE__, __LINE__, "Missing data in request"); --- 53,57 ---- { if(m_request == NULL || m_request->m_cmd == NULL ! || m_request->m_id == NULL) { throw epp_XMLException(__FILE__, __LINE__, "Missing data in request"); *************** *** 74,78 **** setCommandSchemaAttributes(xml_request); ! xml_request.putTag("contact:roid",*m_request->m_roid); addRemAddElement(xml_request, m_request->m_add, "add"); --- 73,77 ---- setCommandSchemaAttributes(xml_request); ! xml_request.putTag("contact:id",*m_request->m_id); addRemAddElement(xml_request, m_request->m_add, "add"); *************** *** 96,117 **** } ! void epp_ContactUpdate::fromXML(const epp_string & xml) { ! DOM_Document doc = createDOM_Document(xml); ! DOM_Node resNode = getSingleTag(doc, "response"); ! if(resNode.isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find response-element"); } ! epp_Response_ref res = createGenericResponse(resNode); m_response.ref(new epp_ContactUpdateRsp(res)); } ! void epp_ContactUpdate::addRemAddElement(EPP_output & outputobject, const epp_ContactUpdateAddRemove_ref element, ! const epp_string & mode) { if(element == NULL) --- 95,117 ---- } ! void epp_ContactUpdate::fromXML(const eppobject::epp::epp_string & xml) { ! dom_ptr doc = createDOMDocument(xml); ! dom_ptr responseNode = dom_ptr(doc->getTag("response")); ! ! if(responseNode->isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find response-element"); } ! epp_Response_ref res = createGenericResponse(responseNode); m_response.ref(new epp_ContactUpdateRsp(res)); } ! void epp_ContactUpdate::addRemAddElement(eppobject::epp::EPP_output & outputobject, const epp_ContactUpdateAddRemove_ref element, ! const eppobject::epp::epp_string & mode) { if(element == NULL) *************** *** 143,147 **** } ! void epp_ContactUpdate::addChangeElement(EPP_output & outputobject, const epp_ContactUpdateChange_ref element) { --- 143,147 ---- } ! void epp_ContactUpdate::addChangeElement(eppobject::epp::EPP_output & outputobject, const epp_ContactUpdateChange_ref element) { Index: epp_ContactUpdate.h =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/epp_ContactUpdate.h,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** epp_ContactUpdate.h 9 Jul 2001 14:29:21 -0000 1.4 --- epp_ContactUpdate.h 23 Feb 2002 04:36:05 -0000 1.4.2.1 *************** *** 1,5 **** /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001 Global Name Registry * * This library is free software; you can redistribute it and/or modify it --- 1,5 ---- /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001, 2002 The Global Name Registry, Limited * * This library is free software; you can redistribute it and/or modify it *************** *** 20,24 **** * * EPP RTK ! * GNR Ltd. * 125 High Holborn * London WC1V 6QA --- 20,24 ---- * * EPP RTK ! * The Global Name Registry, Limited * 125 High Holborn * London WC1V 6QA Index: epp_DomainCheck.cc =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/epp_DomainCheck.cc,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** epp_DomainCheck.cc 9 Jul 2001 14:29:21 -0000 1.4 --- epp_DomainCheck.cc 23 Feb 2002 04:36:05 -0000 1.4.2.1 *************** *** 1,5 **** /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001 Global Name Registry * * This library is free software; you can redistribute it and/or modify it --- 1,5 ---- /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001, 2002 The Global Name Registry, Limited * * This library is free software; you can redistribute it and/or modify it *************** *** 20,24 **** * * EPP RTK ! * GNR Ltd. * 125 High Holborn * London WC1V 6QA --- 20,24 ---- * * EPP RTK ! * The Global Name Registry, Limited * 125 High Holborn * London WC1V 6QA *************** *** 29,37 **** #include "epp_DomainCheck.h" #include <domtools/dom_output.h> ! #include <domtools/dom_tools.h> #include "data/epp_domainXMLbase.h" #include "data/epp_XMLException.h" - #include <dom/DOM.hpp> using namespace domtools; --- 29,36 ---- #include "epp_DomainCheck.h" #include <domtools/dom_output.h> ! #include <domtools/dom_wrapper.h> #include "data/epp_domainXMLbase.h" #include "data/epp_XMLException.h" using namespace domtools; *************** *** 95,151 **** } ! void epp_DomainCheck::fromXML(const epp_string & xml) { ! DOM_Document doc = createDOM_Document(xml); ! DOM_Node resNode = getSingleTag(doc, "response"); ! if(resNode.isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find response-element"); } ! epp_Response_ref res = createGenericResponse(resNode); m_response.ref(new epp_DomainCheckRsp()); m_response->m_rsp = res; ! DOM_Node chkDataNode = getresDataInfo(resNode, "chkData"); ! ! if(chkDataNode.isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find chkData-element"); } - - DOM_NodeList cdNodes = ((DOM_Element*)&chkDataNode)->getElementsByTagNameNS(chkDataNode.getNamespaceURI(), "cd"); - - if(cdNodes.getLength() == 0) - { - throw epp_XMLException(__FILE__, __LINE__, "Unable to find cd-element(s)"); - } ! m_response->m_results.ref(new epp_check_result_seq); ! for(unsigned int i = 0; i < cdNodes.getLength(); i++) { ! DOM_Node cdNode = cdNodes.item(i); ! ! epp_CheckResult chRes; ! ! string exists; ! getAttribute(cdNode, "x", exists); ! // cout << "exists: " << exists << endl; ! ! if(exists == "+") ! chRes.m_exists.ref(new epp_boolean(true)); ! else ! chRes.m_exists.ref(new epp_boolean(false)); ! ! string value; ! getNodeData(cdNode, value); ! chRes.m_value.ref(new epp_string(value)); ! // cout << "value: " << *chRes.m_value << endl; ! m_response->m_results->push_back(chRes); } } --- 94,153 ---- } ! void epp_DomainCheck::fromXML(const eppobject::epp::epp_string & xml) { ! dom_ptr doc = createDOMDocument(xml); ! dom_ptr responseNode = dom_ptr(doc->getTag("response")); ! ! if(responseNode->isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find response-element"); } ! epp_Response_ref res = createGenericResponse(responseNode); m_response.ref(new epp_DomainCheckRsp()); m_response->m_rsp = res; ! dom_ptr chkDataNode = dom_ptr(getresDataInfo(responseNode, "chkData")); ! if(chkDataNode->isNull()) { throw epp_XMLException(__FILE__, __LINE__, "Unable to find chkData-element"); } ! dom_ptr chkChildNode = dom_ptr(chkDataNode->getFirstChildElement()); ! while(!chkChildNode->isNull()) { ! if(chkChildNode->getNodeName() == string(chkDataNode->getPrefix() + ":cd")) ! { ! if(m_response->m_results == NULL) ! m_response->m_results.ref(new epp_check_result_seq); ! ! epp_CheckResult chRes; ! ! string exists = chkChildNode->getAttribute("x"); ! // cout << "exists: " << exists << endl; ! if(exists == "+") ! chRes.m_exists.ref(new epp_boolean(true)); ! else if(exists == "-") ! chRes.m_exists.ref(new epp_boolean(false)); ! else ! throw epp_XMLException(__FILE__, __LINE__, "Empty or unknown x-attribute"); ! ! string value = chkChildNode->getNodeData(); ! if(!value.empty()) ! chRes.m_value.ref(new epp_string(value)); ! else ! throw epp_XMLException(__FILE__, __LINE__, "Empty cd-element"); ! // cout << "value: " << *chRes.m_value << endl; ! ! m_response->m_results->push_back(chRes); ! } // if "cd" ! chkChildNode = dom_ptr(chkChildNode->getNextSiblingElement()); } + if(m_response->m_results == NULL) + throw epp_XMLException(__FILE__, __LINE__, "Unable to find cd-element(s)"); } Index: epp_DomainCheck.h =================================================================== RCS file: /cvsroot/epp-rtk/epp-rtk/c++/src/epp_DomainCheck.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** epp_DomainCheck.h 9 Jul 2001 14:29:21 -0000 1.3 --- epp_DomainCheck.h 23 Feb 2002 04:36:05 -0000 1.3.2.1 *************** *** 1,5 **** /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001 Global Name Registry * * This library is free software; you can redistribute it and/or modify it --- 1,5 ---- /************************************************************************ * EPP RTK C++ ! * Copyright (C) 2001, 2002 The Global Name Registry, Limited * * This library is free software; you can redistribute it and/or modify it *************** *** 20,24 **** * * ... [truncated message content] |