GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV 25
→
Webservice Soap com Autenticação no cabeçalho/Header
Webservice Soap com Autenticação no cabeçalho/Header
Iniciado por Boller, jun., 28 2020 1:44 PM - Sem resposta
Conecte-se…
Boller
#1
Membro registado
3.651 mensagems
Popularité : +175 (223 votes)
Publicado em junho, 28 2020 - 1:44 PM
Bom dia
Segue abaixo o exemplo
Les requêtes aux WebServices
sont
envoyées au serveur Web enveloppées
DANS un Document
xml
.
Pour certains WebServices l
’
authentification
est
faite grâce
un
entête à ajouter au
Document
xml
.
Prenons
par
exemple
un
WebService qui nécessite ce type d
’
authentification
:
<
soapenv
:
Envelope xmlns
:
xsi
=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns
:
xsd
=
"http://www.w3.org/2001/XMLSchema"
xmlns
:
soapenv
=
"http://schemas.xmlsoap.org/soap/envelope/"
xmlns
:
net
=
"http://www.WS.TEST/TestST"
>
<
soapenv
:
Header
>
<
WebServiceLogin xsi
:
type
=
"net:WebServiceLogin"
>
<
RefClient xsi
:
type
=
"xsd:int"
>
?
<
/
refClient
>
<
NomUser xsi
:
type
=
"xsd:string"
>
?
<
/
NomUser
>
<
MotPasse xsi
:
type
=
"xsd:string"
>
?
<
/
MotPasse
>
<
/
WebServiceUser
>
<
/
soapenv
:
Header
>
<
soapenv
:
Body
>
<
net
:
getListeCommandes soapenv
:
encodingStyle
=
"http://schemas.xmlsoap.org/soap/encoding/"
>
<
dateDeb xsi
:
type
=
"xsd:string"
>
?
<
/
dateDeb
>
<
dateFin xsi
:
type
=
"xsd:string"
>
?
<
/
dateFin
>
<
/
net
:
getListeCommandes
>
<
/
soapenv
:
Body
>
<
/
soapenv
:
Envelope
>
On voit
DANS une
requête type
,
la partie concernant l
’
enveloppe
,
une
partie
«
Header
»
AVEC
l
’
authentification
ET une
partie
«
Body
»
AVEC
l
’
appel du WebService
.
une
fois importé
DANS
WINDEV
,
le WebService va exposer la
Procedure
getListeCommandes qui attend deux paramètres
(
une
date
de
début
ET une
date
de FIN
)
ET une structure
WebServiceLogin
.
DANS
ce WebService
,
il faut donc ajouter lors
de
l
’
authentification la référence client
,
le nom
de
l
’
utilisateur
ET
le mot
de
passe
DANS
l
’
entête du
Document
xml
.
On
Utilise
pour cela la
FONCTION
SOAPAjouteEntête
(
)
en déclarant
une Variable de
ce type
:
LoginWs
est un
WebServiceLogin
LoginWs.RefClient
=
"9811X1255"
LoginWs.NomUser
=
"adresse.complement@domaine.fr"
LoginWs.MotPasse
=
"MotPasse"
SOAPAjouteEntête
(
TestST
,
LoginWs
)
Vous pouvez ensuite appeler directement la
FONCTION
du WebService souhaitée
:
wsResponse
=
TestST.GetListeCommandes
(
"20190114"
,
"20200414"
)
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Denunciar
0
0
→ Voltar para WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto