Axd Class not accessible in Webservice

Hi All,

I am working on Ax 2012 R3 AIF.

I have created a document webservice which worked fine for few days. Today I refreshed it by Registering the serice in AX( Path: Services -----> right Click and Choose “Add ins” ---- > “Register service”) and it is showing error in .net.

The error is , It is unable to access the AXD class.

I found that it because of security Key as mentioned in below link:

The SecurityKey field is disabled for Service node. Unable to understand how to assign Security key for the service.

Can you please help how to assign the secirity key for a Service and access AXd class in .net


Could you give us the exact wording of the error?

Thanks Martin for your Reply.

It worked previoulsy but now the AXD class is showing error as below:

The error it is showing is:

Error 1 The type or namespace name ‘AxdProjectQry’ does not exist in the namespace ‘PHIProjectDetails.ProjectSrvNameSpace’ (are you missing an assembly reference?) C:\Users\reddysa\documents\visual studio 2010\Projects\PHIProjectDetails\PHIProjectDetails\Program.cs 13 33 PHIProjectDetails

I am able to see all the methods by the movement i click dot after service name. But unable to find AXD class and showing error does not exist.

Aha, so this has nothing to do with security. You don’t see the proxy class that you expect to be generated in Visual Studio from the description of your service, correct?. How is your code in Visual Studio related to your original question about registering the service? Are you trying to simulate the registration?

Yes Martin, I am unable to see AXD class in the lookup.

I made one small change in AX class and every thing is perfect. I just deployed and registered the service.

Later I am unable to find AXD class in the lookup.

Later I tried deployment and registartion for 2-3 times and also ran CIL from X++.

But still the AXD class is not available in service looup. Can you suggest me some thing.

My sensior thanks for the follow up.

You didn’t explain anything about what you’ve done in Visual Studio. Please do the following:

First of all, refresh the service reference to regenerate proxy classes. Then don’t try to find any class name directly - instead, look at what parameters your service operation accepts (or returns, depending on what you’re doing). Then navigate through properties of the type until you find what you’re looking for (or you prove that your service doesn’t support what you think it should support).

My guess it that you’re expecting an Axd class but the service accepts a *Request object instead.

Thanks Martin for your time.

I checked the parameter of create method what it is accepting.

It is taking the AXDEntity_FirstTableName.

As per your suggestion it is working now but not sure how can AXD class missed in the lookup of webservice.

I refreshed the service refersnce(Path Forms —> AIFServices)

(I used the code from 2 days and it worked perfectly and show how the AXD class is missed.)

Thank you So much Martin.

I can’t comment on your specific situation, because I don’t have enough information.

But I noticed that the proxy classes are generated differently if I use, or don’t use data policies. If I remember it correctly, the services accepts an array of documents in one case and a request in the other. Although it surprised me, I didn’t investigate the root cause of this behaviour.

Maybe you found another similar case.

I’m now working on a document service, so I used the opportunity to check how it works (because I didn’t remember it exactly). It seems that if Customize documents checkbox is ticked on the inbound port, the service accepts an array of AxdEntity_ classes (e.g. AxdEntity_CustTable[]). If it’s not ticked, it accepts the _Axd_ class itself (e.g. AxdCustomer), which has a property for the array of entities.