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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Consuming large volume of projects using AIF WCF Service over .NET

(0) ShareShare
ReportReport
Posted on by

We have a WCF service that brings back all the related fields for a project based on a query.  This is exposed via an inbound port over WCF Services.  We consume this from C# using findkeys followed by read.  This works but is taking too long.  Each one takes .04 seconds and we have 60,000 which means a full extract takes about 7 hours.  I've tried altering the number of keys I read doing it in 10s, 100s or even a 1000.  100 is optimal but it doesn't make a huge difference.  I don't think its a sqlserver issue, but the ax32srv.exe (AOS) process consumes one core continuously whilst this is running.  Anyone got any suggestions as to how I might speed this up.  I have a similar thing for Customers and it takes about 1/3 rd the time.  I can extract 50,000 in 2 hours.  That's still slow compared to SQL, but I can live with it.  In the data policy I tried to untick all fields and just get the ones I wanted, but there are a lot of mandatory fields.  I'm wondering what the AOS is actually doing?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Dick Wenning Profile Picture
    8,705 Moderator on at
    RE: Consuming large volume of projects using AIF WCF Service over .NET

    analyze the query behind the service and remove all that is not needed.

    also incase of ax 2012, do you need the replacement keys?

  • Verified answer
    Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    RE: Consuming large volume of projects using AIF WCF Service over .NET

    You could change fields to non-mandatory by calling setParmMethodAsNotMandatory() in Ax* classes (find an example here), but if your goal is not to return the whole valid document, you don't seem to need document services (and their overhead) at all. What about simply using the Query service? It looks like the right tool for what you described.

  • Community Member Profile Picture
    on at
    RE: Consuming large volume of projects using AIF WCF Service over .NET

    Thanks Martin, this is helpful. I agree about the serialization.  

    Do you or anyone else know how you can limit the number of fields that is pulled back.  In the data policies I can not disable fields which are "required".  Whilst they might be required for adding, I am only calling a find or read and only need a small number of fields.  So I can see why required fields would be needed for documents coming in, but in theory I might just want to pul out the ProjIds. In data Policies you can't untick a field where it it required.

  • Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    RE: Consuming large volume of projects using AIF WCF Service over .NET

    I believe that what takes the most time is the serialization from AX data to XML messages, but you should try measure that in your system. If one document service is significantly slower than another, there should be a reason for that and it might be identified with Trace Parser, for instance.

    You can't do much about the serialization - you can limit number of fields (as you did), but there is still overhead that doesn't depend on message size.

    I have few suggestions, though:

    • Disable any logging that may be in place.
    • If there are message transformation, check their performance impact.
    • If applicable, you could switch to an asynchronous adapter and benefit from parallel processing.
    • You may create an custom service that won't depend on the heavy serialization framework in document classes, so you may get much better performance. Nevertheless you would lose many features, so think it through carefully.
    • If you create a custom service, you may even use WCF streaming (I successfully tried it in AX2012), which removes the whole problem with number of service calls, but you would have to do quite a lot of work by yourself.

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans