Ver Mensaje Individual
  #2
Antiguo 8 de enero de 2025, 19:16
fastpho
El Foro es mi casa
Innovación: Por aportar innovaciones - Issue reason: SQLite + OO Cobol class Concurso: Primer puesto: Ganador/a del Primer puesto en un concurso - Issue reason: Acceso a datos Cobol vía web 
Última Actividad 21.08.2026 18:08
Posts Posts: 365
Likes enviados Enviados: 252
Likes recibidos Recibidos: 243

Hola @Paulo
Con estos objetos (ChilkatXml ,ChilkatHttp1 , ChilkatHttpResponse ) de Chillkat no he trabajado pero con otros si.

Encontre un ejemplo en vb6 Link
https://www.example-code.com/vb6/soap_web_service.asp

Traducido a PowerCobol algo asi seria :
Espero esto te ayude en algo.
Código COBOL:
  1.  WORKING-STORAGE SECTION.
  2.  01 success      pic s9(9) comp-5.
  3.  01 XmlFile      pic x(50) value spaces.
  4.  01 endpointUrl  pic x(50) value spaces.
  5.  01 xmlContent   pic x(50) value spaces.
  6.  01 xmlCharset   pic x(5)  value spaces.
  7.  01 responseStatusCode  pic s9(9) comp-5.
  8.  
  9.  PROCEDURE       DIVISION.
  10. *objetos usados
  11. *    ChilkatXml1
  12. *    ChilkatHttpResponse1
  13. *    ChilkatHttp1
  14.  
  15.      *>-----------------------
  16.     *> xml
  17.      move "ukPostCodeSoap.xml" to XmlFile.
  18.      INVOKE ChilkatXml1 "LoadXml" USING XmlFile RETURNING success.
  19.      if success not = 1 then
  20.         display "error"
  21.         exit program
  22.      else
  23.         display "ok"
  24.      end-if.
  25.       INVOKE ChilkatXml1 "GetXml" RETURNING xmlContent.
  26.       display "xmlContent : " , xmlContent.
  27.    
  28.      *>-----------------------
  29.     *> http
  30.  
  31.      INVOKE ChilkatHttp1 "SetRequestHeader" USING "SOAPAction" "http://www.webserviceX.NET/GetUKLocationByPostCode".
  32.      INVOKE ChilkatHttp1 "SetRequestHeader" USING "Content-Type" "text/xml; charset=utf-8".
  33.    
  34.      *>-------------------------
  35.     *> response
  36.      move "http://www.webservicex.net/uklocation.asmx" to  endpointUrl.
  37.      move "utf-8" to     xmlCharset.
  38.      INVOKE ChilkatHttp1 "PostXml" USING endpointUrl xmlContent xmlCharset RETURNING ChilkatHttpResponse1.
  39.      
  40.      move "StatusCode" OF ChilkatHttpResponse1 to responseStatusCode.
  41.      display "Response Status Code: " , responseStatusCode.
  42.      

Saludos...
fastpho is offline   Responder Con Cita