Our support engineers have assembled the top recommended solutions for you.
Microsoft Dynamics AX 2012CRM Connector in Microsoft Dynamics AX 2012Financials Management in Microsoft Dynamics AX 2012Upgrading to Microsoft Dynamics AX 2012
Microsoft Dynamics AX 2009
Application Object Server (AOS)
Enterprise Portal and Role Centers
Inventory Costing in Microsoft Dynamics AX 2009
Invoice Settlements/Discounts/Reversals
SSRS and SSAS Integration
Workflow
Hello,
I am getting error in integration of CRM and AX through custom web service.
First what i have done is i made a WCF web service in which i referenced my AX AIF web service.
And then i call that WCF web service on my CRM form on save. In this way i am going to integrate AX with CRM.
I am putting some code here...
ax.SalesOrderServiceClient sc = new ax.SalesOrderServiceClient(); sc.ClientCredentials.Windows.ClientCredential.UserName = "crmusername"; sc.ClientCredentials.Windows.ClientCredential.Password = "crmpassword"; sc.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation; // Create an instance of the document class. ax.AxdSalesOrder salesOrder = new ax.AxdSalesOrder(); // Create instances of the entities that are used in the service and // set the needed fields on those entities. ax.AxdEntity_SalesTable salesTable = new ax.AxdEntity_SalesTable(); salesTable.CurrencyCode = "INR"; salesTable.CustAccount = "C-00000001"; salesTable.DeliveryDate = Convert.ToDateTime("11/28/2012"); //salesTable.Payment = "100 %"; salesTable.PurchOrderFormNum = "PO"; ax.AxdEntity_SalesLine salesLine = new ax.AxdEntity_SalesLine(); salesLine.ItemId = "ITEM00000015"; salesLine.SalesQty = Convert.ToDecimal(10); salesLine.SalesUnit = "NOS"; ax.AxdEntity_InventDim inventDim = new ax.AxdEntity_InventDim(); inventDim.configId = "--"; inventDim.InventColorId = "0"; inventDim.InventSizeId = "GENERAL"; // Add the sub-entity instances to their parent entities as an array // of the sub-entity type. salesLine.InventDim = new ax.AxdEntity_InventDim[1] { inventDim }; salesTable.SalesLine = new ax.AxdEntity_SalesLine[1] { salesLine }; salesOrder.SalesTable = new ax.AxdEntity_SalesTable[1] { salesTable }; try { // Call the create method on the service passing in the document. ax.EntityKey[] returnedSalesOrderEntityKey = sc.create(salesOrder); // The create method returns an EntityKey which contains the ID of the sales order. ax.EntityKey returnedSalesOrder = (ax.EntityKey)returnedSalesOrderEntityKey.GetValue(0); return string.Format("The sales order created has a Sales ID of " ,returnedSalesOrder.KeyData[0].Value); } catch (Exception e) { return string.Format("Error Occurs :- {0}",e.StackTrace.ToString()); }
I am getting error "Request Failed. See the Exception Log for details." at .create method call.
What can be done here.. Please help.
Have you checked the AIF log in AX 2012? You can find the log @ System administration-->Periodic-->Services and Application Integration Framework-->Exceptions.
For sure it is not about the security because you are able to login and pass the AIF message. May be it is because of some missing element in the AIF message (SOAP message). Exceptions log is very useful and provide you the detailed exception message.
From your code, the date handling can be an issue:
salesTable.DeliveryDate = Convert.ToDateTime("11/28/2012");
But you will get the detail about the error through the exception log in AX 2012.
Best Regards,
Skype: AXPuls
Web: www.axpulse.com
how is AIF configured, do you have anonymous access ?
in that case credentials of the user is part of the message header.
First check the AIF Sales Order service whether it is working or not by typing the URL into browser.
If not then regenerate the schema of Sales Order service. If AIF service is working then you can check the exception log as suggested above. It will give clear idea of failing create call of service.
Thanks.