4
因此,這裏是我的SOAP::Lite
代碼移動到XML ::編譯:: SOAP
#!/usr/bin/perl
use 5.006;
use strict;
use warnings;
use SOAP::Lite +trace => [ 'debug' ];
my $req1 = SOAP::Lite->new(
readable => 1,
autotype => 0,
proxy => 'https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor',
);
$req1->requestMessage(
\SOAP::Data->new(
name => 'item',
attr => { foo => '0' },
value => \SOAP::Data->new(
name => 'foo',
value => 1,
),
),
);
它生成此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>
</soap:Envelope>
我怎麼能產生同樣的事情(不gensym's)使用XML::Compile::SOAP
?
這個例子忽略了富=「0」屬性 – plusplus