这就是我认为相关的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
原文链接:https://www.f2er.com/xml/292581.html$req3->requestMessage( ## \SOAP::Data->new( ## this makes gensym SOAP::Data->new( ## no refref,no gensym name => 'item',);