這就是我認爲是相關的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