这是我认为相关的 SOAP::Lite 代码
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>
中但我不需要在那里。谁能解释为什么它在那里?以及我如何重写代码以使其不是?
最佳答案
看妈妈,没有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,
),
),
);
关于xml - SOAP::Lite Generating <c-gensym .. > 我该如何摆脱它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6986679/