I'm in the progress of implementing support for the .NO registry (Norid).
Norid provides additional details to a response in the extension
element of a response. Example:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <epp xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:ietf:params:xml:ns:epp-1.0" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd"> <response> <result code="2306"> <msg>Parameter value policy error</msg> </result> <extension> <conditions xmlns="http://www.norid.no/xsd/no-ext-result-1.0" xsi:schemaLocation="http://www.norid.no/xsd/no-ext-result-1.0 no-ext-result-1.0.xsd"> <condition code="EC001025" severity="info"> <msg>Command failed</msg> <details>Failed to update domain [xxxxx.no].</details> </condition> <condition code="EC003009" severity="error"> <msg>No such host</msg> <details>Host [ns01.xxxxx.no] not found in the registry.</details> </condition> </conditions> </extension> <trID> <svTRID>20160217090845633968-268jgf-regX-NORID</svTRID> </trID> </response> </epp>
EDIT: Pastebin with proper linebreaks and indentation: http://pastebin.com/mU7AWJyG
These conditions are present whenever there were errors, so ideally the conditions would be available in all response objects. It's tempting to just add the support directly in EppResponse.cs
, and this would work fine for us (we don't use any of the other registries that this project supports). However, I would like to contribute my work to this project once I'm done, so I should probably find a better approach. I'm however in lack of good ideas on how to do do this in a "proper" way (without having to duplicate loads of code and altering "core" files).
For e.g. contact info responses, I have a NoridContactInfoResponse
class with ContactInfoResponse
as its base class. Do I need to duplicate ContactInfoResponse
, and have it use my customized version of EppResponse
(NoridEppResponse
as I've called it, where I've overridden ProcessExtensionNode()
to fetch the condition
elements).
Another example is contact creation, where I have a NoridContactCreate
class, using Entities.ContactCreate
as its base.
The base of Entities.ContactCreate
is ContactBase<ContactCreateResponse>
.
The base of ContactCreateResponse
is EppResponse
.
In order to not change any of the "core files", I would need to duplicate Entities.ContactCreate
and ContactCreateResponse
, and make the latter use NoridEppResponse
as its base to achieve my goal.
Am I right, or am I missing something? What do you suggest as the best way of doing this? Any cleaner way that I'm not seeing?