<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Olá à todos, </FONT></DIV>
<DIV><FONT face=Arial size=2>Não conheço bem o módulo XML::Simple&nbsp;e não sei 
como traduzir os dados corretamente.</FONT></DIV>
<DIV><FONT face=Arial size=2>Se alguém puder ajudar, fico grato..</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>A resposta que recebo do servidor está aqui e 
o&nbsp;código está abaixo:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>===========================================================</FONT></DIV>
<DIV><FONT face=Arial size=2>$VAR1 = { 'xmlns:xsi' =&gt; 
'http://www.w3.org/2001/XMLSchema-instance', 'soap:Body' =&gt; { 
'getUserTransactionsResponse' =&gt; { 'xmlns' =&gt; 'vscws', 
'getUserTransactionsResult' =&gt; { 'VSC' =&gt; { 'xmlns' =&gt; '', 
'userTransactions' =&gt; [ { 'Time' =&gt; '1:00', 'Limit' =&gt; '5', 'DNIS' 
=&gt; '56012', 'destinationDescription' =&gt; "Brasil - S\x{e3}o Paulo - 
\x{c1}rea 11 - Celular", 'Income' =&gt; '0.0000', 'controlNumber' =&gt; 
'2414568', 'ANI' =&gt; '1145822125', 'DestinationNumber' =&gt; '551199117099', 
'Balance' =&gt; '-44.024', 'startTime' =&gt; '2009-11-27 17:28:45', 'Cost' =&gt; 
'0.89', 'transactionDescription' =&gt; 'Termination', 'billing' =&gt; 'Limited', 
'RealTime' =&gt; '0:22' }, { 'Time' =&gt; '1:00', 'Limit' =&gt; '5', 'DNIS' 
=&gt; '56012', 'destinationDescription' =&gt; 'Brasil - Roc', 'Income' =&gt; 
'0.0000', 'controlNumber' =&gt; '2414568', 'ANI' =&gt; '1145822125', 
'DestinationNumber' =&gt; '551145215888', 'Balance' =&gt; '-44.314', 'startTime' 
=&gt; '2009-11-27 17:25:45', 'Cost' =&gt; '0.29', 'transactionDescription' =&gt; 
'Termination', 'billing' =&gt; 'Limited', 'RealTime' =&gt; '0:19' }, { 'Time' 
=&gt; '1:00', 'Limit' =&gt; '5', 'DNIS' =&gt; '56012', 'destinationDescription' 
=&gt; 'Brasil - Roc', 'Income' =&gt; '0.0000', 'controlNumber' =&gt; '2414568', 
'ANI' =&gt; '1145822125', 'DestinationNumber' =&gt; '551145215888', 'Balance' 
=&gt; '-44.604', 'startTime' =&gt; '2009-11-27 17:16:30', 'Cost' =&gt; '0.29', 
'transactionDescription' =&gt; 'Termination', 'billing' =&gt; 'Limited', 
'RealTime' =&gt; '0:24' }, { 'Time' =&gt; '1:00', 'Limit' =&gt; '5', 'DNIS' 
=&gt; '56012', 'destinationDescription' =&gt; 'Brasil -', 'Income' =&gt; 
'0.0000', 'controlNumber' =&gt; '2414568', 'ANI' =&gt; '1145822125', 
'DestinationNumber' =&gt; '551164545504', 'Balance' =&gt; '-45.494', 'startTime' 
=&gt; '2009-11-27 17:06:44', 'Cost' =&gt; '0.89', 'transactionDescription' =&gt; 
'Termination', 'billing' =&gt; 'Limited', 'RealTime' =&gt; '0:12' }, { 'Time' 
=&gt; '1:48', 'Limit' =&gt; '5', 'DNIS' =&gt; '56012', 'destinationDescription' 
=&gt; 'Brasil - Roc', 'Income' =&gt; '0.0000', 'controlNumber' =&gt; '2414568', 
'ANI' =&gt; '1130337016', 'DestinationNumber' =&gt; '551130337005', 'Balance' 
=&gt; '-46.016', 'startTime' =&gt; '2009-11-27 12:19:22', 'Cost' =&gt; '0.522', 
'transactionDescription' =&gt; 'Termination', 'billing' =&gt; 'Limited', 
'RealTime' =&gt; '1:43' }, { 'Time' =&gt; '1:00', 'Limit' =&gt; '5', 'DNIS' 
=&gt; '56012', 'destinationDescription' =&gt; "Brasil - S\x{e3}o Paulo - 
\x{c1}rea 11 - Celular", 'Income' =&gt; '0.0000', 'controlNumber' =&gt; 
'2414568', 'ANI' =&gt; '1130337016', 'DestinationNumber' =&gt; '551199117099', 
'Balance' =&gt; '-46.906', 'startTime' =&gt; '2009-11-27 12:20:28', 'Cost' =&gt; 
'0.89', 'transactionDescription' =&gt; 'Termination', 'billing' =&gt; 'Limited', 
'RealTime' =&gt; '0:13' }, { 'Time' =&gt; '1:00', 'Limit' =&gt; '5', 'DNIS' 
=&gt; '56012', 'destinationDescription' =&gt; "Brasil - S\x{e3}o Paulo - 
\x{c1}rea 11 - Celular", 'Income' =&gt; '0.0000', 'controlNumber' =&gt; 
'2414568', 'ANI' =&gt; '1130337016', 'DestinationNumber' =&gt; '551199117099', 
'Balance' =&gt; '-47.796', 'startTime' =&gt; '2009-11-27 12:07:35', 'Cost' =&gt; 
'0.89', 'transactionDescription' =&gt; 'Termination', 'billing' =&gt; 'Limited', 
'RealTime' =&gt; '0:20' }, { 'Time' =&gt; '1:00', 'Limit' =&gt; '5', 'DNIS' 
=&gt; '56012', 'destinationDescription' =&gt; 'Brasil - Roc', 'Income' =&gt; 
'0.0000', 'controlNumber' =&gt; '2414568', 'ANI' =&gt; '1130337016', 
'DestinationNumber' =&gt; '551130337005', 'Balance' =&gt; '-48.086', 'startTime' 
=&gt; '2009-11-27 12:06:08', 'Cost' =&gt; '0.29', 'transactionDescription' =&gt; 
'Termination', 'billing' =&gt; 'Limited', 'RealTime' =&gt; '0:21' }, { 'Time' 
=&gt; '0:00', 'Limit' =&gt; '5', 'DNIS' =&gt; {}, 'destinationDescription' =&gt; 
{}, 'Income' =&gt; '50', 'controlNumber' =&gt; '2414568', 'ANI' =&gt; {}, 
'DestinationNumber' =&gt; {}, 'Balance' =&gt; '1.914', 'startTime' =&gt; 
'2009-11-26 18:05:36', 'Cost' =&gt; '0.0000', 'transactionDescription' =&gt; 
'Payment', 'billing' =&gt; 'Limited', 'RealTime' =&gt; '0:00' }, { 'Time' =&gt; 
'1:00', 'Limit' =&gt; '5', 'DNIS' =&gt; '30338031', 'destinationDescription' 
=&gt; 'Brasil - Roc', 'Income' =&gt; '0.0000', 'controlNumber' =&gt; '2414568', 
'ANI' =&gt; '1145822125', 'DestinationNumber' =&gt; '551145215888', 'Balance' 
=&gt; '1.624', 'startTime' =&gt; '2009-11-25 18:11:25', 'Cost' =&gt; '0.29', 
'transactionDescription' =&gt; 'Termination', 'billing' =&gt; 'Limited', 
'RealTime' =&gt; '0:47' }, { 'Time' =&gt; '1:00', 'Limit' =&gt; '5', 'DNIS' 
=&gt; '56012', 'destinationDescription' =&gt; 'Brasil - Roc', 'Income' =&gt; 
'0.0000', 'controlNumber' =&gt; '2414568', 'ANI' =&gt; '1145822125', 
'DestinationNumber' =&gt; '551155478001', 'Balance' =&gt; '1.334', 'startTime' 
=&gt; '2009-11-25 11:55:47', 'Cost' =&gt; '0.29', 'transactionDescription' =&gt; 
'Termination', 'billing' =&gt; 'Limited', 'RealTime' =&gt; '0:09' }, { 'Time' 
=&gt; '1:00', 'Limit' =&gt; '5', 'DNIS' =&gt; '56012', 'destinationDescription' 
=&gt; 'Brasil - Roc', 'Income' =&gt; '0.0000', 'controlNumber' =&gt; '2414568', 
'ANI' =&gt; '1145822125', 'DestinationNumber' =&gt; '551140040435', 'Balance' 
=&gt; '1.044', 'startTime' =&gt; '2009-11-25 11:48:00', 'Cost' =&gt; '0.29', 
'transactionDescription' =&gt; 'Termination', 'billing' =&gt; 'Limited', 
'RealTime' =&gt; '0:07' }, { 'Time' =&gt; '1:36', 'Limit' =&gt; '5', 'DNIS' 
=&gt; '56012', 'destinationDescription' =&gt; 'Brasil - Roc', 'Income' =&gt; 
'0.0000', 'controlNumber' =&gt; '2414568', 'ANI' =&gt; '1145822125', 
'DestinationNumber' =&gt; '551140040435', 'Balance' =&gt; '0.58', 'startTime' 
=&gt; '2009-11-25 11:09:02', 'Cost' =&gt; '0.464', 'transactionDescription' 
=&gt; 'Termination', 'billing' =&gt; 'Limited', 'RealTime' =&gt; '1:31' }, { 
'Time' =&gt; '1:00', 'Limit' =&gt; '5', 'DNIS' =&gt; '56012', 
'destinationDescription' =&gt; 'Brasil - Roc', 'Income' =&gt; '0.0000', 
'controlNumber' =&gt; '2414568', 'ANI' =&gt; '1145822125', 'DestinationNumber' 
=&gt; '551138330767', 'Balance' =&gt; '0.29', 'startTime' =&gt; '2009-11-25 
10:11:35', 'Cost' =&gt; '0.29', 'transactionDescription' =&gt; 'Termination', 
'billing' =&gt; 'Limited', 'RealTime' =&gt; '0:47' }, { 'Time' =&gt; '1:00', 
'Limit' =&gt; '5', 'DNIS' =&gt; '56012', 'destinationDescription' =&gt; 'Brasil 
- Roc', 'Income' =&gt; '0.0000', 'controlNumber' =&gt; '2414568', 'ANI' =&gt; 
'1145822125', 'DestinationNumber' =&gt; '551138330767', 'Balance' =&gt; 
'0.0000', 'startTime' =&gt; '2009-11-25 09:50:25', 'Cost' =&gt; '0.29', 
'transactionDescription' =&gt; 'Termination', 'billing' =&gt; 'Limited', 
'RealTime' =&gt; '0:52' } ], 'Val' =&gt; { 'UserID' =&gt; '2414568' }, 'STATUS' 
=&gt; '0' } } } }, 'xmlns:xsd' =&gt; 'http://www.w3.org/2001/XMLSchema', 
'xmlns:soap' =&gt; 'http://schemas.xmlsoap.org/soap/envelope/' }; 
<BR>=====================================================================</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>use LWP::UserAgent;<BR>use HTTP::Request;<BR>use 
XML::Simple;<BR>use Data::Dumper;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>my $message = '&lt;?xml version="1.0" 
encoding="utf-8"?&gt;<BR>&lt;soap:Envelope xmlns:xsi="<A 
href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</A>" 
xmlns:xsd="<A 
href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</A>" 
xmlns:soap="<A 
href="http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap.org/soap/envelope/</A>"&gt;<BR>&nbsp; 
&lt;soap:Header&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;AuthHeader 
xmlns="vscws"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;distriID&gt;XXXX&lt;/distriID&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;password&gt;XXXXXX&lt;/password&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;/AuthHeader&gt;<BR>&nbsp; &lt;/soap:Header&gt;<BR>&nbsp; 
&lt;soap:Body&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;getUserTransactions 
xmlns="vscws"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;controlNumber&gt;XXXXXX&lt;/controlNumber&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;transactionType&gt;&lt;/transactionType&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;dateFrom&gt;2009-11-10&lt;/dateFrom&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;dateTo&gt;2009-11-30&lt;/dateTo&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;/getUserTransactions&gt;<BR>&nbsp; 
&lt;/soap:Body&gt;<BR>&lt;/soap:Envelope&gt;';</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>my $length = length($message);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>my $userAgent = LWP::UserAgent-&gt;new();<BR>my 
$request = HTTP::Request-&gt;new(POST =&gt; 
'http://200.XXX.XXX.XX:90/ws.asmx');<BR>$request-&gt;header(SOAPAction =&gt; 
'"vscws/getUserTransactions"');<BR>$request-&gt;content_type("text/xml; 
charset=utf-8");<BR>$request-&gt;content_length($length);<BR>$request-&gt;content($message);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>my $response = 
$userAgent-&gt;request($request);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; #<BR>&nbsp; # Parseando o resultado (XML) do 
servidor<BR>&nbsp; #</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp; my $ref = XMLin( $response-&gt;content ) or 
die $!;</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp; my $xml = XMLout( my $hashref 
);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;for ( my $i = $#{ 
$ref-&gt;{getUserTransactions} }; $i &gt; 0; $i-- ) {</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$startdate = 
"${ $ref-&gt;{getUserTransactions} }[$i]-&gt;{startTime}";<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;$origem&nbsp;&nbsp;&nbsp; = "${ $ref-&gt;{getUserTransactions} 
}[$i]-&gt;{ANI}";<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;$destino&nbsp;&nbsp; = "${ 
$ref-&gt;{getUserTransactions} 
}[$i]-&gt;{DestinationNumber}";<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;$descrip&nbsp;&nbsp; = "${ $ref-&gt;{getUserTransactions} 
}[$i]-&gt;{destinationDescription}";<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;$duration&nbsp; = "${ $ref-&gt;{getUserTransactions} 
}[$i]-&gt;{Time}";<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;$cost&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "${ 
$ref-&gt;{getUserTransactions} }[$i]-&gt;{Cost}";</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; $tabelaprint .= "<BR>&nbsp; 
&nbsp;&nbsp; &lt;tr&gt;<BR>&nbsp;&nbsp; &nbsp;&nbsp; &lt;td&gt;&lt;p 
align=\"center\"&gt;&lt;font face=\"Arial\" 
size=\"1\"&gt;&lt;b&gt;$startdate&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;<BR>&nbsp;&nbsp; 
&nbsp;&nbsp; &lt;td&gt;&lt;p align=\"center\"&gt;&lt;font face=\"Arial\" 
size=\"1\"&gt;$origem&lt;/font&gt;&lt;/td&gt;<BR>&nbsp;&nbsp; &nbsp;&nbsp; 
&lt;td&gt;&lt;p align=\"center\"&gt;&lt;font face=\"Arial\" 
size=\"1\"&gt;&lt;b&gt;$destino&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;<BR>&nbsp;&nbsp; 
&nbsp;&nbsp; &lt;td&gt;&lt;p align=\"center\"&gt;&lt;font face=\"Arial\" 
size=\"1\"&gt;&lt;b&gt;$descrip&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;<BR>&nbsp;&nbsp; 
&nbsp;&nbsp; &lt;td&gt;&lt;p align=\"center\"&gt;&lt;font face=\"Arial\" 
size=\"1\"&gt;$duration&lt;/font&gt;&lt;/td&gt;<BR>&nbsp;&nbsp; &nbsp;&nbsp; 
&lt;td&gt;&lt;p align=\"center\"&gt;&lt;font face=\"Arial\" 
size=\"1\"&gt;$cost&lt;/font&gt;&lt;/td&gt;<BR>&nbsp;&nbsp; 
&lt;/tr&gt;&nbsp;&nbsp; <BR>&nbsp;&nbsp; ";</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>if($response-&gt;code == 200) {</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;print "$tabelaprint";<BR>}<BR>else 
{<BR>&nbsp;print $response-&gt;error_as_HTML;<BR>};<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Obrigado.</DIV></FONT>
<DIV><FONT face=Arial size=2>Marcio Mello.</FONT></DIV>
<DIV><FONT face=Arial size=2><A 
href="mailto:marcio@modapoint.com.br">marcio@modapoint.com.br</A></DIV></FONT></BODY></HTML>