AIF Service Name Issue [ AxdVendTable Name Issue ] - AX 2012 R2

Hi,

We are integrating AX 2012 R2 with CRM.

Whenever we create a Vendor / Customer in AX 2012 R2, we are generating the XML for that created record using AIF Service for Vendor / Customer and we are sending this record out of AX in the form of XML message.

Now when we are creating XML for Vendor, the first tag of the XML is because the query name used for Vendor AIF service is “AxdVendTable”.

Whereas when we are creating XML for Customer, the first tag of the XML is because the query name used for Customer AIF service is “AxdCustomer”.

Problem: My issue is with the first tag of Vendor NOT having the tag as .

I tried to make some changes in the AxdBase class where it gets the documentName for the service. When it is getting the documentName for VendTable, I did some coding to change the documentName to “Vendor” only for Vendor Service.

I am sure this is not a fool proof approach.

Question: We already have a query “AxdVendTable” for VendTable provided by default by AX 2012 R2. Can we have one more query on the same table[VendTable] with the name as “AxdVendor” and create altogether a new AIF Service for Vendor. Can we have 2 independent AIF Service on the same table i.e. in our case for VendTable ???

Quick help would be highly appreciated as I am already having a tough deadline for the delivery.

Thanks & Regards,

Muneeb

I would rather do it by an XSLT transformation. It may be a bit difficult for you if you’ve never done it before, but it makes better sense to me. See About the AIF Pipeline and Transforms [AX 2012] for details.

Hey Martin,

Thanks and Appreciate your quick response.

Martin for now what I have done is, I replicated the existing query for Vendor i.e. “AxdVendTable” and renamed the replicated query to “AxdVendor” and using this query I created a new AIF service for Vendor using AIF Document Wizard.

Now I have 2 AIF services for Vendor, one provided by the standard AX i.e. “VendVendTableService” and the new service that I created i.e. “VendorService”.

I didn’t get any error but I observed one thing that the new service that I have created contains more no of Operations compared to the standard service which are as below:

Operations in Standard “VendVendTableService” [Standard]:

  1. Create, 2. Delete, 3. find, 4. findKeys, 5. getChangedKeys, 6. getKeys, 7. Read, 8. Update.

Operations in the Service that I have Created “VendorService” [New]:

  1. Create, 2. Delete, 3. find, 4. findAsOf, 5. findKeys, 6. findKeysAsOf, 7. findKeysRange, 8. findRange, 9. getChangedKeys, 10. getKeys, 11. read, 12. readAsOf, 13. readRange, 14. update.

If I am using the New created AIF Service for Vendor, the first Tag in the XML is coming as “Vendor” and not unlike “VendTable” while using standard service. My issue got resolved doing so but I need to understand logically regarding what i did.

Can you please let me know if what I have done is fool proof or Not. Would appreciate if you can help me understand logically about what I have done and SPECIALLY WHY IS MY SERVICE HAVING MORE NO OF OPERATIONS !!!

Would appreciate for your help.

Thanks a lot in advance.

Thanks & Regards,

Muneeb

Hi Muneeb,

Essentially you have customized this service as per your requirement.

It is up to you to test this service thoroughly from end to end taking into consideration all scenarios.

Not sure what you are expecting from us.

Can you check operations node under your service in AOT? What do you see there?

Hi Harish,

Appreciate for your quick response. Please find my responses as below:

1. Essentially you have customized this service as per your requirement.

It is up to you to test this service thoroughly from end to end taking into consideration all scenarios.

Not sure what you are expecting from us.

Have I customized the existing Vendor Service ? I think since I have duplicated the existing Query and then created the New AIF Vendor Service, is it going to affect the working of existing AIF Vendor Service ? … And when you say end to end testing, what does that mean?

  1. Can you check operations node under your service in AOT? What do you see there?

Operations in Standard “VendVendTableService” [Standard]:

  1. Create, 2. Delete, 3. find, 4. findKeys, 5. getChangedKeys, 6. getKeys, 7. Read, 8. Update.

Operations in the Service that I have Created “VendorService” [New]:

  1. Create, 2. Delete, 3. find, 4. findAsOf, 5. findKeys, 6. findKeysAsOf, 7. findKeysRange, 8. findRange, 9. getChangedKeys, 10. getKeys, 11. read, 12. readAsOf, 13. readRange, 14. update.

Question: How come this New service that I have created having more no of operations compared to the no of operations in the standard service as I have mentioned above.

Would appreciate if you can let me know if the thing that I have done will not affect the working of the standard service ?

Would appreciate if you can let me know your views on the same.

Regards,

Muneeb

Hi Harish,

Appreciate for your quick response. Please find my responses as below:

1. Essentially you have customized this service as per your requirement.

It is up to you to test this service thoroughly from end to end taking into consideration all scenarios.

Not sure what you are expecting from us.

Have I customized the existing Vendor Service ? I think since I have duplicated the existing Query and then created the New AIF Vendor Service, is it going to affect the working of existing AIF Vendor Service ? … And when you say end to end testing, what does that mean?

  1. Can you check operations node under your service in AOT? What do you see there?

Operations in Standard “VendVendTableService” [Standard]:

  1. Create, 2. Delete, 3. find, 4. findKeys, 5. getChangedKeys, 6. getKeys, 7. Read, 8. Update.

Operations in the Service that I have Created “VendorService” [New]:

  1. Create, 2. Delete, 3. find, 4. findAsOf, 5. findKeys, 6. findKeysAsOf, 7. findKeysRange, 8. findRange, 9. getChangedKeys, 10. getKeys, 11. read, 12. readAsOf, 13. readRange, 14. update.

Question: How come this New service that I have created having more no of operations compared to the no of operations in the standard service as I have mentioned above.

Would appreciate if you can let me know if the thing that I have done will not affect the working of the standard service ?

Would appreciate if you can let me know your views on the same.

Regards,

Muneeb

These additional operations are created by the wizard for valid time state documents. That’s a new feature of AX 2012.

Creating a whole new service just to change one element name still sounds ridiculous to me. Your now dealing with artificial problems.