Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

Goal: connect to the web services of vPro5 from AX to pass information from AX to vPro5. Goal

$
0
0

Details of the issue:

 To connect from AX to the external web service in vPro5 do the following:

 

1- Create a Class type project in Visual Studio 2010 on the server.

2- We added the web service reference is the following URL: http://10.11.13.203:9999/RestServices.svc which is on the IIS server development and function.

3- compile the project in Visual Studio 2010, we click right and choose the option to send the project to AOT (ie, AX).

4- We right click and select deploy the project.

5- When we go to AX development environment we see that the Visual Studio is there.

6- Create a class AX to refer to the methods of service, we see developing methods exposed smoothly without compilation errors.

7- We use methods through the class created in AX in the right places where we are concerned that the web service running on AX which are the methods insert, update and delete tables corresponding data.

8- When running and debugging the code execution simply ends without indicating any errors and error line is: article = AifUtil :: createServiceClient (clientType);

9- The code written for this is as follows:

 

Note Vpro5 is Program developed in Visual PRO / 5

 

 

 

//Codigo Hecho por Roy Morillo de SitCorp

publicstaticstr AX_Set_Articulo(str _Codigo,str _Nombre,str _Tipo,str _Empresa,str _Operacion)

{

    str resultado;

 

    ClrObject clientType;

 

    Enviar_Datos_Vpro5.Enviar_a_Vpro5.RestServicesClient articulo;

 

    System.Exception ex;

    new InteropPermission(InteropKind::ClrInterop).assert();

 

    try

    {

 

        clientType = CLRInterop::getType("Enviar_Datos_Vpro5.Enviar_a_Vpro5.RestServicesClient");

 

        articulo = AifUtil::createServiceClient(clientType);

 

        resultado = articulo.AX_Set_Articulo(_Codigo,_Nombre,_Tipo,_Empresa,_Operacion);

    }

   catch(Exception::CLRError)

   {

     // Handle the exception and display message in the InfoLog.

     ex = CLRInterop::getLastException();

     resultado = ex.ToString();

   }

 

    return resultado;

 

}

 

I’m waiting for your comments,

 

Best regards,


Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>