Menu

#25 EPPXXXInfo sets m_lang with empty if non-exist for response

RTK Java 0.7.1
open
nobody
5
2006-04-24
2006-04-24
eric wang
No

From Michael Schout:

Hi.

I have discovered a small problem with EPPDomainInfo
when using EPP RTK
with .NAME.

The problem is that if the EPP server responds to an
EPP Domain Info
request with <domain:status> nodes that do not include
a "lang"
attribute, then the epp_DomainStatus object created for
that node will
have an m_lang attribute that is an empty string ("")
rather than null.

If you feed that epp_DomainStatus() object directly
into an EPP Domain
Update command, EPP RTK will generate XML that looks
like this:

<domain:status lang="" s="clientTransferProhibited"/>

notice the "lang" attribute is empty.

Apparently the .name EPP server does not like this, and
it rejects the
update with an XML validation error.

The source of this problem is in EPPDomainInfo.java, in
the fromXML()
function, this line:

status.m_lang = ((Element)a_node).getAttribute("lang");

xerces apparently gives you back an empty string
instead of "null", if
the attribute is not present.

The attached patch changes
com/tucows/oxrs/*/xml/rtk/EPPDomainInfo.java
and fixes the fromXML() function so that the
epp_DomainStatus' m_lang
attribute is only changed from null if the lang
attribute is not empty
(and not null).

It might make sense to also check for this in
EPPDomainUpdate.toXML()
just for sanity. Currently it is only checking if
m_lang is null there,
not empty.

Regards,
Michael Schout

Discussion


Log in to post a comment.