Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SOAP::Lite Generating <c-gensym .. > how do I get rid of it?

Tags:

soap

xml

perl

Here's what I believe to be the relevant SOAP::Lite code

my $req3 = SOAP::Lite->new(
    readable => 1,
    autotype => 0,
    proxy    => 'https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor',
);

$req3->requestMessage(
    \SOAP::Data->new(
        name => 'item',
        attr => { foo => '0' },
        value => \SOAP::Data->new(
            name => 'foo',
            value => 1,
        ),
     ),
);

It's generating this XML

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<requestMessage>
  <c-gensym9>
    <item foo="0">
      <foo>1</foo>
    </item>
  </c-gensym9>
</requestMessage>
</soap:Body>

I can't figure out why <c-gensym9 /> is nested inside of <requestMessage> but I need to not be there. Can anyone explain why it's there? and how I can rewrite the code so that it isn't?

like image 951
xenoterracide Avatar asked Aug 08 '11 18:08

xenoterracide


1 Answers

Look ma, no gensym

$req3->requestMessage(
   ## \SOAP::Data->new( ## this makes gensym
    SOAP::Data->new( ## no refref, no gensym
        name => 'item',
        attr => { foo => '0' },
        value => \SOAP::Data->new(
            name => 'foo',
            value => 1,
        ),
     ),
);

see also http://perlmonks.com/?node_id=906383

like image 106
wantpretty Avatar answered Nov 10 '22 15:11

wantpretty