Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Gabo248 Absent Member.
Absent Member.
622 views

Using an OCX/COM provided to communicate with a webservice

Hello

First to all, I must say: I´d never used OCX. 

 

Now I´m fighting to add to my system a requirement wich let me offer a solution to a client.

This requirement is : To update the status and location of some particular medicines (oncologic, VIH, etc)  in a web service ensuring the trazability by the serial number included in this medicines by a data matrix code.

The web service comes from an organism called ANMAT (http://www.anmat.gov.ar/trazabilidad.asp)  who rules this, so, to sell or move a one of this medicines the client (Hospital, Pharmacy, Provider, etc) must update the status in.

 

I'm no prepared to create it from the beginning, so I found some supports who offers me an interface (with a cost I could pay) which work with an OCX to do this task and obtain a transaction number.

They send me this example in VB to try to understand how it work:

 

Dim TrazaMed As Object, ok As Variant

' Create the interface COM
Set TrazaMed = CreateObject("TrazaMed")

' Set security credentials
TrazaMed.Username = "testwservice"
TrazaMed.Password = "testwservicepsw"

' Conect to server (test)
ok = TrazaMed.Conectar()

' test data
usuario = "pruebasws": Password = "pruebasws"
f_evento = "25/11/2011": h_evento = "04:24"
gln_origen = "glnws": gln_destino = "glnws"
n_remito = "1234": n_factura = "1234"
vencimiento = "30/11/2011": gtin = "GTIN1": lote = "1111"
numero_serial = "12348": id_obra_social = "": id_evento = 133
cuit_origen = "20267565393": cuit_destino = "20267565393":
apellido = "Reingart": nombres = "Mariano"
tipo_docmento = "96": n_documento = "26756539": sexo = "M"
direccion = "Saraza": numero = "1234": piso = "": depto = ""
localidad = "Hurlingham": provincia = "Buenos Aires"
n_postal = "B1688FDD": fecha_nacimiento = "01/01/2000"
telefono = "5555-5555"

' Send data and process results:
ok = TrazaMed.SendMedicamentos(usuario, Password, _
                     f_evento, h_evento, gln_origen, gln_destino, _
                     n_remito, n_factura, vencimiento, gtin, lote, _
                     numero_serial, id_obra_social, id_evento, _
                     cuit_origen, cuit_destino, apellido, nombres, _
                     tipo_docmento, n_documento, sexo, _
                     direccion, numero, piso, depto, localidad, provincia, _
                     n_postal, fecha_nacimiento, telefono)

Debug.Print "Resultado:", TrazaMed.Resultado
Debug.Print "CodigoTransaccion:", TrazaMed.CodigoTransaccion
    
For Each er In TrazaMed.Errores
     MsgBox er, vbExclamation, "Error!"
Next
    
MsgBox "Resultado: " & TrazaMed.Resultado & vbCrLf & _
        "CodigoTransaccion: " & TrazaMed.CodigoTransaccion, _
        vbInformation, "Resultado"

 

¿ My question is how to do this wit ACU?

 

If  somebody could give some guidance with this I'd appreciate that

 

 

 

Gabo248

If somebody calls you "Dinosaur" due to programming with Cobol, answer "yes, but I´m GODZILLA" Cool

0 Likes
1 Reply
Knowledge Partner
Knowledge Partner

RE: Using an OCX/COM provided to communicate with a webservice

I am not able to read Spanish, but it seems that the web service you are using is a SOAP web service. In this case, I would recommend that it is easier to use RMNet which has been available with AcuCOBOL for several releases.

Documentation at documentation.microfocus.com/.../index.jsp

Tom Morrison
Consultant

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.