PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 25 → WX - Json X httprequest + httpgetresult
WX - Json X httprequest + httpgetresult
Iniciado por BOLLER ADRIANO, 04,ago. 2016 09:39 - 3 respuestas
Miembro registrado
3.651 mensajes
Popularité : +175 (223 votes)
Publicado el 04,agosto 2016 - 09:39
Bonjour,

Endereço: http: // server / ao ar livre / Serviço / api / login

Conteúdo do JSON contendo o usuário e a senha: { "username", "user", "password", "*****"}

A função, em seguida, retorna uma permissão de sessão que será usado para autenticar futuro consultas.

O ticket token é: TICKET_b1ea7f2a00253859999dc27be19faccf6c3c89f7

Para qualquer pedido futuro, você deve então fazer algo parecido com isto:

//Example
CommandeAlfresco est un HTTPRequête
ReponseAlfresco est un httpRéponse
CommandeAlfresco.Utilisateur="ROLE_TICKET"
CommandeAlfresco.MotDePasse="TICKET_b1ea7f2a00253859999dc27be19faccf6c3c89f7"
CommandeAlfresco.ContentType="application/json"
CommandeAlfresco.Méthode=httpPost
CommandeAlfresco.URL="http://serveur/alfresco/service/api/sites" //pour lister les sites présent
ReponseAlfresco = HTTPEnvoie(CommandeAlfresco)


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Mensaje modificado, 04,agosto 2016 - 09:40
Miembro registrado
3.651 mensajes
Popularité : +175 (223 votes)
Publicado el 11,agosto 2017 - 14:18
//-- le o arquivo Json anexado ao projeto --//
gsPerguntasJson is ANSI string = fLoadText( fDataDir()+"/questoes.json" )
gsPerguntasJson = UTF8ToAnsi(gsPerguntasJson)
//info(gsPerguntasJson)
//-----------------------------------------------------------------------------------------//
//-- agora coloca os dados em um array apos ler a estrrutura e grava na tabela Perguntas --//
//-----------------------------------------------------------------------------------------//

//--estrutura do Json
JsonStru is structure
pergunta is ANSI string
resp_a is ANSI string
resp_b is ANSI string
resp_c is ANSI string
resp_d is ANSI string
resp_e is ANSI string
resp_f is ANSI string
resp_g is ANSI string
resposta is ANSI string
explicacao is ANSI string
END



gstDadosJson is array of JsonStru
Deserialize( gstDadosJson , gsPerguntasJson , psdJSON)
//Info( ArrayCount(gstDadosJson))
//Info( gstDadosJson[1].pergunta )
FOR EACH st_linha_json OF gstDadosJson
Info(st_linha_json.explicacao)
END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Miembro registrado
123 mensajes
Popularité : +46 (46 votes)
Publicado el 18,agosto 2017 - 15:32
Sempre é legal da creditos a quem fez/ajudou ou até mesmo desenvolveu o código, no caso acima eu fiz boa parte do mesmo, com as correções necesarias, inclusive teve outro membro que também colaborou nisso

--
Atte. Willian Fernando
Miembro registrado
3.651 mensajes
Popularité : +175 (223 votes)
Publicado el 18,agosto 2017 - 17:10
ok

--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/