Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response->data() bails too early #16

Closed
johnny-bit opened this issue Nov 23, 2015 · 1 comment
Closed

Response->data() bails too early #16

johnny-bit opened this issue Nov 23, 2015 · 1 comment
Labels
Milestone

Comments

@johnny-bit
Copy link
Collaborator

Hi!

Current implementation of Response->data() method bails too early - returns empty response where response from epp has data, but only in extension part.

for example:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="http://www.dns.pl/nask-epp-schema/epp-2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:extreport="http://www.dns.pl/nask-epp-schema/extreport-2.0" xsi:schemaLocation="http://www.dns.pl/nask-epp-schema/epp-2.0 epp-2.0.xsd">
    <response>
        <result code="1000">
            <msg lang="en">Command completed successfully</msg>
        </result>
        <extension>
            <extreport:reportData xmlns:extreport="http://www.dns.pl/nask-epp-schema/extreport-2.0" xsi:schemaLocation="http://www.dns.pl/nask-epp-schema/extreport-2.0 extreport-2.0.xsd">
                <extreport:domDataRsp>
                    <extreport:domData>
                        <extreport:name>example1.pl</extreport:name>
                        <extreport:roid>1234-NASK</extreport:roid>
                        <extreport:exDate>2007-03-18T23:00:00.0Z</extreport:exDate>
                        <extreport:statuses>
                            <extreport:status>serverHold</extreport:status>
                        </extreport:statuses>
                    </extreport:domData>
                </extreport:domDataRsp>
                <extreport:offset>0</extreport:offset>
                <extreport:limit>1</extreport:limit>
                <extreport:size>2</extreport:size>
            </extreport:reportData>
        </extension>
        <trID>
            <svTRID>WI4332607665</svTRID>
        </trID>
    </response>
</epp>

This is due to

        $nodes = $this->get('//epp:epp/epp:response/epp:resData');
        if ($nodes === false || !($nodes instanceof DOMNodeList) || $nodes->length === 0 || !$nodes->item(0)->hasChildNodes()) {
            return;
        }

I'll write something that seems sane in a bit. Tossing this here so I don't forget 😉

@lifeofguenter
Copy link
Member

Ouch. Seems legit, according to rfc5730:

An OPTIONAL (response data) element that contains child elements specific to the command and associated object.

But I have a feeling the whole Response class/framework needs some work.

Thanks so much for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants