问题
I am new in AX.
My boss gave me to task to access tables of AX 2012 from C#.
Following are the criteria:
- Code should be generic. (user will give me table name, column name and any condition if there, to execute insert, delete, update or select queries).
- Client and server may be or may not be in same
- Client and server may be or may not be in same domain Without any installation on client machine
I tried Business connector. But, we can't use business connector outside the domain and it requires installation on client machine
I tried web service. But, We need to add service reference for each web service group.
Is there any thing best suitable for my requirement? Or am I missing something while using above two ways?
Please help to resolve this issue. I am doing this since last month.
回答1:
You can use AifGenericDocumentService. The wsdl is available by default at http://_AOS_:_8101_/DynamicsAx/Services/AifGDS?singleWsdl
.
This is a generic web service, so if you don't know the schema for target tables you can also use MetadataService at http://_AOS_:_8101_/DynamicsAx/Services/MetadataService?singleWsdl
You can see an example at https://community.dynamics.com/ax/b/microsoftdynamicsaxintegration/archive/2012/05/06/microsoft-dynamics-ax-2012-application-integration-framework-custom-web-service-loosely-typed
来源:https://stackoverflow.com/questions/31537272/crud-operation-in-ax-tables-using-c-sharp