📖
zhaoqiang
  • Home
  • Python
    • Python Base
      • Grammar
      • Issue
    • Web DEV
      • Html
      • WebFrame
        • Flask
        • Django
      • WebTemplate
    • Web Crawler
  • Linux
    • Navieboom
    • Telegram Bot
      • RSSBot
      • TwitterBot
    • LetsEncrypt
      • ACME Create
      • ACME Install
    • NextCloud
      • NextCloud创建
      • NextCloud性能优化
    • Google
      • Google Drive
        • 离线下载
      • Chromium
    • Synology
      • Docker
        • 清理Docker占用的磁盘空间
      • Youtube-dl
      • 群晖—-外部访问DDNS教程(第一部分)
      • 群晖—-外部访问DDNS教程(第二部分)
      • SpeedTest - Install
      • BestTrace - Install
      • Rclone - Install
      • IPKG - Install
      • LEDE - Install
    • OpenWrt
      • Compile
        • Lean-4.14
        • Lean-4.9
    • LEDE
    • Linux Base
      • Command
      • Cron
  • DynamicsAX
    • Functions
      • Document Services
        • Auto Generate XML From AX
        • Load XML Files On Server
      • Webservice
      • DB Connect
      • DirectSQL
      • Email Alert
      • Auto Items
      • Auto BOM
      • Auto Order
      • Auto Invoice
      • Auto Packing
    • Data Import
      • Initial Static Data
      • initial Dynamic Data
        • Open SO
        • Open PO
        • Opening Balance
    • Access Right
    • Process
    • Instance
      • DYNAMICS 365 FOR OPERATION INSTANCE
  • Other Skills
    • Markdown
    • GIT
      • Command
    • Office365
Powered by GitBook
On this page
  • Using webservice to connect with Dynamics AX
  • SystemConnector
  • Consume SystemConnector in VS

Was this helpful?

  1. DynamicsAX
  2. Functions

Webservice

#webservice #WCF #AX2009

PreviousLoad XML Files On ServerNextDB Connect

Last updated 5 years ago

Was this helpful?

Using webservice to connect with Dynamics AX

SystemConnector

Consume SystemConnector in VS

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
using SystemConnector.DynamicsAX;

namespace CIG_WCF4AgileAX
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string ret = "";
            //string _XMLStr = GetXmlDocument(@"D:/AgileXml/HDC000076-utf.xml");
            //string _XMLStr = GetXmlDocument(@"E:/AgileXml/test1014/UPD-1014-33-01.xml");
            string _XMLStr = GetXmlDocument(@"E:/AgileXml/test1014/CIG000780.xml");
            //string _XMLStr = "AX-MES-RDIF-Go";
            try
            {
                AXServiceProvider axServiceProvider = new AXServiceProvider();
                //ret = axServiceProvider.handleRFIDData("cig", _XMLStr);
                ret = axServiceProvider.handleAgileData("cig", _XMLStr);
               
            }
            catch (Exception ex)
            {
                ret= ex.ToString();
            }
            Response.Write(ret);
        }

        private static string GetXmlDocument(string xmlPath)
        {
            try
            {
                XmlDocument doc = null;
                if (File.Exists(xmlPath))
                {
                    doc = new XmlDocument();
                    doc.Load(xmlPath);               
                }
                return doc.InnerXml;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Write(ex.Message);
            }
            return null;
        }
    }
}
14MB
CIG_WCF4AgileAX.zip
archive