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

Object 'CLRObject' could not be created calling method from Ax 2009 to C#

$
0
0

Hello:

I am new calling C# methods from Ax 2009.

I created a new method in C#. But, when I put the code 

send = new AXV5ElectronicInvoice.Send();

It send the message Object CLRObject could not be created

The C# code is simple:

public class Send
	{
		public string returnValue;
		public void SendDocument(String _User, String _Password, DocumentoElectronico documentoElectronico)
        {
			String returnValue;
			//System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;try
			{
				System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
				AXV5ElectronicInvoice.TfhkaPaWebService.Service service = new Service();
				EnviarResponse enviarResponse = new EnviarResponse();
				enviarResponse = service.Enviar(_User, _Password, documentoElectronico);
				returnValue = " ";
				//return returnValue;
			}
			catch(Exception ex)
            {
				returnValue = "Error";
				//return returnValue;            }
 
 
			
        }
What could be generate this error?.
How I catch the clrInterop message? I put try catch but the error goes directly to Info class.

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>