PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WEBDEV 2024
→
LLamar a Webservice con parametros ocultos en un HEADER
LLamar a Webservice con parametros ocultos en un HEADER
Started by Gustavo Gonzalez, Mar., 16 2018 8:08 PM - 4 replies
Connect yourself…
Gustavo Gonzalez
#1
Posted on March, 16 2018 - 8:08 PM
Hola queria ver si alguien puede ayudarme con la sintaxis necesaria en WINDEV para llamar a un webservice EXTERNO que no esta hecho en windev, incluyendo datos que se pasan como parte del header...
Lo primero que hice fue probarlo de la forma mas estandar posible y para eso utice el programa SOAPUI
https://www.soapui.org/
En ese programa conloco la direccion del WS:
https://hdi.com.uy/hdi/ExternalQuotation/ExternalQuotationMethods.svc
luego el request y funciona perfectamente (
<soapenv:Envelope xmlns:ext="
http://schemas.datacontract.org/2004/07/ExternalQuotation.Model.Data
" xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/
" xmlns:tem="
http://tempuri.org/
"><soapenv:Header>
<wsse:Security xmlns:wsse="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
" xmlns:wsu="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
" soapenv:mustUnderstand="1">
<wsse:UsernameToken wsu:Id="">
<wsse:Username>XXX</wsse:Username>
<wsse:Password Type="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0…
">XXX</wsse:Password>
<wsse:Nonce EncodingType="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0…
"></wsse:Nonce>
<wsu:Created>2017-12-21T14:48:01.646Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header><soapenv:Body>
<tem:GetAgentDataDTOList>
<tem:filter><ext:PageNumber>1</ext:PageNumber><ext:PageSize>50</ext:PageSize>
</tem:filter>
</tem:GetAgentDataDTOList>
</soapenv:Body></soapenv:Envelope>
pero si intento hacerlo desde WINDEV no me funciona me devuelve false...
sMensajeXML is string = [
XUSUARIOX
XCLAVEX
2017-12-21T14:48:01.646Z
1
50
]
bResultado is boolean = SOAPRunXML("https://hdi.com.uy/hdi/ExternalQuotation/ExternalQuotationMethods.svc", sMensajeXML)
Info(bResultado)
//Devuelve: false
Info(ErrorInfo)
////Devuelve: Security Alert: name on security is incorrect or does not match the selected site.
A alguien le sucedio algo similar?
Alguna idea de cual seria la forma correcta de escribir el SOAPRUNXML ?
Report
0
0
Rubén Sánchez Peña
#2
Registered member
795 messages
Popularité : +40 (42 votes)
Posted on September, 06 2018 - 7:31 AM
Hola. Al abrir la URL del servicio web en el navegador este me ha dicho que el certitificado era de tipo autofirmado y que si queria añadir una excepción para acceder a el. Al añadir la excepción ya me ha salido correctamente la información del webservice. Quizasel problemavenga por ahi.
Rubén
Report
0
0
Marcos Ríos
#3
Posted on January, 29 2020 - 1:52 AM
Gustavo,
Esto lo resolvi de la siguiente forma, espero te sea de ayuda.
Creas una variable sHeaderXML is string que contenga el xml original, reemplazas en ese xml los datos que sirven como parametros (wsse:Username y wsse:Password ademas de otros datos).
luego ejecutas el siguiente comando:
bResExecute is boolean = SOAPRunXML("
https://www.sunat.gob.pe:443/ol-it-wsconscpegem/billConsultService
", sHeaderXML)
IF bResExecute = True THEN
// Is the procedure successfully run?
IF SOAPGetResult(SOAPXMLResult) <> "" THEN
// Display the result returned by the procedure
EDT_Rpta_Sunat = SOAPGetResult(SOAPXMLResult)
IF XMLExtractString(SOAPGetResult(SOAPXMLResult),"title") = "SUNAT" THEN
NextTitle("Obteniendo status...")
Error("El servidor de SUNAT esta fuera de servicio")
ELSE
Info("El codigo es: " + XMLToText(XMLExtractString(SOAPGetResult(SOAPXMLResult),"statusCode")),"El mensaje es: " + XMLToText(XMLExtractString(SOAPGetResult(SOAPXMLResult),"statusMessage")))
sTexto = XMLToText(XMLExtractString(SOAPGetResult(SOAPXMLResult),"content"))
END
ELSE
// Display the error returned by the SOAP server
Error(SOAPError(SOAPErrMessage))
END
ELSE
Info("Error")
Error(ErrorInfo(errMessage))
END
Ya tu puedes adecuarlo a tus necesidades.
Saludos,
Marcos Ríos.
Report
1
0
Alfie
#4
Posted on December, 01 2021 - 2:08 AM
Marco una consulta,
todo ese query dónde iría? en el botón para ejecutarlo o en el inicio del proyecto?
Report
0
0
Alfie
#5
Registered member
3 messages
Posted on December, 01 2021 - 2:12 AM
Marco hola,
el query que muestras en qué parte iría? al inicio del proyecto o en el botón para la consulta?
Gracias
Report
0
0
→ Go back to WEBDEV 2024
WINDEV 2024
WEBDEV 2024
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