<!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>Obrigado André! </FONT></DIV>
<DIV><FONT face=Arial size=2>Vou fazer alguns testes aqui e 
retorno..</FONT></DIV>
<DIV><FONT face=Arial size=2>Marcio.</FONT></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=andregarciacarneiro@gmail.com 
  href="mailto:andregarciacarneiro@gmail.com">Andre Carneiro</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=saopaulo-pm@mail.pm.org 
  href="mailto:saopaulo-pm@mail.pm.org">saopaulo-pm@mail.pm.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, December 04, 2009 3:26 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [SP-pm] XML::Simple</DIV>
  <DIV><BR></DIV>Grego é?? Blz! Vou tentar traduzir um pouquinho 
  então...<BR><BR>&lt;code&gt;<BR>use strict;<BR>use XML::Simple;<BR>use 
  Data::Dumper; #Isso vai ajudar vc a entender o que o XML::Simple vai trazer e 
  como vai trazer.<BR><BR>my $string = '&lt;?xml version="1.0" encoding="utf-8" 
  ?&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <FONT face=Arial size=2>&lt;soap:Envelope xmlns:xsi="<A 
  href="http://www.w3.org/2001/XMLSchema-instance" 
  target=_blank>http://www.w3.org/2001/XMLSchema-instance</A>" xmlns:xsd="<A 
  href="http://www.w3.org/2001/XMLSchema" 
  target=_blank>http://www.w3.org/2001/XMLSchema</A>" xmlns:soap="<A 
  href="http://schemas.xmlsoap.org/soap/envelope/" 
  target=_blank>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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<PRE><FONT size=4><BR>    my $ref = undef;<BR>    my $obj = XML::Simple-&gt;new();<BR><BR>    #Tratando possivel erro de parsing<BR>    eval{$ref = $obj-&gt;XMLin($string);};#Isso transforma o XML em uma estrutura de dados em forma de hashes e arrays... <BR>
    if($@){<BR>        print "\nNao foi possivel fazer o parsing: $@\n";<BR>    }else{<BR><BR>        print Dumper $ref; #Isso mostra a estrutura de dados gerada pelo parsing.<BR>        my $xml = XMLout($ref);#Isso converte a estrutura de dados armazenada em $ref para XML novamente. <BR>
                               #Não sei se tem muito sentido isso para você, mas enfim...<BR>    }<BR></FONT></PRE>__END__<BR><BR>&lt;/code&gt;<BR><BR><BR>Quando 
  executar esse script, vai ver algo do tipo: <BR><BR><BR>$VAR1 = 
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'xmlns:xsi' =&gt; 
  '<A 
  href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</A>',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  'soap:Header' =&gt; 
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  'AuthHeader' =&gt; 
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  },<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'xmlns:xsd' =&gt; 
  '<A 
  href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</A>',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  'xmlns:soap' =&gt; '<A 
  href="http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap.org/soap/envelope/</A>'<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  };<BR><BR>Aí é só acessar via perl o que você quer. Por exemplo, vamos 
  capturar 
  'getUserTransactions'<BR><BR>&lt;code&gt;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  my $getUserTransaction = 
  $xml-&gt;{soap.Body}-&gt;{getUsertTransaction};<BR><BR>&lt;/code&gt;<BR><BR><BR>Melhorou?<BR><BR>
  <DIV class=gmail_quote>2009/12/4 Daniel de Oliveira Mantovani <SPAN 
  dir=ltr>&lt;<A 
  href="mailto:daniel.oliveira.mantovani@gmail.com">daniel.oliveira.mantovani@gmail.com</A>&gt;</SPAN><BR>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">2009/12/4 
    Marcio Mello &lt;<A 
    href="mailto:marcio@modapoint.com.br">marcio@modapoint.com.br</A>&gt;:<BR>
    <DIV>
    <DIV></DIV>
    <DIV class=h5>&gt; Olá à todos,<BR>&gt; Não conheço bem o módulo 
    XML::Simple&nbsp;e não sei como traduzir os dados<BR>&gt; 
    corretamente.<BR>&gt; Se alguém puder ajudar, fico grato..<BR>&gt;<BR>&gt; A 
    resposta que recebo do servidor está aqui e o&nbsp;código está 
    abaixo:<BR>&gt;<BR>&gt; 
    ===========================================================<BR>&gt; $VAR1 = 
    { 'xmlns:xsi' =&gt; '<A href="http://www.w3.org/2001/XMLSchema-instance" 
    target=_blank>http://www.w3.org/2001/XMLSchema-instance</A>',<BR>&gt; 
    'soap:Body' =&gt; { 'getUserTransactionsResponse' =&gt; { 'xmlns' =&gt; 
    'vscws',<BR>&gt; 'getUserTransactionsResult' =&gt; { 'VSC' =&gt; { 'xmlns' 
    =&gt; '',<BR>&gt; 'userTransactions' =&gt; [ { 'Time' =&gt; '1:00', 'Limit' 
    =&gt; '5', 'DNIS' =&gt;<BR>&gt; '56012', 'destinationDescription' =&gt; 
    "Brasil - S\x{e3}o Paulo - \x{c1}rea 11<BR>&gt; - Celular", 'Income' =&gt; 
    '0.0000', 'controlNumber' =&gt; '2414568', 'ANI' =&gt;<BR>&gt; '1145822125', 
    'DestinationNumber' =&gt; '551199117099', 'Balance' =&gt; '-44.024',<BR>&gt; 
    'startTime' =&gt; '2009-11-27 17:28:45', 'Cost' =&gt; '0.89',<BR>&gt; 
    'transactionDescription' =&gt; 'Termination', 'billing' =&gt; 
    'Limited',<BR>&gt; 'RealTime' =&gt; '0:22' }, { 'Time' =&gt; '1:00', 'Limit' 
    =&gt; '5', 'DNIS' =&gt;<BR>&gt; '56012', 'destinationDescription' =&gt; 
    'Brasil - Roc', 'Income' =&gt; '0.0000',<BR>&gt; 'controlNumber' =&gt; 
    '2414568', 'ANI' =&gt; '1145822125', 'DestinationNumber' =&gt;<BR>&gt; 
    '551145215888', 'Balance' =&gt; '-44.314', 'startTime' =&gt; 
    '2009-11-27<BR>&gt; 17:25:45', 'Cost' =&gt; '0.29', 'transactionDescription' 
    =&gt; 'Termination',<BR>&gt; 'billing' =&gt; 'Limited', 'RealTime' =&gt; 
    '0:19' }, { 'Time' =&gt; '1:00', 'Limit'<BR>&gt; =&gt; '5', 'DNIS' =&gt; 
    '56012', 'destinationDescription' =&gt; 'Brasil - Roc',<BR>&gt; 'Income' 
    =&gt; '0.0000', 'controlNumber' =&gt; '2414568', 'ANI' =&gt; 
    '1145822125',<BR>&gt; 'DestinationNumber' =&gt; '551145215888', 'Balance' 
    =&gt; '-44.604', 'startTime'<BR>&gt; =&gt; '2009-11-27 17:16:30', 'Cost' 
    =&gt; '0.29', 'transactionDescription' =&gt;<BR>&gt; 'Termination', 
    'billing' =&gt; 'Limited', 'RealTime' =&gt; '0:24' }, { 'Time' =&gt;<BR>&gt; 
    '1:00', 'Limit' =&gt; '5', 'DNIS' =&gt; '56012', 'destinationDescription' 
    =&gt;<BR>&gt; 'Brasil -', 'Income' =&gt; '0.0000', 'controlNumber' =&gt; 
    '2414568', 'ANI' =&gt;<BR>&gt; '1145822125', 'DestinationNumber' =&gt; 
    '551164545504', 'Balance' =&gt; '-45.494',<BR>&gt; 'startTime' =&gt; 
    '2009-11-27 17:06:44', 'Cost' =&gt; '0.89',<BR>&gt; 'transactionDescription' 
    =&gt; 'Termination', 'billing' =&gt; 'Limited',<BR>&gt; 'RealTime' =&gt; 
    '0:12' }, { 'Time' =&gt; '1:48', 'Limit' =&gt; '5', 'DNIS' =&gt;<BR>&gt; 
    '56012', 'destinationDescription' =&gt; 'Brasil - Roc', 'Income' =&gt; 
    '0.0000',<BR>&gt; 'controlNumber' =&gt; '2414568', 'ANI' =&gt; '1130337016', 
    'DestinationNumber' =&gt;<BR>&gt; '551130337005', 'Balance' =&gt; '-46.016', 
    'startTime' =&gt; '2009-11-27<BR>&gt; 12:19:22', 'Cost' =&gt; '0.522', 
    'transactionDescription' =&gt; 'Termination',<BR>&gt; 'billing' =&gt; 
    'Limited', 'RealTime' =&gt; '1:43' }, { 'Time' =&gt; '1:00', 'Limit'<BR>&gt; 
    =&gt; '5', 'DNIS' =&gt; '56012', 'destinationDescription' =&gt; "Brasil - 
    S\x{e3}o<BR>&gt; Paulo - \x{c1}rea 11 - Celular", 'Income' =&gt; '0.0000', 
    'controlNumber' =&gt;<BR>&gt; '2414568', 'ANI' =&gt; '1130337016', 
    'DestinationNumber' =&gt; '551199117099',<BR>&gt; 'Balance' =&gt; '-46.906', 
    'startTime' =&gt; '2009-11-27 12:20:28', 'Cost' =&gt;<BR>&gt; '0.89', 
    'transactionDescription' =&gt; 'Termination', 'billing' =&gt; 
    'Limited',<BR>&gt; 'RealTime' =&gt; '0:13' }, { 'Time' =&gt; '1:00', 'Limit' 
    =&gt; '5', 'DNIS' =&gt;<BR>&gt; '56012', 'destinationDescription' =&gt; 
    "Brasil - S\x{e3}o Paulo - \x{c1}rea 11<BR>&gt; - Celular", 'Income' =&gt; 
    '0.0000', 'controlNumber' =&gt; '2414568', 'ANI' =&gt;<BR>&gt; '1130337016', 
    'DestinationNumber' =&gt; '551199117099', 'Balance' =&gt; '-47.796',<BR>&gt; 
    'startTime' =&gt; '2009-11-27 12:07:35', 'Cost' =&gt; '0.89',<BR>&gt; 
    'transactionDescription' =&gt; 'Termination', 'billing' =&gt; 
    'Limited',<BR>&gt; 'RealTime' =&gt; '0:20' }, { 'Time' =&gt; '1:00', 'Limit' 
    =&gt; '5', 'DNIS' =&gt;<BR>&gt; '56012', 'destinationDescription' =&gt; 
    'Brasil - Roc', 'Income' =&gt; '0.0000',<BR>&gt; 'controlNumber' =&gt; 
    '2414568', 'ANI' =&gt; '1130337016', 'DestinationNumber' =&gt;<BR>&gt; 
    '551130337005', 'Balance' =&gt; '-48.086', 'startTime' =&gt; 
    '2009-11-27<BR>&gt; 12:06:08', 'Cost' =&gt; '0.29', 'transactionDescription' 
    =&gt; 'Termination',<BR>&gt; 'billing' =&gt; 'Limited', 'RealTime' =&gt; 
    '0:21' }, { 'Time' =&gt; '0:00', 'Limit'<BR>&gt; =&gt; '5', 'DNIS' =&gt; {}, 
    'destinationDescription' =&gt; {}, 'Income' =&gt; '50',<BR>&gt; 
    'controlNumber' =&gt; '2414568', 'ANI' =&gt; {}, 'DestinationNumber' =&gt; 
    {},<BR>&gt; 'Balance' =&gt; '1.914', 'startTime' =&gt; '2009-11-26 
    18:05:36', 'Cost' =&gt;<BR>&gt; '0.0000', 'transactionDescription' =&gt; 
    'Payment', 'billing' =&gt; 'Limited',<BR>&gt; 'RealTime' =&gt; '0:00' }, { 
    'Time' =&gt; '1:00', 'Limit' =&gt; '5', 'DNIS' =&gt;<BR>&gt; '30338031', 
    'destinationDescription' =&gt; 'Brasil - Roc', 'Income' =&gt;<BR>&gt; 
    '0.0000', 'controlNumber' =&gt; '2414568', 'ANI' =&gt; '1145822125',<BR>&gt; 
    'DestinationNumber' =&gt; '551145215888', 'Balance' =&gt; '1.624', 
    'startTime' =&gt;<BR>&gt; '2009-11-25 18:11:25', 'Cost' =&gt; '0.29', 
    'transactionDescription' =&gt;<BR>&gt; 'Termination', 'billing' =&gt; 
    'Limited', 'RealTime' =&gt; '0:47' }, { 'Time' =&gt;<BR>&gt; '1:00', 'Limit' 
    =&gt; '5', 'DNIS' =&gt; '56012', 'destinationDescription' =&gt;<BR>&gt; 
    'Brasil - Roc', 'Income' =&gt; '0.0000', 'controlNumber' =&gt; '2414568', 
    'ANI' =&gt;<BR>&gt; '1145822125', 'DestinationNumber' =&gt; '551155478001', 
    'Balance' =&gt; '1.334',<BR>&gt; 'startTime' =&gt; '2009-11-25 11:55:47', 
    'Cost' =&gt; '0.29',<BR>&gt; 'transactionDescription' =&gt; 'Termination', 
    'billing' =&gt; 'Limited',<BR>&gt; 'RealTime' =&gt; '0:09' }, { 'Time' =&gt; 
    '1:00', 'Limit' =&gt; '5', 'DNIS' =&gt;<BR>&gt; '56012', 
    'destinationDescription' =&gt; 'Brasil - Roc', 'Income' =&gt; 
    '0.0000',<BR>&gt; 'controlNumber' =&gt; '2414568', 'ANI' =&gt; '1145822125', 
    'DestinationNumber' =&gt;<BR>&gt; '551140040435', 'Balance' =&gt; '1.044', 
    'startTime' =&gt; '2009-11-25 11:48:00',<BR>&gt; 'Cost' =&gt; '0.29', 
    'transactionDescription' =&gt; 'Termination', 'billing' =&gt;<BR>&gt; 
    'Limited', 'RealTime' =&gt; '0:07' }, { 'Time' =&gt; '1:36', 'Limit' =&gt; 
    '5',<BR>&gt; 'DNIS' =&gt; '56012', 'destinationDescription' =&gt; 'Brasil - 
    Roc', 'Income' =&gt;<BR>&gt; '0.0000', 'controlNumber' =&gt; '2414568', 
    'ANI' =&gt; '1145822125',<BR>&gt; 'DestinationNumber' =&gt; '551140040435', 
    'Balance' =&gt; '0.58', 'startTime' =&gt;<BR>&gt; '2009-11-25 11:09:02', 
    'Cost' =&gt; '0.464', 'transactionDescription' =&gt;<BR>&gt; 'Termination', 
    'billing' =&gt; 'Limited', 'RealTime' =&gt; '1:31' }, { 'Time' =&gt;<BR>&gt; 
    '1:00', 'Limit' =&gt; '5', 'DNIS' =&gt; '56012', 'destinationDescription' 
    =&gt;<BR>&gt; 'Brasil - Roc', 'Income' =&gt; '0.0000', 'controlNumber' =&gt; 
    '2414568', 'ANI' =&gt;<BR>&gt; '1145822125', 'DestinationNumber' =&gt; 
    '551138330767', 'Balance' =&gt; '0.29',<BR>&gt; 'startTime' =&gt; 
    '2009-11-25 10:11:35', 'Cost' =&gt; '0.29',<BR>&gt; 'transactionDescription' 
    =&gt; 'Termination', 'billing' =&gt; 'Limited',<BR>&gt; 'RealTime' =&gt; 
    '0:47' }, { 'Time' =&gt; '1:00', 'Limit' =&gt; '5', 'DNIS' =&gt;<BR>&gt; 
    '56012', 'destinationDescription' =&gt; 'Brasil - Roc', 'Income' =&gt; 
    '0.0000',<BR>&gt; 'controlNumber' =&gt; '2414568', 'ANI' =&gt; '1145822125', 
    'DestinationNumber' =&gt;<BR>&gt; '551138330767', 'Balance' =&gt; '0.0000', 
    'startTime' =&gt; '2009-11-25 09:50:25',<BR>&gt; 'Cost' =&gt; '0.29', 
    'transactionDescription' =&gt; 'Termination', 'billing' =&gt;<BR>&gt; 
    'Limited', 'RealTime' =&gt; '0:52' } ], 'Val' =&gt; { 'UserID' =&gt; 
    '2414568' },<BR>&gt; 'STATUS' =&gt; '0' } } } }, 'xmlns:xsd' =&gt; '<A 
    href="http://www.w3.org/2001/XMLSchema" 
    target=_blank>http://www.w3.org/2001/XMLSchema</A>',<BR>&gt; 'xmlns:soap' 
    =&gt; '<A href="http://schemas.xmlsoap.org/soap/envelope/" 
    target=_blank>http://schemas.xmlsoap.org/soap/envelope/</A>' };<BR>&gt; 
    =====================================================================<BR>&gt;<BR>&gt; 
    use LWP::UserAgent;<BR>&gt; use HTTP::Request;<BR>&gt; use 
    XML::Simple;<BR>&gt; use Data::Dumper;<BR>&gt;<BR>&gt; my $message = 
    '&lt;?xml version="1.0" encoding="utf-8"?&gt;<BR>&gt; &lt;soap:Envelope 
    xmlns:xsi="<A href="http://www.w3.org/2001/XMLSchema-instance" 
    target=_blank>http://www.w3.org/2001/XMLSchema-instance</A>"<BR>&gt; 
    xmlns:xsd="<A href="http://www.w3.org/2001/XMLSchema" 
    target=_blank>http://www.w3.org/2001/XMLSchema</A>"<BR>&gt; xmlns:soap="<A 
    href="http://schemas.xmlsoap.org/soap/envelope/" 
    target=_blank>http://schemas.xmlsoap.org/soap/envelope/</A>"&gt;<BR>&gt; 
    &nbsp; &lt;soap:Header&gt;<BR>&gt; &nbsp;&nbsp;&nbsp; &lt;AuthHeader 
    xmlns="vscws"&gt;<BR>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    &lt;distriID&gt;XXXX&lt;/distriID&gt;<BR>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    &lt;password&gt;XXXXXX&lt;/password&gt;<BR>&gt; &nbsp;&nbsp;&nbsp; 
    &lt;/AuthHeader&gt;<BR>&gt; &nbsp; &lt;/soap:Header&gt;<BR>&gt; &nbsp; 
    &lt;soap:Body&gt;<BR>&gt; &nbsp;&nbsp;&nbsp; &lt;getUserTransactions 
    xmlns="vscws"&gt;<BR>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    &lt;controlNumber&gt;XXXXXX&lt;/controlNumber&gt;<BR>&gt; 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    &lt;transactionType&gt;&lt;/transactionType&gt;<BR>&gt; 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    &lt;dateFrom&gt;2009-11-10&lt;/dateFrom&gt;<BR>&gt; 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    &lt;dateTo&gt;2009-11-30&lt;/dateTo&gt;<BR>&gt; &nbsp;&nbsp;&nbsp; 
    &lt;/getUserTransactions&gt;<BR>&gt; &nbsp; &lt;/soap:Body&gt;<BR>&gt; 
    &lt;/soap:Envelope&gt;';<BR>&gt;<BR>&gt; my $length = 
    length($message);<BR>&gt;<BR>&gt; my $userAgent = 
    LWP::UserAgent-&gt;new();<BR>&gt; my $request = HTTP::Request-&gt;new(POST 
    =&gt;<BR>&gt; '<A href="http://200.XXX.XXX.XX:90/ws.asmx%27" 
    target=_blank>http://200.XXX.XXX.XX:90/ws.asmx'</A>);<BR>&gt; 
    $request-&gt;header(SOAPAction =&gt; '"vscws/getUserTransactions"');<BR>&gt; 
    $request-&gt;content_type("text/xml; charset=utf-8");<BR>&gt; 
    $request-&gt;content_length($length);<BR>&gt; 
    $request-&gt;content($message);<BR>&gt;<BR>&gt; my $response = 
    $userAgent-&gt;request($request);<BR>&gt;<BR>&gt; &nbsp; #<BR>&gt; &nbsp; # 
    Parseando o resultado (XML) do servidor<BR>&gt; &nbsp; #<BR>&gt; &nbsp; my 
    $ref = XMLin( $response-&gt;content ) or die $!;<BR>&gt; &nbsp; my $xml = 
    XMLout( my $hashref );<BR>&gt;<BR>&gt; &nbsp;&nbsp;for ( my $i = $#{ 
    $ref-&gt;{getUserTransactions} }; $i &gt; 0; $i-- ) {<BR>&gt;<BR>&gt; 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$startdate = "${ 
    $ref-&gt;{getUserTransactions} }[$i]-&gt;{startTime}";<BR>&gt; 
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;$origem&nbsp;&nbsp;&nbsp; = "${ 
    $ref-&gt;{getUserTransactions} }[$i]-&gt;{ANI}";<BR>&gt; &nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;$destino&nbsp;&nbsp; = "${ 
    $ref-&gt;{getUserTransactions}<BR>&gt; 
    }[$i]-&gt;{DestinationNumber}";<BR>&gt; &nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;$descrip&nbsp;&nbsp; = "${ 
    $ref-&gt;{getUserTransactions}<BR>&gt; 
    }[$i]-&gt;{destinationDescription}";<BR>&gt; &nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;$duration&nbsp; = "${ $ref-&gt;{getUserTransactions} 
    }[$i]-&gt;{Time}";<BR>&gt; &nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;$cost&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "${ 
    $ref-&gt;{getUserTransactions} }[$i]-&gt;{Cost}";<BR>&gt;<BR>&gt; 
    &nbsp;&nbsp; $tabelaprint .= "<BR>&gt; &nbsp; &nbsp;&nbsp; 
    &lt;tr&gt;<BR>&gt; &nbsp;&nbsp; &nbsp;&nbsp; &lt;td&gt;&lt;p 
    align=\"center\"&gt;&lt;font face=\"Arial\"<BR>&gt; 
    size=\"1\"&gt;&lt;b&gt;$startdate&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;<BR>&gt; 
    &nbsp;&nbsp; &nbsp;&nbsp; &lt;td&gt;&lt;p align=\"center\"&gt;&lt;font 
    face=\"Arial\"<BR>&gt; size=\"1\"&gt;$origem&lt;/font&gt;&lt;/td&gt;<BR>&gt; 
    &nbsp;&nbsp; &nbsp;&nbsp; &lt;td&gt;&lt;p align=\"center\"&gt;&lt;font 
    face=\"Arial\"<BR>&gt; 
    size=\"1\"&gt;&lt;b&gt;$destino&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;<BR>&gt; 
    &nbsp;&nbsp; &nbsp;&nbsp; &lt;td&gt;&lt;p align=\"center\"&gt;&lt;font 
    face=\"Arial\"<BR>&gt; 
    size=\"1\"&gt;&lt;b&gt;$descrip&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;<BR>&gt; 
    &nbsp;&nbsp; &nbsp;&nbsp; &lt;td&gt;&lt;p align=\"center\"&gt;&lt;font 
    face=\"Arial\"<BR>&gt; 
    size=\"1\"&gt;$duration&lt;/font&gt;&lt;/td&gt;<BR>&gt; &nbsp;&nbsp; 
    &nbsp;&nbsp; &lt;td&gt;&lt;p align=\"center\"&gt;&lt;font 
    face=\"Arial\"<BR>&gt; size=\"1\"&gt;$cost&lt;/font&gt;&lt;/td&gt;<BR>&gt; 
    &nbsp;&nbsp; &lt;/tr&gt;<BR>&gt; &nbsp;&nbsp; ";<BR>&gt; 
    &nbsp;&nbsp;}<BR>&gt;<BR>&gt; if($response-&gt;code == 200) {<BR>&gt; 
    &nbsp;&nbsp;print "$tabelaprint";<BR>&gt; }<BR>&gt; else {<BR>&gt; 
    &nbsp;print $response-&gt;error_as_HTML;<BR>&gt; };<BR></DIV></DIV>Outra 
    coisa, você está fazendo o parser do content, e depois que você<BR>termina 
    você verifica se ele está ok ?<BR><BR>É ao contrário!<BR><BR>die unless 
    $response-&gt;code == 200<BR>#Agora você faz o parser aqui!!!<BR><BR>Você 
    precisa de um carro para chegar em uma cidade, depois disso você<BR>vai 
    queima-lo, o que seria certo:<BR>1 - Checar o motor antes de partir ?<BR>2 - 
    Checar o motor depois que você chegou e não precisa mais do carro ?<BR>
    <DIV class=im><BR><BR><BR><BR><BR><BR><BR><BR>&gt; Obrigado.<BR>&gt; Marcio 
    Mello.<BR>&gt; <A 
    href="mailto:marcio@modapoint.com.br">marcio@modapoint.com.br</A><BR></DIV>
    <DIV>
    <DIV></DIV>
    <DIV class=h5>&gt; _______________________________________________<BR>&gt; 
    SaoPaulo-pm mailing list<BR>&gt; <A 
    href="mailto:SaoPaulo-pm@pm.org">SaoPaulo-pm@pm.org</A><BR>&gt; <A 
    href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" 
    target=_blank>http://mail.pm.org/mailman/listinfo/saopaulo-pm</A><BR>&gt;<BR><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">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><BR 
  clear=all><BR>-- <BR>André Garcia Carneiro<BR>Analista/Desenvolvedor 
  Perl<BR><BR><BR>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>SaoPaulo-pm mailing 
  list<BR>SaoPaulo-pm@pm.org<BR>http://mail.pm.org/mailman/listinfo/saopaulo-pm</BLOCKQUOTE></BODY></HTML>