<br clear="all">Just another Perl Hacker,<br>Fernando (SmokeMachine)<br><a href="http://perl-e.org">http://perl-e.org</a><br>Sent from Sao Paulo, SP, Brazil<br>
<br><br><div class="gmail_quote">2009/12/4 Marcio Mello <span dir="ltr">&lt;<a href="mailto:marcio@modapoint.com.br">marcio@modapoint.com.br</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Daniel,<br>
Testei como está abaixo:<div class="im"><br>
<br>
my $response = $userAgent-&gt;request($request);<br>
 #<br>
 # Parseando o resultado (XML) do servidor<br>
 #<br></div>
 my $xml = XML::Simple-&gt;new();<br>
 my $itens = $xml-&gt;XMLin($response-&gt;content);<br>
<br>
if($response-&gt;code == 200) {<div class="im"><br>
foreach my $want (@{ $itens-&gt;{&#39;userTransactions&#39;} }) {<br>
   print $want-&gt;{&#39;startTime&#39;} . &quot;\n&quot;;<br>
}<br></div>
print Dumper(itens); # &lt;-------<br><div class="im"><br>
} else {<br>
print $response-&gt;error_as_HTML;<br>
};<br>
<br></div>
A resposta foi apenas:<br>
$VAR1 = bless( {<br>
                &#39;def_opt&#39; =&gt; {},<br>
                &#39;opt&#39; =&gt; {<br>
                           &#39;normalisespace&#39; =&gt; 0,<br>
                           &#39;rootname&#39; =&gt; &#39;opt&#39;,<br>
                           &#39;parseropts&#39; =&gt; [],<br>
                           &#39;keyattr&#39; =&gt; [<br>
                                          &#39;name&#39;,<br>
                                          &#39;key&#39;,<br>
                                          &#39;id&#39;<br>
                                        ],<br>
                           &#39;forcearray&#39; =&gt; 0,<br>
                           &#39;contentkey&#39; =&gt; &#39;content&#39;,<br>
                           &#39;searchpath&#39; =&gt; []<br>
                         }<br>
              }, &#39;XML::Simple&#39; );<br>
<br>
Não entendi ...<br>
Marcio.<div class="im"><br>
----- Original Message ----- From: &quot;Daniel de Oliveira Mantovani&quot; &lt;<a href="mailto:daniel.oliveira.mantovani@gmail.com" target="_blank">daniel.oliveira.mantovani@gmail.com</a>&gt;<br>
To: &lt;<a href="mailto:saopaulo-pm@mail.pm.org" target="_blank">saopaulo-pm@mail.pm.org</a>&gt;<br></div>
Sent: Friday, December 04, 2009 3:29 PM<div><div></div><div class="h5"><br>
Subject: Re: [SP-pm] XML::Simple<br>
<br>
<br>
Ops esqueci do my:<br>
*my $itens = $xml-&gt;XMLin($content);*<br>
<br>
2009/12/4 Daniel de Oliveira Mantovani &lt;<a href="mailto:daniel.oliveira.mantovani@gmail.com" target="_blank">daniel.oliveira.mantovani@gmail.com</a>&gt;:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
my $xml = XML::Simple-&gt;new();<br>
$itens = $xml-&gt;XMLin($content);<br>
<br>
foreach my $want (@{ $itens-&gt;{&#39;userTransactions&#39;} }) {<br>
print $want-&gt;{&#39;startTime&#39;} . &quot;\n&quot;;<br>
....<br>
}<br>
<br>
Eu não testei o código.<br>
<br>
2009/12/4 Marcio Mello &lt;<a href="mailto:marcio@modapoint.com.br" target="_blank">marcio@modapoint.com.br</a>&gt;:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Daniel,<br>
Já olhei manuais e exemplos e ainda parece grego prá mim..<br>
Aqui está o XML... veja se tem alguma sugestão.. obrigado.<br>
O que preciso é startTime, ANI, DestinationNumber, transactionDescription,<br>
Time a Cost para montar um relatório em uma tabela.<br>
<br>
$VAR1 = {<br>
&#39;xmlns:xsi&#39; =&gt; &#39;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&#39;,<br>
&#39;soap:Body&#39; =&gt; {<br>
&#39;getUserTransactionsResponse&#39; =&gt; {<br>
&#39;xmlns&#39; =&gt; &#39;vscws&#39;,<br>
<br>
&#39;getUserTransactionsResult&#39; =&gt; {<br>
<br>
&#39;VSC&#39; =&gt; {<br>
<br>
&#39;xmlns&#39; =&gt; &#39;&#39;,<br>
<br>
&#39;userTransactions&#39; =&gt; [<br>
<br>
{<br>
<br>
&#39;Time&#39; =&gt; &#39;1:00&#39;,<br>
<br>
&#39;Limit&#39; =&gt; &#39;5&#39;,<br>
<br>
&#39;DNIS&#39; =&gt; &#39;56012&#39;,<br>
<br>
&#39;destinationDescription&#39; =&gt;<br>
&quot;Brasil - S\x{e3}o Paulo - \x{c1}rea 11 - Celular&quot;,<br>
<br>
&#39;Income&#39; =&gt; &#39;0.0000&#39;,<br>
<br>
&#39;controlNumber&#39; =&gt; &#39;2414568&#39;,<br>
<br>
&#39;ANI&#39; =&gt; &#39;1145822125&#39;,<br>
<br>
&#39;DestinationNumber&#39; =&gt;<br>
&#39;551199117099&#39;,<br>
<br>
&#39;Balance&#39; =&gt; &#39;-44.024&#39;,<br>
<br>
&#39;startTime&#39; =&gt; &#39;2009-11-27<br>
17:28:45&#39;,<br>
<br>
&#39;Cost&#39; =&gt; &#39;0.89&#39;,<br>
<br>
&#39;transactionDescription&#39; =&gt;<br>
&#39;Termination&#39;,<br>
<br>
&#39;billing&#39; =&gt; &#39;Limited&#39;,<br>
<br>
&#39;RealTime&#39; =&gt; &#39;0:22&#39;<br>
<br>
},<br>
<br>
{<br>
<br>
&#39;Time&#39; =&gt; &#39;1:00&#39;,<br>
<br>
&#39;Limit&#39; =&gt; &#39;5&#39;,<br>
<br>
&#39;DNIS&#39; =&gt; &#39;56012&#39;,<br>
<br>
&#39;destinationDescription&#39; =&gt;<br>
&#39;Brasil - Roc&#39;,<br>
<br>
&#39;Income&#39; =&gt; &#39;0.0000&#39;,<br>
<br>
&#39;controlNumber&#39; =&gt; &#39;2414568&#39;,<br>
<br>
&#39;ANI&#39; =&gt; &#39;1145822125&#39;,<br>
<br>
&#39;DestinationNumber&#39; =&gt;<br>
&#39;551145215888&#39;,<br>
<br>
&#39;Balance&#39; =&gt; &#39;-44.314&#39;,<br>
<br>
&#39;startTime&#39; =&gt; &#39;2009-11-27<br>
17:25:45&#39;,<br>
<br>
&#39;Cost&#39; =&gt; &#39;0.29&#39;,<br>
<br>
&#39;transactionDescription&#39; =&gt;<br>
&#39;Termination&#39;,<br>
<br>
&#39;billing&#39; =&gt; &#39;Limited&#39;,<br>
<br>
&#39;RealTime&#39; =&gt; &#39;0:19&#39;<br>
<br>
},<br>
<br>
............. etc ....<br>
<br>
Marcio Mello.<br>
<br>
----- Original Message ----- From: &quot;Daniel de Oliveira Mantovani&quot;<br>
&lt;<a href="mailto:daniel.oliveira.mantovani@gmail.com" target="_blank">daniel.oliveira.mantovani@gmail.com</a>&gt;<br>
To: &lt;<a href="mailto:saopaulo-pm@mail.pm.org" target="_blank">saopaulo-pm@mail.pm.org</a>&gt;<br>
Sent: Friday, December 04, 2009 2:38 PM<br>
Subject: Re: [SP-pm] XML::Simple<br>
<br>
<br>
Só para esclarecer, você tem de retorno um XML, você precisa de<br>
algumas informações desse XML mas não consegue pois está com dúvida de<br>
como usar o XML::Simple, certo ?<br>
<br>
Se for esse o seu problema, o manual explica direitinho. Olha só um trecho<br>
dele:<br>
&lt;manual&gt;<br>
For example, this XML:<br>
<br>
&lt;opt&gt;<br>
&lt;user login=&quot;grep&quot; fullname=&quot;Gary R Epstein&quot; /&gt;<br>
&lt;user login=&quot;stty&quot; fullname=&quot;Simon T Tyson&quot; /&gt;<br>
&lt;/opt&gt;<br>
<br>
would, by default, parse to this:<br>
<br>
{<br>
&#39;user&#39; =&gt; [<br>
{<br>
&#39;login&#39; =&gt; &#39;grep&#39;,<br>
&#39;fullname&#39; =&gt; &#39;Gary R Epstein&#39;<br>
},<br>
{<br>
&#39;login&#39; =&gt; &#39;stty&#39;,<br>
&#39;fullname&#39; =&gt; &#39;Simon T Tyson&#39;<br>
}<br>
]<br>
}<br>
&lt;/manual&gt;<br>
<br>
<br>
<a href="http://search.cpan.org/%7Egrantm/XML-Simple-2.18/lib/XML/Simple.pm" target="_blank">http://search.cpan.org/~grantm/XML-Simple-2.18/lib/XML/Simple.pm</a><br>
<br>
Mesmo assim se você não conseguir fazer o parser, cola o XML aqui que<br>
nós te ajudamos.<br>
<br>
[]&#39;s<br>
<br>
2009/12/4 Marcio Mello &lt;<a href="mailto:marcio@modapoint.com.br" target="_blank">marcio@modapoint.com.br</a>&gt;:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
A resposta contém:<br>
startTime, ANI, DestinationNumber, destinationDescription, Time e Cost<br>
.<br>
Existem outros dados mas não são importantes.<br>
<br>
São várias linhas com estes dados e preciso mostrar em uma tabela, que no<br>
código tentei colocar em $tabelaprint .<br>
<br>
Marcio Mello.<br>
<br>
----- Original Message ----- From: &quot;Daniel de Oliveira Mantovani&quot;<br>
&lt;<a href="mailto:daniel.oliveira.mantovani@gmail.com" target="_blank">daniel.oliveira.mantovani@gmail.com</a>&gt;<br>
To: &lt;<a href="mailto:saopaulo-pm@mail.pm.org" target="_blank">saopaulo-pm@mail.pm.org</a>&gt;<br>
Sent: Friday, December 04, 2009 1:54 PM<br>
Subject: Re: [SP-pm] XML::Simple<br>
<br>
<br>
Explica o que você quer fazer, não o que você está tentando fazer com o<br>
código.<br>
<br>
2009/12/4 Lindolfo &quot;Lorn&quot; Rodrigues &lt;<a href="http://lorn.br" target="_blank">lorn.br</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>&gt;:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
You are doing it wrong.<br>
Não é porque SOAP retorna um XML que você tem que &quot;parsear&quot; a resposta<br>
dele<br>
com o XML::Simple :P<br>
Dê uma olhada no<br>
<a href="http://search.cpan.org/%7Eberle/SOAP-Simple-0.00_03/lib/SOAP/Simple.pm" target="_blank">http://search.cpan.org/~berle/SOAP-Simple-0.00_03/lib/SOAP/Simple.pm</a> se<br>
não<br>
funcionar, vai ter que usar<br>
<a href="http://search.cpan.org/%7Emkutter/SOAP-Lite-0.710.10/lib/SOAP/Lite.pm" target="_blank">http://search.cpan.org/~mkutter/SOAP-Lite-0.710.10/lib/SOAP/Lite.pm</a> o<br>
SOAP::Lite tem uma pasta &#39;example&#39; junto com o fonte que ajuda bastante<br>
<br>
2009/12/4 Marcio Mello &lt;<a href="mailto:marcio@modapoint.com.br" target="_blank">marcio@modapoint.com.br</a>&gt;<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Olá à todos,<br>
Não conheço bem o módulo XML::Simple e não sei como traduzir os dados<br>
corretamente.<br>
Se alguém puder ajudar, fico grato..<br>
<br>
A resposta que recebo do servidor está aqui e o código está abaixo:<br>
<br>
===========================================================<br>
$VAR1 = { &#39;xmlns:xsi&#39; =&gt; &#39;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&#39;,<br>
&#39;soap:Body&#39; =&gt; { &#39;getUserTransactionsResponse&#39; =&gt; { &#39;xmlns&#39; =&gt; &#39;vscws&#39;,<br>
&#39;getUserTransactionsResult&#39; =&gt; { &#39;VSC&#39; =&gt; { &#39;xmlns&#39; =&gt; &#39;&#39;,<br>
&#39;userTransactions&#39; =&gt; [ { &#39;Time&#39; =&gt; &#39;1:00&#39;, &#39;Limit&#39; =&gt; &#39;5&#39;, &#39;DNIS&#39; =&gt;<br>
&#39;56012&#39;, &#39;destinationDescription&#39; =&gt; &quot;Brasil - S\x{e3}o Paulo -<br>
\x{c1}rea<br>
11<br>
- Celular&quot;, &#39;Income&#39; =&gt; &#39;0.0000&#39;, &#39;controlNumber&#39; =&gt; &#39;2414568&#39;, &#39;ANI&#39; =&gt;<br>
&#39;1145822125&#39;, &#39;DestinationNumber&#39; =&gt; &#39;551199117099&#39;, &#39;Balance&#39; =&gt;<br>
&#39;-44.024&#39;,<br>
&#39;startTime&#39; =&gt; &#39;2009-11-27 17:28:45&#39;, &#39;Cost&#39; =&gt; &#39;0.89&#39;,<br>
&#39;transactionDescription&#39; =&gt; &#39;Termination&#39;, &#39;billing&#39; =&gt; &#39;Limited&#39;,<br>
&#39;RealTime&#39; =&gt; &#39;0:22&#39; }, { &#39;Time&#39; =&gt; &#39;1:00&#39;, &#39;Limit&#39; =&gt; &#39;5&#39;, &#39;DNIS&#39; =&gt;<br>
&#39;56012&#39;, &#39;destinationDescription&#39; =&gt; &#39;Brasil - Roc&#39;, &#39;Income&#39; =&gt;<br>
&#39;0.0000&#39;,<br>
&#39;controlNumber&#39; =&gt; &#39;2414568&#39;, &#39;ANI&#39; =&gt; &#39;1145822125&#39;, &#39;DestinationNumber&#39;<br>
=&gt;<br>
&#39;551145215888&#39;, &#39;Balance&#39; =&gt; &#39;-44.314&#39;, &#39;startTime&#39; =&gt; &#39;2009-11-27<br>
17:25:45&#39;, &#39;Cost&#39; =&gt; &#39;0.29&#39;, &#39;transactionDescription&#39; =&gt; &#39;Termination&#39;,<br>
&#39;billing&#39; =&gt; &#39;Limited&#39;, &#39;RealTime&#39; =&gt; &#39;0:19&#39; }, { &#39;Time&#39; =&gt; &#39;1:00&#39;,<br>
&#39;Limit&#39;<br>
=&gt; &#39;5&#39;, &#39;DNIS&#39; =&gt; &#39;56012&#39;, &#39;destinationDescription&#39; =&gt; &#39;Brasil - Roc&#39;,<br>
&#39;Income&#39; =&gt; &#39;0.0000&#39;, &#39;controlNumber&#39; =&gt; &#39;2414568&#39;, &#39;ANI&#39; =&gt;<br>
&#39;1145822125&#39;,<br>
&#39;DestinationNumber&#39; =&gt; &#39;551145215888&#39;, &#39;Balance&#39; =&gt; &#39;-44.604&#39;,<br>
&#39;startTime&#39;<br>
=&gt; &#39;2009-11-27 17:16:30&#39;, &#39;Cost&#39; =&gt; &#39;0.29&#39;, &#39;transactionDescription&#39; =&gt;<br>
&#39;Termination&#39;, &#39;billing&#39; =&gt; &#39;Limited&#39;, &#39;RealTime&#39; =&gt; &#39;0:24&#39; }, { &#39;Time&#39;<br>
=&gt;<br>
&#39;1:00&#39;, &#39;Limit&#39; =&gt; &#39;5&#39;, &#39;DNIS&#39; =&gt; &#39;56012&#39;, &#39;destinationDescription&#39; =&gt;<br>
&#39;Brasil -&#39;, &#39;Income&#39; =&gt; &#39;0.0000&#39;, &#39;controlNumber&#39; =&gt; &#39;2414568&#39;, &#39;ANI&#39; =&gt;<br>
&#39;1145822125&#39;, &#39;DestinationNumber&#39; =&gt; &#39;551164545504&#39;, &#39;Balance&#39; =&gt;<br>
&#39;-45.494&#39;,<br>
&#39;startTime&#39; =&gt; &#39;2009-11-27 17:06:44&#39;, &#39;Cost&#39; =&gt; &#39;0.89&#39;,<br>
&#39;transactionDescription&#39; =&gt; &#39;Termination&#39;, &#39;billing&#39; =&gt; &#39;Limited&#39;,<br>
&#39;RealTime&#39; =&gt; &#39;0:12&#39; }, { &#39;Time&#39; =&gt; &#39;1:48&#39;, &#39;Limit&#39; =&gt; &#39;5&#39;, &#39;DNIS&#39; =&gt;<br>
&#39;56012&#39;, &#39;destinationDescription&#39; =&gt; &#39;Brasil - Roc&#39;, &#39;Income&#39; =&gt;<br>
&#39;0.0000&#39;,<br>
&#39;controlNumber&#39; =&gt; &#39;2414568&#39;, &#39;ANI&#39; =&gt; &#39;1130337016&#39;, &#39;DestinationNumber&#39;<br>
=&gt;<br>
&#39;551130337005&#39;, &#39;Balance&#39; =&gt; &#39;-46.016&#39;, &#39;startTime&#39; =&gt; &#39;2009-11-27<br>
12:19:22&#39;, &#39;Cost&#39; =&gt; &#39;0.522&#39;, &#39;transactionDescription&#39; =&gt; &#39;Termination&#39;,<br>
&#39;billing&#39; =&gt; &#39;Limited&#39;, &#39;RealTime&#39; =&gt; &#39;1:43&#39; }, { &#39;Time&#39; =&gt; &#39;1:00&#39;,<br>
&#39;Limit&#39;<br>
=&gt; &#39;5&#39;, &#39;DNIS&#39; =&gt; &#39;56012&#39;, &#39;destinationDescription&#39; =&gt; &quot;Brasil -<br>
S\x{e3}o<br>
Paulo - \x{c1}rea 11 - Celular&quot;, &#39;Income&#39; =&gt; &#39;0.0000&#39;, &#39;controlNumber&#39;<br>
=&gt;<br>
&#39;2414568&#39;, &#39;ANI&#39; =&gt; &#39;1130337016&#39;, &#39;DestinationNumber&#39; =&gt; &#39;551199117099&#39;,<br>
&#39;Balance&#39; =&gt; &#39;-46.906&#39;, &#39;startTime&#39; =&gt; &#39;2009-11-27 12:20:28&#39;, &#39;Cost&#39; =&gt;<br>
&#39;0.89&#39;, &#39;transactionDescription&#39; =&gt; &#39;Termination&#39;, &#39;billing&#39; =&gt;<br>
&#39;Limited&#39;,<br>
&#39;RealTime&#39; =&gt; &#39;0:13&#39; }, { &#39;Time&#39; =&gt; &#39;1:00&#39;, &#39;Limit&#39; =&gt; &#39;5&#39;, &#39;DNIS&#39; =&gt;<br>
&#39;56012&#39;, &#39;destinationDescription&#39; =&gt; &quot;Brasil - S\x{e3}o Paulo -<br>
\x{c1}rea<br>
11<br>
- Celular&quot;, &#39;Income&#39; =&gt; &#39;0.0000&#39;, &#39;controlNumber&#39; =&gt; &#39;2414568&#39;, &#39;ANI&#39; =&gt;<br>
&#39;1130337016&#39;, &#39;DestinationNumber&#39; =&gt; &#39;551199117099&#39;, &#39;Balance&#39; =&gt;<br>
&#39;-47.796&#39;,<br>
&#39;startTime&#39; =&gt; &#39;2009-11-27 12:07:35&#39;, &#39;Cost&#39; =&gt; &#39;0.89&#39;,<br>
&#39;transactionDescription&#39; =&gt; &#39;Termination&#39;, &#39;billing&#39; =&gt; &#39;Limited&#39;,<br>
&#39;RealTime&#39; =&gt; &#39;0:20&#39; }, { &#39;Time&#39; =&gt; &#39;1:00&#39;, &#39;Limit&#39; =&gt; &#39;5&#39;, &#39;DNIS&#39; =&gt;<br>
&#39;56012&#39;, &#39;destinationDescription&#39; =&gt; &#39;Brasil - Roc&#39;, &#39;Income&#39; =&gt;<br>
&#39;0.0000&#39;,<br>
&#39;controlNumber&#39; =&gt; &#39;2414568&#39;, &#39;ANI&#39; =&gt; &#39;1130337016&#39;, &#39;DestinationNumber&#39;<br>
=&gt;<br>
&#39;551130337005&#39;, &#39;Balance&#39; =&gt; &#39;-48.086&#39;, &#39;startTime&#39; =&gt; &#39;2009-11-27<br>
12:06:08&#39;, &#39;Cost&#39; =&gt; &#39;0.29&#39;, &#39;transactionDescription&#39; =&gt; &#39;Termination&#39;,<br>
&#39;billing&#39; =&gt; &#39;Limited&#39;, &#39;RealTime&#39; =&gt; &#39;0:21&#39; }, { &#39;Time&#39; =&gt; &#39;0:00&#39;,<br>
&#39;Limit&#39;<br>
=&gt; &#39;5&#39;, &#39;DNIS&#39; =&gt; {}, &#39;destinationDescription&#39; =&gt; {}, &#39;Income&#39; =&gt; &#39;50&#39;,<br>
&#39;controlNumber&#39; =&gt; &#39;2414568&#39;, &#39;ANI&#39; =&gt; {}, &#39;DestinationNumber&#39; =&gt; {},<br>
&#39;Balance&#39; =&gt; &#39;1.914&#39;, &#39;startTime&#39; =&gt; &#39;2009-11-26 18:05:36&#39;, &#39;Cost&#39; =&gt;<br>
&#39;0.0000&#39;, &#39;transactionDescription&#39; =&gt; &#39;Payment&#39;, &#39;billing&#39; =&gt; &#39;Limited&#39;,<br>
&#39;RealTime&#39; =&gt; &#39;0:00&#39; }, { &#39;Time&#39; =&gt; &#39;1:00&#39;, &#39;Limit&#39; =&gt; &#39;5&#39;, &#39;DNIS&#39; =&gt;<br>
&#39;30338031&#39;, &#39;destinationDescription&#39; =&gt; &#39;Brasil - Roc&#39;, &#39;Income&#39; =&gt;<br>
&#39;0.0000&#39;, &#39;controlNumber&#39; =&gt; &#39;2414568&#39;, &#39;ANI&#39; =&gt; &#39;1145822125&#39;,<br>
&#39;DestinationNumber&#39; =&gt; &#39;551145215888&#39;, &#39;Balance&#39; =&gt; &#39;1.624&#39;, &#39;startTime&#39;<br>
=&gt;<br>
&#39;2009-11-25 18:11:25&#39;, &#39;Cost&#39; =&gt; &#39;0.29&#39;, &#39;transactionDescription&#39; =&gt;<br>
&#39;Termination&#39;, &#39;billing&#39; =&gt; &#39;Limited&#39;, &#39;RealTime&#39; =&gt; &#39;0:47&#39; }, { &#39;Time&#39;<br>
=&gt;<br>
&#39;1:00&#39;, &#39;Limit&#39; =&gt; &#39;5&#39;, &#39;DNIS&#39; =&gt; &#39;56012&#39;, &#39;destinationDescription&#39; =&gt;<br>
&#39;Brasil - Roc&#39;, &#39;Income&#39; =&gt; &#39;0.0000&#39;, &#39;controlNumber&#39; =&gt; &#39;2414568&#39;,<br>
&#39;ANI&#39;<br>
=&gt;<br>
&#39;1145822125&#39;, &#39;DestinationNumber&#39; =&gt; &#39;551155478001&#39;, &#39;Balance&#39; =&gt;<br>
&#39;1.334&#39;,<br>
&#39;startTime&#39; =&gt; &#39;2009-11-25 11:55:47&#39;, &#39;Cost&#39; =&gt; &#39;0.29&#39;,<br>
&#39;transactionDescription&#39; =&gt; &#39;Termination&#39;, &#39;billing&#39; =&gt; &#39;Limited&#39;,<br>
&#39;RealTime&#39; =&gt; &#39;0:09&#39; }, { &#39;Time&#39; =&gt; &#39;1:00&#39;, &#39;Limit&#39; =&gt; &#39;5&#39;, &#39;DNIS&#39; =&gt;<br>
&#39;56012&#39;, &#39;destinationDescription&#39; =&gt; &#39;Brasil - Roc&#39;, &#39;Income&#39; =&gt;<br>
&#39;0.0000&#39;,<br>
&#39;controlNumber&#39; =&gt; &#39;2414568&#39;, &#39;ANI&#39; =&gt; &#39;1145822125&#39;, &#39;DestinationNumber&#39;<br>
=&gt;<br>
&#39;551140040435&#39;, &#39;Balance&#39; =&gt; &#39;1.044&#39;, &#39;startTime&#39; =&gt; &#39;2009-11-25<br>
11:48:00&#39;,<br>
&#39;Cost&#39; =&gt; &#39;0.29&#39;, &#39;transactionDescription&#39; =&gt; &#39;Termination&#39;, &#39;billing&#39;<br>
=&gt;<br>
&#39;Limited&#39;, &#39;RealTime&#39; =&gt; &#39;0:07&#39; }, { &#39;Time&#39; =&gt; &#39;1:36&#39;, &#39;Limit&#39; =&gt; &#39;5&#39;,<br>
&#39;DNIS&#39; =&gt; &#39;56012&#39;, &#39;destinationDescription&#39; =&gt; &#39;Brasil - Roc&#39;, &#39;Income&#39;<br>
=&gt;<br>
&#39;0.0000&#39;, &#39;controlNumber&#39; =&gt; &#39;2414568&#39;, &#39;ANI&#39; =&gt; &#39;1145822125&#39;,<br>
&#39;DestinationNumber&#39; =&gt; &#39;551140040435&#39;, &#39;Balance&#39; =&gt; &#39;0.58&#39;, &#39;startTime&#39;<br>
=&gt;<br>
&#39;2009-11-25 11:09:02&#39;, &#39;Cost&#39; =&gt; &#39;0.464&#39;, &#39;transactionDescription&#39; =&gt;<br>
&#39;Termination&#39;, &#39;billing&#39; =&gt; &#39;Limited&#39;, &#39;RealTime&#39; =&gt; &#39;1:31&#39; }, { &#39;Time&#39;<br>
=&gt;<br>
&#39;1:00&#39;, &#39;Limit&#39; =&gt; &#39;5&#39;, &#39;DNIS&#39; =&gt; &#39;56012&#39;, &#39;destinationDescription&#39; =&gt;<br>
&#39;Brasil - Roc&#39;, &#39;Income&#39; =&gt; &#39;0.0000&#39;, &#39;controlNumber&#39; =&gt; &#39;2414568&#39;,<br>
&#39;ANI&#39;<br>
=&gt;<br>
&#39;1145822125&#39;, &#39;DestinationNumber&#39; =&gt; &#39;551138330767&#39;, &#39;Balance&#39; =&gt;<br>
&#39;0.29&#39;,<br>
&#39;startTime&#39; =&gt; &#39;2009-11-25 10:11:35&#39;, &#39;Cost&#39; =&gt; &#39;0.29&#39;,<br>
&#39;transactionDescription&#39; =&gt; &#39;Termination&#39;, &#39;billing&#39; =&gt; &#39;Limited&#39;,<br>
&#39;RealTime&#39; =&gt; &#39;0:47&#39; }, { &#39;Time&#39; =&gt; &#39;1:00&#39;, &#39;Limit&#39; =&gt; &#39;5&#39;, &#39;DNIS&#39; =&gt;<br>
&#39;56012&#39;, &#39;destinationDescription&#39; =&gt; &#39;Brasil - Roc&#39;, &#39;Income&#39; =&gt;<br>
&#39;0.0000&#39;,<br>
&#39;controlNumber&#39; =&gt; &#39;2414568&#39;, &#39;ANI&#39; =&gt; &#39;1145822125&#39;, &#39;DestinationNumber&#39;<br>
=&gt;<br>
&#39;551138330767&#39;, &#39;Balance&#39; =&gt; &#39;0.0000&#39;, &#39;startTime&#39; =&gt; &#39;2009-11-25<br>
09:50:25&#39;,<br>
&#39;Cost&#39; =&gt; &#39;0.29&#39;, &#39;transactionDescription&#39; =&gt; &#39;Termination&#39;, &#39;billing&#39;<br>
=&gt;<br>
&#39;Limited&#39;, &#39;RealTime&#39; =&gt; &#39;0:52&#39; } ], &#39;Val&#39; =&gt; { &#39;UserID&#39; =&gt; &#39;2414568&#39; },<br>
&#39;STATUS&#39; =&gt; &#39;0&#39; } } } }, &#39;xmlns:xsd&#39; =&gt;<br>
&#39;<a href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a>&#39;,<br>
&#39;xmlns:soap&#39; =&gt; &#39;<a href="http://schemas.xmlsoap.org/soap/envelope/" target="_blank">http://schemas.xmlsoap.org/soap/envelope/</a>&#39; };<br>
=====================================================================<br>
<br>
use LWP::UserAgent;<br>
use HTTP::Request;<br>
use XML::Simple;<br>
use Data::Dumper;<br>
<br>
my $message = &#39;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>
&lt;soap:Envelope xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&quot;<br>
xmlns:xsd=&quot;<a href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a>&quot;<br>
xmlns:soap=&quot;<a href="http://schemas.xmlsoap.org/soap/envelope/" target="_blank">http://schemas.xmlsoap.org/soap/envelope/</a>&quot;&gt;<br>
&lt;soap:Header&gt;<br>
&lt;AuthHeader xmlns=&quot;vscws&quot;&gt;<br>
&lt;distriID&gt;XXXX&lt;/distriID&gt;<br>
&lt;password&gt;XXXXXX&lt;/password&gt;<br>
&lt;/AuthHeader&gt;<br>
&lt;/soap:Header&gt;<br>
&lt;soap:Body&gt;<br>
&lt;getUserTransactions xmlns=&quot;vscws&quot;&gt;<br>
&lt;controlNumber&gt;XXXXXX&lt;/controlNumber&gt;<br>
&lt;transactionType&gt;&lt;/transactionType&gt;<br>
&lt;dateFrom&gt;2009-11-10&lt;/dateFrom&gt;<br>
&lt;dateTo&gt;2009-11-30&lt;/dateTo&gt;<br>
&lt;/getUserTransactions&gt;<br>
&lt;/soap:Body&gt;<br>
&lt;/soap:Envelope&gt;&#39;;<br>
<br>
my $length = length($message);<br>
<br>
my $userAgent = LWP::UserAgent-&gt;new();<br>
my $request = HTTP::Request-&gt;new(POST =&gt;<br>
&#39;<a href="http://200.XXX.XXX.XX:90/ws.asmx%27" target="_blank">http://200.XXX.XXX.XX:90/ws.asmx&#39;</a>);<br>
$request-&gt;header(SOAPAction =&gt; &#39;&quot;vscws/getUserTransactions&quot;&#39;);<br>
$request-&gt;content_type(&quot;text/xml; charset=utf-8&quot;);<br>
$request-&gt;content_length($length);<br>
$request-&gt;content($message);<br>
<br>
my $response = $userAgent-&gt;request($request);<br>
<br>
#<br>
# Parseando o resultado (XML) do servidor<br>
#<br>
my $ref = XMLin( $response-&gt;content ) or die $!;<br>
my $xml = XMLout( my $hashref );<br>
<br>
for ( my $i = $#{ $ref-&gt;{getUserTransactions} }; $i &gt; 0; $i-- ) {<br>
<br>
$startdate = &quot;${ $ref-&gt;{getUserTransactions} }[$i]-&gt;{startTime}&quot;;<br>
$origem = &quot;${ $ref-&gt;{getUserTransactions} }[$i]-&gt;{ANI}&quot;;<br>
$destino = &quot;${ $ref-&gt;{getUserTransactions}<br>
}[$i]-&gt;{DestinationNumber}&quot;;<br>
$descrip = &quot;${ $ref-&gt;{getUserTransactions}<br>
}[$i]-&gt;{destinationDescription}&quot;;<br>
$duration = &quot;${ $ref-&gt;{getUserTransactions} }[$i]-&gt;{Time}&quot;;<br>
$cost = &quot;${ $ref-&gt;{getUserTransactions} }[$i]-&gt;{Cost}&quot;;<br>
<br>
$tabelaprint .= &quot;<br>
&lt;tr&gt;<br>
&lt;td&gt;&lt;p align=\&quot;center\&quot;&gt;&lt;font face=\&quot;Arial\&quot;<br>
size=\&quot;1\&quot;&gt;&lt;b&gt;$startdate&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;<br>
&lt;td&gt;&lt;p align=\&quot;center\&quot;&gt;&lt;font face=\&quot;Arial\&quot;<br>
size=\&quot;1\&quot;&gt;$origem&lt;/font&gt;&lt;/td&gt;<br>
&lt;td&gt;&lt;p align=\&quot;center\&quot;&gt;&lt;font face=\&quot;Arial\&quot;<br>
size=\&quot;1\&quot;&gt;&lt;b&gt;$destino&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;<br>
&lt;td&gt;&lt;p align=\&quot;center\&quot;&gt;&lt;font face=\&quot;Arial\&quot;<br>
size=\&quot;1\&quot;&gt;&lt;b&gt;$descrip&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;<br>
&lt;td&gt;&lt;p align=\&quot;center\&quot;&gt;&lt;font face=\&quot;Arial\&quot;<br>
size=\&quot;1\&quot;&gt;$duration&lt;/font&gt;&lt;/td&gt;<br>
&lt;td&gt;&lt;p align=\&quot;center\&quot;&gt;&lt;font face=\&quot;Arial\&quot;<br>
size=\&quot;1\&quot;&gt;$cost&lt;/font&gt;&lt;/td&gt;<br>
&lt;/tr&gt;<br>
&quot;;<br>
}<br>
<br>
if($response-&gt;code == 200) {<br>
print &quot;$tabelaprint&quot;;<br>
}<br>
else {<br>
print $response-&gt;error_as_HTML;<br>
};<br>
Obrigado.<br>
Marcio Mello.<br>
<a href="mailto:marcio@modapoint.com.br" target="_blank">marcio@modapoint.com.br</a><br>
_______________________________________________<br>
SaoPaulo-pm mailing list<br>
<a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br>
</blockquote>
<br>
<br>
<br>
--<br>
lorn at lornlab dot org<br>
Lindolfo &quot;Lorn&quot; Rodrigues<br>
<br>
<br>
_______________________________________________<br>
SaoPaulo-pm mailing list<br>
<a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br>
<br>
</blockquote>
<br>
<br>
<br>
--<br>
Existe dois tipos de pessoas, as que reclamam a vida inteira do que<br>
fazem, e as que fazem o que nasceram para fazer.<br>
_______________________________________________<br>
SaoPaulo-pm mailing list<br>
<a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br>
<br>
_______________________________________________<br>
SaoPaulo-pm mailing list<br>
<a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br>
<br>
</blockquote>
<br>
<br>
<br>
--<br>
Existe dois tipos de pessoas, as que reclamam a vida inteira do que<br>
fazem, e as que fazem o que nasceram para fazer.<br>
_______________________________________________<br>
SaoPaulo-pm mailing list<br>
<a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br>
<br>
_______________________________________________<br>
SaoPaulo-pm mailing list<br>
<a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br>
<br>
</blockquote>
<br>
<br>
<br>
--<br>
Existe dois tipos de pessoas, as que reclamam a vida inteira do que<br>
fazem, e as que fazem o que nasceram para fazer.<br>
<br>
</blockquote>
<br>
<br>
<br>
-- <br>
Existe dois tipos de pessoas, as que reclamam a vida inteira do que<br>
fazem, e as que fazem o que nasceram para fazer.<br>
_______________________________________________<br>
SaoPaulo-pm mailing list<br>
<a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br>
<br>
_______________________________________________<br>
SaoPaulo-pm mailing list<br>
<a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br>
</div></div></blockquote></div><br>