Estoy tratando de interfacear con un proveedor de servicio electrónico que me ha dado esta dirección para enviar la info de la facturación:
http://190.117.192.69:8090/ws/ws/billService?wsdl
Me parece que es un servicio en local. El tema es que estoy tratando de usar este código que baje del foro:
Code: Select all
function send_soap
local cxml,canswer,nn1
cxml := TxtBoleta()
canswer := fHttpExecute(cxml)
canswer := strtran(canswer,"><",">"+chr(10)+"<")
memowrit("soapanswer.txt",canswer)
msginfo('soap enviado.')
return .t.
function fHttpExecute(cxml)
local endpointUrl,curlHandle,curlErr
local aHeader,cc1
cc1 := ""
endpointUrl := "http://190.117.192.69:8090/ws/ws/billService?wsdl" //<- aqui ya puse la url que me dió el proveedor
aHeader := {}
AADD(aHeader,"Accept-Encoding: gzip,deflate" )
AADD(aHeader,"Content-Type: text/xml;charset=UTF-8" )
AADD(aHeader,'SOAPAction: ""' ) // <- Como sé que debo poner aqui ? se lo pregunto también al proveedor ?
*AADD(aHeader,"User-Agent: Jakarta Commons-HttpClient/3.1" )
curlHandle := curl_easy_init()
if !empty(curlHandle)
/* Specify the Header data */
curl_easy_setopt(curlHandle,HB_CURLOPT_HTTPHEADER,aHeader)
/* Set the endpoint to send the POST to */
curl_easy_setopt(curlHandle, HB_CURLOPT_URL, endpointUrl)
/* Setup response data */
curl_easy_setopt( curlHandle, HB_CURLOPT_DOWNLOAD )
curl_easy_setopt( curlHandle, HB_CURLOPT_DL_BUFF_SETUP )
/* Specify the POST data */
curl_easy_setopt(curlHandle, HB_CURLOPT_POST, 1)
curl_easy_setopt(curlHandle, HB_CURLOPT_POSTFIELDS, cxml)
/* Do everything */
curlErr := curl_easy_perform(curlHandle)
/* Report any errors */
if empty(curlErr)
/* store response in variable */
cc1 := curl_easy_dl_buff_get( curlHandle )
else
? curl_easy_strerror(curlErr)
endif
else
? "No handle"
endif
if !empty(curlHandle)
/* Clean-up libcurl */
curl_global_cleanup( curlHandle )
else
? "Error"
endif
if empty(cc1)
? "Error"
endif
return cc1
Por favor es urgente, es primera vez que uso HTTP y SOAP, hasta ahora he estado trabajando con proveedores a los que les entrego la info en local, no he usado nunca SOAP y HTTP.
Agradeciendo de antemano su gentileza, reciban mis cordiales saludos.