|
Solution to XML Reurn Chines em HttpRequest e HttpGetResult |
Iniciado por adrianoboller, nov., 18 2014 6:56 PM - 16 respostas |
| |
| | | |
|
| |
Membro registado 3.703 mensagems Popularité : +175 (223 votes) |
|
Publicado em novembro, 18 2014 - 6:56 PM |
Procedure WS_Android_IOS_HTTPGetResult()
bufResHTTP is Buffer sHTTPResult is string
bufResHTTP = HTTPGetResult(httpResult)
IF IniOSMode() = True OR IniOSSimulatorMode() = True OR IniOSEmulatorMode() = True IF StringCount(bufResHTTP, “ISO-8859-1”, IgnoreCase) = 0 THEN sHTTPResult = UTF8ToString(bufResHTTP) ELSE sHTTPResult = AnsiToUnicode(bufResHTTP) END ELSE IF InAndroidMode() = True OR InAndroidSimulatorMode() = True OR InAndroidEmulatorMode() = True
sHTTPResult = bufResHTTP END
RESULT sHTTPResult |
| |
| |
| | | |
|
| | |
| |
Membro registado 3.703 mensagems Popularité : +175 (223 votes) |
|
Publicado em novembro, 18 2014 - 6:57 PM |
Procedure WS_Android_iOs_ReadXml(XML_Retorno is string, Xml_Atributo is string )
arrXml_TagResult is array of strings xposicaoinicial is int = 0 Xposicaofinal is int = 0 X is int = 0 arrXml_Tag is array of strings
Inicial is int = PositionOccurrence(XML_Retorno,"<"+Xml_Atributo,firstRank,FromBeginning) Final is int = PositionOccurrence(XML_Retorno,"</"+Xml_Atributo+">",lastRank,FromEnd) +Length("</"+Xml_Atributo+">") XML_Retorno = Middle(XML_Retorno,Inicial,Final - Inicial) XML_Retorno = Replace(XML_Retorno,Xml_Atributo,"NoXml") XML_Retorno = "<Xml><Recorte>"+XML_Retorno+"</Recorte></Xml>"
nTotalxml is int = Length(XML_Retorno)
LOOP (nTotalxml)
X++ IFxposicaoinicial = 0 AND Xposicaofinal = 0 AND XML_Retorno[[X]] = "<" THEN X++ IF XML_Retorno[[X]] = "/" THEN xposicaoinicial = X + 1 END END IF xposicaoinicial > 0 AND XML_Retorno[[X]] = ">" THEN Xposicaofinal = X END IF Xposicaofinal > 0 AND xposicaoinicial > 0 THEN stag is string = Middle(XML_Retorno,xposicaoinicial,Xposicaofinal - xposicaoinicial) IF stag="NoXml" THEN BREAK END Add(arrXml_Tag, stag) Xposicaofinal = 0 xposicaoinicial = 0 END
END
IF IniOSMode() = True THEN
NoXml is string i is int = 1 NoXml = XMLExtractString(XML_Retorno,"NoXml",i)
FOR EACH stag OF arrXml_Tag
temp is string = XMLExtractString(NoXml,stag) Add(arrXml_TagResult, temp )
END
ELSE IF InAndroidMode() = True
XmlDoc is XMLDocument XmlDoc = XMLOpen(XML_Retorno, fromString) NoXml is xmlNode
FOR EACH NoXml OF XmlDoc.Xml.Recorte on NoXml
FOR EACH sTag OF arrXml_Tag
Add(arrXml_TagResult,NoXml..ChildNode[sTag])
END
END
END
RESULT arrXml_TagResult |
| |
| |
| | | |
|
| | |
| |
Membro registado 3.703 mensagems Popularité : +175 (223 votes) |
|
Publicado em novembro, 18 2014 - 6:58 PM |
ok = HTTPRequest("http://"+IpSaladaFruta01+"/soap/IRtPlusSSDM","", "", Xml_SEND, "text/xml","","")
IF ok = True
XML_Retorno = WS_Android_IOS_HTTPGetResult()
XML_Retorno = Capitalize(WS_RemoveAcentos(XML_Retorno))
IF DebugSN = "S" THEN Info("/mnt/sdcard/TaxiFv/Arquivos/RetornoPosicaoTaxi.TXT", XML_Retorno) IF InAndroidMode() = True IF InSimulatorMode() = False fSaveBuffer("/mnt/sdcard/TaxiFv/Arquivos/RetornoPosicaoTaxi.TXT", XML_Retorno) ELSE fSaveBuffer("c:\RetornoPosicaoTaxi.TXT", XML_Retorno) END END END END |
| |
| |
| | | |
|
| | |
| |
Membro registado 3.703 mensagems Popularité : +175 (223 votes) |
|
Publicado em novembro, 18 2014 - 7:13 PM |
| |
| |
| | | |
|
| | |
| |
Membro registado 3.703 mensagems Popularité : +175 (223 votes) |
|
Publicado em novembro, 18 2014 - 7:37 PM |
| |
| |
| | | |
|
| | |
| |
Membro registado 3.703 mensagems Popularité : +175 (223 votes) |
|
Publicado em novembro, 18 2014 - 7:40 PM |
OBS.:
The Android and iOS project while using this configuration is that the global definition of the project and the button: "Describing the current configuration" which is at the bottom of the screen. |
| |
| |
| | | |
|
| | |
| |
Membro registado 3.703 mensagems Popularité : +175 (223 votes) |
|
Publicado em novembro, 18 2014 - 8:14 PM |
"Describing the current configuration" |
| |
| |
| | | |
|
| | |
| |
Membro registado 3.703 mensagems Popularité : +175 (223 votes) |
|
Publicado em dezembro, 04 2014 - 11:48 PM |
| |
| |
| | | |
|
| | |
| |
Publicado em dezembro, 05 2014 - 8:48 AM |
| |
| |
| | | |
|
| | |
| |
Membro registado 3.703 mensagems Popularité : +175 (223 votes) |
|
Publicado em dezembro, 09 2014 - 5:56 PM |
IF StringCount(bufResHTTP, “ISO-8859-1”,IgnoreCase) =0 THEN sHTTPResult=UTF8ToString(bufResHTTP) ELSE sHTTPResult=AnsiToUnicode(bufResHTTP) END |
| |
| |
| | | |
|
| | |
| |
Membro registado 3.703 mensagems Popularité : +175 (223 votes) |
|
Publicado em dezembro, 09 2014 - 6:01 PM |
| |
| |
| | | |
|
| | |
| |
Membro registado 3.703 mensagems Popularité : +175 (223 votes) |
|
Publicado em janeiro, 29 2015 - 12:52 PM |
Procedure WS_Android_IOS_HTTPGetResult()
bufResHTTP is Buffer sHTTPResult is string
bufResHTTP = HTTPGetResult(httpResult)
IF IniOSMode() = True OR IniOSSimulatorMode() =True OR IniOSEmulatorMode() = True IF StringCount(bufResHTTP, “ISO-8859-1”,IgnoreCase) =0 THEN sHTTPResult = UTF8ToString(bufResHTTP) ELSE sHTTPResult = AnsiToUnicode(bufResHTTP) END ELSE IF InAndroidMode() =True OR InAndroidSimulatorMode() =True OR InAndroidEmulatorMode() = True
sHTTPResult = bufResHTTP END
RESULT sHTTPResult |
| |
| |
| | | |
|
| | |
| |
Membro registado 3.703 mensagems Popularité : +175 (223 votes) |
|
Publicado em maio, 25 2015 - 9:08 PM |
| |
| |
| | | |
|
| | |
| |
Membro registado 3.703 mensagems Popularité : +175 (223 votes) |
|
Publicado em maio, 25 2015 - 9:09 PM |
| |
| |
| | | |
|
| | |
| |
Membro registado 3.703 mensagems Popularité : +175 (223 votes) |
|
Publicado em maio, 26 2015 - 7:19 PM |
MyUnicodeString is UNICODE string sLine is string = "" sTextFileUnicode is string = "c:\tmp\00010101.txt" mLinha is string
MyUnicodeString = fLoadText(sTextFileUnicode,foAnsi)
sLine = UnicodeToAnsi(MyUnicodeString,charsetAnsi)
ListDeleteAll(ListBox1) ListAdd(ListBox1,sLine)
FOR EACH ROW OF ListBox1 mLinha = ListBox1..DisplayedValue Trace(mLinha) END
xFLagOk is boolean FileID is int = fCreate(DirPadrao+mArquivo,foAnsi) IF FileID=-1 THEN Info("Erro ao criar arquivo.") xFlagOk=False RETURN END
... ...
EnviarArquivo is boolean=FTPSend(MinhaConexao,DirPadrao+mArquivo,CompleteDir(xPastaPedidos),"",ftpASCIIMode) IF EnviarArquivo=False THEN Error("Erro ao enviar arquivo para o FTP.",ErrorInfo()) Info("Arquivo não foi enviado.","Tente enviá-lo novamente.") xFlagOk=False RETURN END
|
| |
| |
| | | |
|
| | |
| |
Membro registado 3.703 mensagems Popularité : +175 (223 votes) |
|
Publicado em maio, 26 2015 - 7:20 PM |
| |
| |
| | | |
|
| | |
| |
Membro registado 3.703 mensagems Popularité : +175 (223 votes) |
|
Publicado em setembro, 19 2015 - 9:25 PM |
OBS. : E se ainda tiver problemas use antes de qualquer codigo esse comando:
ChangeCharset(charsetOccidental)
-- Adriano Jose Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com ______________________________________________ |
| |
| |
| | | |
|
| | | | |
| | |
|