web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Error while consuming external web service in AX 2009.

(0) ShareShare
ReportReport
Posted on by 1,355

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.

4721.error1.png

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

*This post is locked for comments

I have the same question (0)
  • AxTushar Profile Picture
    1,355 on at

    Any suggestions on this issue will be highly appreciated... As I don't really know what I can do about this ? I have tried to consume the same web service on SoapUI tool and send data to external software, its working.

    But not sure what am I missing in AX 2009.

  • Martin Dráb Profile Picture
    239,634 Most Valuable Professional on at

    Isn't the file locked by some other process?

  • AxTushar Profile Picture
    1,355 on at

    Hello Martin,

    Thanks for your reply, I am using web service for the first time and have consumed the same in AX only once also I have made sure from external software team that particular web service is not being used by any other software.

    So I don't really know , where it might be locked ? Also when I am writing a method in call I am able to access the method and its visible in intellisense also and shows what parameter service method will accept and after passing and compiling class it give me error "The class xxxTestWcfService.xxxWsCashpayreceiptClient does not contain this function."

    Is this because I am not able to regenerate the service reference successfully in AOT ?

  • Verified answer
    Martin Dráb Profile Picture
    239,634 Most Valuable Professional on at

    Use Handle to find out what's locking the file.

    The error ("does not contain this function") possibly means that you're passing a wrong number parameters or wrong types.

  • AxTushar Profile Picture
    1,355 on at

    Than you very much martin your guidance always helps :)  

    I am able to resolve the error ("does not contain this function") as one of the parameter return type was incorrect and actually I got confused because of error message.

    Looking into locking file issue and if I get any solution or reason for locking will share same.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 24

#2
Michel ROY Profile Picture

Michel ROY 14

#3
Jagadabi Profile Picture

Jagadabi 6

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans