Hi All,
I am trying to consume external web service in AX 2009, every thing looked find and I see the method exposed in the intellisense but when I pass the required parameters I get following error message:
"The class xxxTestWcfService.xxxWsCashpayreceiptClient does not contain this function."
Further when I tried to regenerate the service from AOT I get following errors:
ClrObject static method invocation error.
The process cannot access the file 'C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\Dynamics Ax\01\ServiceReferences\xxxTestWcfService\XXxTestWcfService.dll' because it is being used by another process.
.Net assembly is locked by AOS, please restart AOS to load the new generated assembly.

1. I have already restarted AX
2. I have full admin rights on AX and have full access rights to the specified path
3. Also tried with server Admin rights
4. My class is running on Server (Tried keeping called from)
Below is my code in AX:
public void sendReceiptData()
{
xxxTestWcfService.CxcWsCashpayreceiptClient proxy;
xxxTestWcfService.cashpayreceiptDetail detail;
System.Exception e;
;
try
{
new InteropPermission(InteropKind::ClrInterop).assert();
detail = new CxCTestWcfService.cashpayreceiptDetail();
detail.set_RefNo("INV001");
detail.set_DetAmt(1500);
detail.set_Remark("Remarks INV001");
// Call the WCF method.
proxy = new xxxTestWcfService.CxcWsCashpayreceiptClient("xxxWsCashpayreceiptSoapBinding");
proxy.receivedCashpayreceiptMessage("S",False,"DOCID123",systemdateget(),"1001","counterparty123","USD",1.00,1000,"Payment",detail);
CodeAccessPermission::revertAssert();
}
catch (Exception::CLRError)
{
e = CLRInterop::getLastException();
while( e )
{
info( e.get_Message() );
e = e.get_InnerException();
}
}
}
ERROR: "The class xxxTestWcfService.xxxWsCashpayreceiptClient does not contain this function."
Kindly guide me on the issue.
Thanks in advance