views:

41

answers:

1

This is the SOAP document I'm trying to model using SOAP::Lite.

<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
<SOAP-ENV:Body>
<GetOrderByPartnerOrderID xmlns="http://api.geotrust.com/webtrust/query"&gt;
    <Request>
        <QueryRequestHeader>
            <PartnerCode>partnercode</PartnerCode>
            <AuthToken>
                <UserName>username</UserName>
                <Password>password</Password>
            </AuthToken>
        </QueryRequestHeader>
        <PartnerOrderID>partnerid</PartnerOrderID>
    </Request>
</GetOrderByPartnerOrderID>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Here is the Perl code I'm using to model this document.

my $params = SOAP::Data->name("Request" =>
               \SOAP::Data->value => (
                   \SOAP::Data->name("QueryRequestHeader" => 
                       \SOAP::Data->value(
                          SOAP::Data->name("PartnerCode" => $partnercode),
                          SOAP::Data->name("AuthToken" => 
                             \SOAP::Data->value(
                                 SOAP::Data->name("UserName" => $username), 
                                 SOAP::Data->name("Password" => $password)
                              )
                           )
                        )
                   ),
                   \SOAP::Data->name("PartnerOrderID" => $poid)
                );

However, the SOAP Document generated by this code (I'm using SOAP::Lite with trace on) is as follows:

<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
<SOAP-ENV:Body>
    <GetOrderByPartnerOrderID xmlns="http://api.geotrust.com/webtrust/query"&gt;
        <Request>
            <QueryRequestHeader>
                <PartnerCode>partnercode</PartnerCode>
                <AuthToken>
                    <UserName>username</UserName>
                    <Password>password</Password>
                </AuthToken>
            </QueryRequestHeader>
        </Request>
        <Request>
            <PartnerOrderID>partnerid</PartnerOrderID>
        </Request>
    </GetOrderByPartnerOrderID>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

For some reason, it closes the Request tag, and then opens it again. It seems like it should be an easy fix, but I've tried everything I can think of and can't figure it out. Any help would be greatly appreciated.

A: 

Figured it out. Had \SOAP::Data->value => ( instead of \SOAP::Data->value(.

Sean Nilan