1. Fernando Leal
  2. PowerBuilder
  3. Wednesday, 11 December 2019 14:40 PM UTC

To invoke a function of the Webservice the system throws the error "Fail to load .NET framework".
I have Installed:
Windows 10 64bits
Powerbuilder 2017 R2
  framework 4.7
IIS 10 express.

 

How can I solve this problem?

Accepted Answer
Kevin Ridley Accepted Answer Pending Moderation
  1. Wednesday, 11 December 2019 21:44 PM UTC
  2. PowerBuilder
  3. # Permalink

Have you tried consuming the WSDL using the Web Service Proxy wizard (.NET engine) and try to call he service that way instead of OLE?  You can try that or the HTTPClient object instead of OLE.

Comment
  1. Kevin Ridley
  2. Thursday, 12 December 2019 12:04 PM UTC
Hi Fernando,

I understand you are having an issue after migrating. I was just trying to give you some alternative options.
  1. Helpful
  1. Fernando Leal
  2. Friday, 13 December 2019 18:16 PM UTC
Hi Chris, very good point, I can run werservice.

I replaced the pbwsclient2019.

thanks and regards.

Fernando.

  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 13 December 2019 20:24 PM UTC
Hi Fernando ... that is great news!

Thank you for letting us know. ;-)
  1. Helpful
There are no comments made yet.
Fernando Leal Accepted Answer Pending Moderation
  1. Wednesday, 11 December 2019 18:54 PM UTC
  2. PowerBuilder
  3. # 1

Hi Chris,
yes.
When I invoke a webservice function it is when the system throws the error.

/token, sign

ls_valor = servicio_cms.logincms(cms)//cms



string msg

boolean lb_success = True



catch ( SoapException e )

msg = "Cannot invoke Web service: " + e.Text + " - " +e.getmessage()

Attachments (2)
Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 11 December 2019 18:20 PM UTC
  2. PowerBuilder
  3. # 2

Hi Fernando;

  Did you step through your code via the PB IDE's "debugger" and locate the exact line of code that fails?

Regards ... Chris

Comment
  1. Fernando Leal
  2. Wednesday, 11 December 2019 18:52 PM UTC
Hi Chris,

yes.

When I invoke a webservice function it is when the system throws the error.



/token, sign



ls_valor = servicio_cms.logincms(cms)//cms







string msg



boolean lb_success = True







catch ( SoapException e )



msg = "Cannot invoke Web service: " + e.Text + " - " +e.getmessage()
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 11 December 2019 20:02 PM UTC
Since the .NET Soap feature was initially built in PB 11.0 - I suspect that you will also need to install the .Net 2.x framework run-time as well. (just my guess).

Note that the .Net SOAP web service interaction was replaced in PB2017 by using the new HTTPClient object class instead. FYI: https://community.appeon.com/index.php/articles-blogs/tutorials-articles/2-powerbuilder/236-call-soap-web-services-using-httpclient-object



  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 11 December 2019 17:41 PM UTC
  2. PowerBuilder
  3. # 3

Hi Fernando;

  Are you trying to build & then invoke a .Net SOAP based Web Service from the PB IDE?

Regards ... Chris

Comment
  1. Fernando Leal
  2. Wednesday, 11 December 2019 18:01 PM UTC
Hi Pollach,

Yes, I used PB IDE.

When I invoke a webservice function it is when the system throws the error.

You can see the code in the next line





string dato;

long conexion_estatus;

pbdom_builder lector_xml;

pbdom_document documento_xml;

pbdom_element elemento_xml;

String ls_valor

oleObject WSAA

oleObject WSFE

long status

string tra

string cms

string ta

string ls_cm_openssl



//crea un objeto soap para conectar al servicio web

//SoapConnection conexion_ws;

conexion_cmss = create SoapConnection;

//LoginCMSService servicio;

servicio_cms = create logincmsservice





// Crear objeto interface Web Service Autenticación y Autorización

WSAA = create oleObject

status = WSAA.ConnectToNewObject("WSAA")



// Generar un Ticket de Requerimiento de Acceso (TRA)

tra = WSAA.CreateTRA(as_nom_servicio_tra) //wsfe



// Generar el mensaje firmado (CMS)

cms =WSAA.SignTRA(tra,as_path_crt,as_path_key)//"C:\Sistema\AFIP\certificado.crt","C:\Sistema\AFIP\clave.key" )



//configura un archivo de logs para ver errores de la conexion

conexion_cmss.setoptions( 'SoapLog= '+'"'+as_path_soaplog+'"'); //"C:\certificado\soaplog.txt" ');

//

try

//conexion_estatus

conexion_estatus = conexion_cmss.createinstance( servicio_cms,servicio_cms.classname());



//Verifica que la conexion se alla realizado con exito

if (conexion_estatus <> 0) then

error_mostrar( "Error al contactar el servicio web.")

end if



//token, sign

ls_valor = servicio_cms.logincms(cms)//cms



string msg

boolean lb_success = True



catch ( SoapException e )

msg = "Cannot invoke Web service: " + e.Text + " - " +e.getmessage()

lb_success = FALSE

catch (PBXRuntimeError e2)

msg = e2.Text + "There is a runtime error when invoking Web service"

lb_success = FALSE

catch (RuntimeError e3)

msg = e3.getmessage() + " There is an unknown error when invoking Web service"

lb_success = FALSE

end try



if lb_success = FALSE then

error_mostrar(msg)

//error_cerrar(msg)

end if

//asignar estado de conexión

ib_estado_conexion = lb_success

return ls_valor



thanks and regards,

Fernando.

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.