这就是我认为是相关的SOAP ::精简版代码SOAP :: Lite生成<c-gensym ..>我该如何摆脱它?
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,
),
),
);
它生成此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>
为什么<c-gensym9 />
嵌套的<requestMessage>
内我想不出但我不需要在那里。任何人都可以解释为什么它在那里?以及我如何重写代码,使其不是?
是我发现后...不幸的是它的链接都死了...所以它也没用。 – xenoterracide
@JT更新我的代码是一个完整的示例 – xenoterracide
该文章中的链接可以在http://www.techrepublic.com/article/a-hands-on-tour-of-soaplite/1045078和http: //web.archive.org/web/20070308122644/http://www.majordojo.com/archives/2003_04.html – Ether