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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Service operations parameter error in ax 2012.

(0) ShareShare
ReportReport
Posted on by 145

Hi members,

while across the inbound services in ax 2012 r3, found a little bit confusing error and here the details,

Create one inbound service with an operation which accept one parameter as well. This is worked fine. The details below,

Ax side.Ax side.

ServiceErr1.1.PNG Visual Studio side with exposing the param.

ServiceErr1.2.PNGParam shows with in the service reference.

Then i created another method in data-contract class and added into operations & deployed.(CIL & Full CIL done.) First method parameter type change immediately after service reference updation & shows the invalid parm type error. Here is the second method details,

ServiceErr2.PNGAx side.

ServiceErr2.1.PNG First method param error after service reference updated.

ServiceErr2.2.PNGReference of the 1st method after service reference updation.

I don't know why this happen when i add the 2nd method cause the first method param type. The error cleared after i either remove the 2nd method param or totally removed the 2nd service operation. Any help may appreciated.

I have the same question (0)
  • Martin Dráb Profile Picture
    237,904 Most Valuable Professional on at

    The error says that you have two definitions of 'customer' object - one in ConsumeExternalWebServiceTest.ConsumeExternalWebServiceRef namespace and the other in ConsumeAxserviceWFA.AxServiceRef namespace. And you're trying to assign an object of one type to a variable of another incompatible type, which isn't supported.

    It seems that your AX service refers to a proxy class generated for another AX service. Why? It sounds very strange; maybe you did the whole architecture wrong by mistake. If it's your intention, can you please describe your business scenario?

    Also, the first picture shows that you're using AifCollectionTypeAttribute while the method doesn't return any collection at all. It returns a single integer. Therefore you should delete the attribute.

  • JAYAKRISHNAN M S Profile Picture
    145 on at

    Dear Martin Dráb,

    Am really sorry to late response.

    Point 1: I understood that error. The 'customer' object definition changed only after the 2nd service operation 'parmDataset' has been deployed. Otherwise it works fine. Thats am surprised.

    If you noticed anything unexpectedly please guide me.

    Point 2: It occurs while am testing some service methods. Obviously not an intention.

    Point 3 : Ofcourse. Unexpectedly put the integer as collection type. Will be no more.

  • Verified answer
    Martin Dráb Profile Picture
    237,904 Most Valuable Professional on at

    If you didn't want to use a proxy inside your service operation, then remove these things from your code. Fixing the logic will also fix the compilation error (maybe you'll get another one, but that's a different story).

  • JAYAKRISHNAN M S Profile Picture
    145 on at

    Dear Martin Dráb,

    Right, nonetheless just eager to know whats happened there. Thank you.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans