PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 25
→
Aula 1043 - WebService - 006 - Consumir WebService - Ler Xml Colocar Tabela-
Aula 1043 - WebService - 006 - Consumir WebService - Ler Xml Colocar Tabela-
Started by amarildo, Jan., 21 2017 11:09 AM - 1 reply
Connect yourself…
amarildo
#1
Registered member
535 messages
Popularité : +14 (14 votes)
Posted on January, 21 2017 - 11:09 AM
// 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
Report
0
0
BOLLER
#2
Registered member
3,651 messages
Popularité : +175 (223 votes)
Posted on February, 09 2017 - 11:00 AM
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Report
0
0
→ Go back to WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text