Posté le 09 décembre 2014 - 16:38 |
ProcedureWS_Taxi_Disponivel(LOCALDebugSN)
ok,bRet isboolean=False
nRetornoCodigo isint=0
nContador isint=0
CodClienteCelula isstring=""
XML_Retorno isstring=""
LocSt_TaxisLogados is ST_TaxisLogados
IpSaladaFruta01 isstring=Morango_01+"."+Abacaxi_02+"."+Limao_03+"."+Melancia_04+":"+Laranja_05
IpSaladaFruta02 isstring=Morango_01+"."+Abacaxi_02+"."+Limao_03+"."+Melancia_04+":"+Manga_06
ChangeCharset(charsetOccidental)
HReadSeekFirst(t001_cliente,t001_cliente.t001_seq_cliente,1) IFHFound(t001_cliente) =TrueANDt001_cliente.t001_cod_clientecelula>0THEN
CodClienteCelula=t001_cliente.t001_cod_clientecelula
NumProces isstring=WS_Taxi_ValidaRequisicao(t001_cliente.t001_ddd_telefone,... t001_cliente.t001_num_telefone,... 0,... 0,... "N")
Xml_SEND isstring= [ <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:act297_RtPlusSSDM-IRtPlusSSDM#ObterRelacaoDeVeiculosLogados"> <soapenv:Header/> <soapenv:Body> <urn:ObterRelacaoDeVeiculosLogados soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <cod_client_celula xsi:type="xsd:int">V001</cod_client_celula> <dat_hora_proces xsi:type="xsd:string">V002</dat_hora_proces> <num_proces xsi:type="xsd:int">V003</num_proces> </urn:ObterRelacaoDeVeiculosLogados> </soapenv:Body> </soapenv:Envelope> ]
Xml_SEND=Clip(Replace(Xml_SEND,"V001",CodClienteCelula)) Xml_SEND=Clip(Replace(Xml_SEND,"V002",GloDataHora)) Xml_SEND=Clip(Replace(Xml_SEND,"V003",NumProces))
IFDebugSN="S"THEN Info("/mnt/sdcard/TaxiFv/Arquivos/EnvioWSVersao.TXT",Xml_SEND) IFInAndroidMode() =True IFInSimulatorMode() =FalseTHEN fSaveBuffer("/mnt/sdcard/TaxiFv/Arquivos/EnvioWSVersao.TXT",Xml_SEND) ELSE fSaveBuffer("c:\EnvioWSVersao.TXT",Xml_SEND) END END END
HTTPTimeOut(GloHTTPTimeOut)
ok=HTTPRequest("http://"+IpSaladaFruta01+"/soap/IRtPlusSSDM","","",Xml_SEND,"text/xml","","")
IFok=True
XML_Retorno=WS_Android_IOS_HTTPGetResult()
ok=False
IFDebugSN="S" Info("/mnt/sdcard/TaxiFv/Arquivos/RetornoWSVersaoSemTratamento.TXT",XML_Retorno) IFInAndroidMode() =True IFInSimulatorMode() =FalseTHEN fSaveBuffer("/mnt/sdcard/TaxiFv/Arquivos/RetornoWSVersaoSemTratamento.TXT",XML_Retorno) ELSE fSaveBuffer("C:\RetornoWSVersao.TXT",XML_Retorno) END END END
XML_Retorno=WS_RemoveAcentos(XML_Retorno)
IFLength(XML_Retorno) >0THEN
ArrayDeleteAll(arr_TaxisLogados)
IFIniOSMode() =TrueTHEN
NoXml isstring i isint=1
LOOP
NoXml=XMLExtractString(XML_Retorno,"NS2:TVeiculoLogadoVO",i)
IFNoXml=""THEN BREAK END
LocSt_TaxisLogados.ST_ID=XMLExtractString(NoXml,"NumUnidad") LocSt_TaxisLogados.ST_Latitude=XMLExtractString(NoXml,"ValLatitu",1) LocSt_TaxisLogados.ST_Longitude=XMLExtractString(NoXml,"ValLongit",1) LocSt_TaxisLogados.ST_Situacao=XMLExtractString(NoXml,"IdeStatus",1)
arr_TaxisLogados[LocSt_TaxisLogados.ST_ID] =LocSt_TaxisLogados
nContador++ i++ ok=True
IFDebugSN="S"THEN Info(LocSt_TaxisLogados.ST_ID,LocSt_TaxisLogados.ST_Latitude,LocSt_TaxisLogados.ST_Longitude,LocSt_TaxisLogados.ST_Situacao) END
END
ELSE IFInAndroidMode() =True
nInicial isint nFinal isint nInicial=PositionOccurrence(XML_Retorno,"<NS2:TVeiculoLogadoVO",firstRank,FromBeginning) nFinal=PositionOccurrence(XML_Retorno,"</NS2:TVeiculoLogadoVO>",lastRank,FromEnd) +Length("</NS2:TVeiculoLogadoVO>") XML_Retorno=Middle(XML_Retorno,nInicial,nFinal-nInicial) XML_Retorno=Replace(XML_Retorno,"NS2:TVeiculoLogadoVO","NoXml") XML_Retorno="<Xml><Recorte>"+XML_Retorno+"</Recorte></Xml>"
IFDebugSN="S"THEN Info(XML_Retorno) IFInAndroidMode() =True fSaveBuffer("/mnt/sdcard/TaxiFv/Arquivos/RecorteBlocoLogados.TXT",XML_Retorno) END END
XmlDoc isXMLDocument
XmlDoc=XMLOpen(XML_Retorno,fromString)
NoXml isxmlNode
FOR EACH NoXml OF XmlDoc.Xml.Recorte on NoXml
IFNoXml.NumUnidad<>NullANDNoXml.ValLatitu<>NullANDNoXml.ValLongit<>NullTHEN
nContador+=1 ok=True LocSt_TaxisLogados.ST_ID=NoXml.NumUnidad LocSt_TaxisLogados.ST_Latitude=NoXml.ValLatitu LocSt_TaxisLogados.ST_Longitude=NoXml.ValLongit LocSt_TaxisLogados.ST_Situacao=NoXml.IdeStatus
arr_TaxisLogados[LocSt_TaxisLogados.ST_ID] =LocSt_TaxisLogados
END
END
END
END
END
END
IFDebugSN="S"THEN Info("Qtde de Taxis Disponiveis:",nContador) END
RESULT(ok) > |
| |
| |
|