FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 25
→
Aula 1043 - WebService - 006 - Consumir WebService - Ler Xml Colocar Tabela-
Aula 1043 - WebService - 006 - Consumir WebService - Ler Xml Colocar Tabela-
Débuté par amarildo, 21 jan. 2017 11:09 - 1 réponse
Connectez-vous…
amarildo
#1
Membre enregistré
535 messages
Popularité : +14 (14 votes)
Posté le 21 janvier 2017 - 11:09
// Aula 1043 - WebService - 004 - Consumir WebService - Ler Xml Colocar Tabela-
// 1. Mostrar como Importar um WebService no WebDev22
// 2. Consumir o Servico Do Site
// 3. Colocar xml na TAbela
Procedure
busca_site_webService
(
)
SAI_
retorno_xml
=
matos_webservice.Lista_Sites
(
)
//Aqui Vai retornar o Xml da Relação de Site
TableDeleteAll
(
TABLE_
Site_WebService
)
//Limpar Conteudo Tabela
XMLDocument
(
"XML"
,
SAI_
retorno_xml
)
//Abrindo Documento Xml
//SAI_retorno_xml=XMLRead("XML","/xml/retorno/empresa")
s
_nome_tag is
string
=
""
s
_titulo is
string
=
""
s
_link is
string
=
""
s
_nome_atributo is
string
=
""
s
_id is
string
=
""
//Criando Variaveis que vou utilizar
XMLFind
(
"XML"
,
Null
,
XMLElement
+
XMLChildItem
,
XMLStartWith
)
WHILE
XMLFound
(
"XML"
)
SWITCH
XMLElementType
(
"XML"
)
CASE
XMLTag
:
s
_nome_tag
=
XMLElementName
(
"XML"
)
IF
s
_nome_tag
=
"titulo"
THEN
s
_titulo
=
XMLData
(
"XML"
)
END
IF
s
_nome_tag
=
"titulo_link"
THEN
s
_link
=
XMLData
(
"XML"
)
END
CASE xmlAttribute
:
s
_nome_atributo
=
XMLElementName
(
"XML"
)
IF
s
_nome_atributo
=
"id"
THEN
s
_id
=
XMLData
(
"XML"
)
END
OTHER
CASE
END
IF
s
_link
<
>
""
THEN
TableAddLine
(
TABLE_
Site_WebService
,
s
_id
,
s
_titulo
,
s
_link
)
//Caso chegar no link, vamos criar a linha da tabela
s
_titulo
=
""
s
_link
=
""
s
_id
=
""
END
XMLNext
(
"XML"
)
END
XMLClose
(
"XML"
)
//Percorrer o Xml
//<xml>
//<retorno>
//<empresa>Amarildo de Matos</empresa>
//<site_uteis id="00001">
//<titulo>Matos Informatica</titulo>
//<titulo_link>www.matosinformatica.com.br</titulo_link>
//</site_uteis>
//<site_uteis id="00002">
//<titulo>Google</titulo>
//<titulo_link>https://www.google.com.br/?gws_rd=ssl</titulo_link>
//</site_uteis>
//</retorno>
//</xml>
http://windevdesenvolvimento.blogspot.com.br/2017/01/aula-1043-webservice-006-consumir.html
Signaler
0
0
BOLLER
#2
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 09 février 2017 - 11:00
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Signaler
0
0
→ Revenir à WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte