New fields on a Web service

New fields on a Web service - a quick guide to Ax 2012

By: William S. Jacobsen, Senior Ax Consultant, Pingala A/S

It's quite a simple process to add new or existing fields to a service in Ax 2012. But the guides found on the internet, are not very good, and you have to stick together information from different sites, with a lot of unnecessary and sometime confusing info. So, I have made a small guide, with basis in LedgerJournalTrans and thereby the service LedgerGeneralJournalService (ext: GeneralJournalService):

  1. First we need to identify the Query, on which the service is based. Find the service in the form Aif Services (in some CU's it's in System Administration / Setup / Services and Application Integration Framework / Services, in other you should find it in the AOT / Forms / AifServices). Here you will find the connected Service class:

    Service 1

    There are several ways to find the query, but now that we are here, the easiest way is to select "Service operations", chose a operation (typically read or create), that either fetches data or writes data from/to the table, where we want to add fields. Then select "Parameter schema":

    Select either the outbound (if read) or inbound (if create) og and press "View schema"

    Service 3

    The name of the query can now be found in the node "complexType name":

    Service 4

  2. Find the query in the AOT and on the data Source add the fields you want added to the service:

  3. Go to Development workspace / Tools / Application Integration Framework / Update document service:

    Service 6

    Select the Service class you want to update and check on "Regenerate data object classes" and "Update AxBC classes". It will the automatically update all the necessary classes.

     

  4. Go back to the form AIF services (in some CU's it's in System Administration / Setup / Services and Application Integration Framework / Services, in other you should find it in the AOT / Forms / AifServices):

    Service 7

    Press the button Refresh.

    Now we are actually done, if this was a stand-alone service. The updated schemas can now be seen under Service operations.

     

  5. But if the service, as with this service, is a member of a Service Group, we just need one more step: Go to the AOT and find the Service group in Service Groups, right click on it and press "Deploy Service Group".

    Service 8

    Now it can also be seen via the service group.