Skip to main content

Posts

Showing posts with the label services

Consuming a Web Service in AX 2012 is easy

thank you JORIS DG For those of you who have read my post on the  Windows Azure App , may recall my shortcut for fixing the missing bindings and other app.config settings. I've been meaning to dig into this further and come to a solution, but for the Azure post being constrained by my promised " 10-minute  app " I stuck with the ugly solution. Recently I was talking with the MSDN  team about AIF related articles they are wanting to do, and I brought up this issue. They pointed out they had not seen this issue and asked if I had followed the  whitepaper on consuming webservices . Now, there's not necessarily a lot to it, but in looking over the whitepaper I found one tiny little thing, which makes a world of difference and solves my issue: AIFUtil class! This sparked the idea of doing a follow-up on this, and due to a late night conversation on  Twitter  related to this I figured I really need to get this on my blog. The issue as I'm about to explain ...

Importing Customers, Vendors and Products in AX 2012

This calls the vendor service: using System; using System.Collections.Generic; using System.Linq; using System.Text; using ConsoleApplication9.Vendors; namespace ConsoleApplication9 {     class Program     {         static void Main(string[] args)         {             VendTableServiceClient proxy = new VendTableServiceClient();             CallContext context = new CallContext();            context.Company = "ceu";  //New class that replaces AX endpoints.  It makes it obvious which company you are importing data into.  I love this class!!              AxdVendTable vendor = new AxdVendTable();      ...

Stopping and starting services using x++

This post with the code snippet helps you how to access the status of any windows services using X++. Also, it is easy to start and stop windows services programmatically. Before you start running the code, you need to add reference System.ServiceProcess from the AOT references node. Note : Get_status() method is used to get the status of the service. Code can be modified according to the status of the service. static void start_stop_Service(Args _args) { System.ServiceProcess.ServiceController controller = new System.ServiceProcess.ServiceController(); ; controller.set_MachineName(‘.’); controller.set_ServiceName("IISADMIN"); controller.Stop(); sleep(500); controller.Start(); }