PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 25 → WX - Json X httprequest + httpgetresult
WX - Json X httprequest + httpgetresult
Started by BOLLER ADRIANO, Aug., 04 2016 9:39 AM - 3 replies
Registered member
3,651 messages
Popularité : +175 (223 votes)
Posted on August, 04 2016 - 9:39 AM
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/
Message modified, August, 04 2016 - 9:40 AM
Registered member
3,651 messages
Popularité : +175 (223 votes)
Posted on August, 11 2017 - 2:18 PM
//-- 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/
Registered member
123 messages
Popularité : +46 (46 votes)
Posted on August, 18 2017 - 3:32 PM
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
Registered member
3,651 messages
Popularité : +175 (223 votes)
Posted on August, 18 2017 - 5:10 PM
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/