{"id":406,"date":"2023-11-20T14:13:29","date_gmt":"2023-11-20T06:13:29","guid":{"rendered":"https:\/\/live-d365fo.pantheonsite.io\/?p=406"},"modified":"2023-11-30T10:31:19","modified_gmt":"2023-11-30T02:31:19","slug":"using-webservice-to-connect-with-dynamics-ax","status":"publish","type":"post","link":"https:\/\/dev-d365fo.pantheonsite.io\/using-webservice-to-connect-with-dynamics-ax\/","title":{"rendered":"DynamicsAX\u4e0e\u7b2c\u4e09\u65b9\u7cfb\u7edf\uff08Using-webservice-to-connect-with-Dynamics-AX\uff09"},"content":{"rendered":"\n

Webservice<\/h1>\n\n\n\n

\u7b2c\u4e09\u65b9\u63a5\u53e3\u8c03\u7528AX\u5185\u90e8\u7a0b\u5e8f<\/h2>\n\n\n\n

SystemConnector<\/h3>\n\n\n\n

\u5728”Csharp”\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528”Systemconnector”\u63d0\u4f9b\u7684\u63a5\u53e3\u4ece\u800c\u5b9e\u73b0\u6267\u884cAX\u5185\u90e8\u7a0b\u5e8f\u7684\u529f\u80fd\u3002<\/p>\n\n\n\n

\u5982\uff1aaxServiceProvider.handleAgileData(\"cig\", _XMLStr);<\/code><\/p>\n\n\n\n

\u5b9e\u9645\u4e0a “axServiceProvider” \u662f\u901a\u8fc7\u5185\u7f6e\u51fd\u6570 “CallStaticClassMethod” \u6765\u5b9e\u73b0\u8c03\u7528AX\u5185\u90e8\u7a0b\u5e8f\u3002<\/p>\n\n\n\n

string returnStr = (string)op.CallStaticClassMethod(\"AX Class\", \"Class Method\", _legal, _XMLStr);<\/code><\/p>\n\n\n\n

\u5c06\u7b2c\u4e09\u65b9\u5916\u90e8\u7a0b\u5e8f\u7ec4\u7ec7\u7684XML\u6570\u636e\u4e3b\u52a8\u4f20\u9012\u7ed9AX\uff0cAX\u5185\u90e8\u53ea\u9700\u8981\u89e3\u6790\u8be5XML\u6570\u636e\u5373\u53ef\u6267\u884c\u76f8\u5e94\u7684\u4e1a\u52a1\u903b\u8f91\u64cd\u4f5c\u3002<\/p>\n\n\n\n

\u5728 axServiceProvider \u4e2d\u6211\u4eec\u53ef\u4ee5\u8bbe\u5b9aAX2009\u7684\u73af\u5883\u7aef\u53e3\uff0c\u7528\u6237\uff0c\u5bc6\u7801\uff0c\u516c\u53f8\u7b49\u4fe1\u606f\uff0c\u540c\u6837\u53ef\u4ee5\u6784\u5efa\u66f4\u591a\u7684\u65b9\u6cd5\u6765\u8c03\u7528Ax\u4e0d\u540c\u7684\u529f\u80fd\u3002<\/p>\n\n\n\n

\u4e0b\u6587\u662f\u901a\u8fc7”Csharp”\u4ee3\u7801\u8c03\u7528\u63a5\u53e3\u7684\u6837\u4f8b\uff1a<\/p>\n\n\n\n

Consume SystemConnector in VS<\/h2>\n\n\n\n
\"1\"\/<\/figure>\n\n\n\n

<\/p>\n\n\n\n

\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Web;\nusing System.Web.UI;\nusing System.Web.UI.WebControls;\nusing System.Xml;\nusing SystemConnector.DynamicsAX;\n\nnamespace CIG_WCF4AgileAX\n{\n    public partial class WebForm1 : System.Web.UI.Page\n    {\n        protected void Page_Load(object sender, EventArgs e)\n        {\n            string ret = \"\";\n            \/\/string _XMLStr = GetXmlDocument(@\"D:\/AgileXml\/HDC000076-utf.xml\");\n            \/\/string _XMLStr = GetXmlDocument(@\"E:\/AgileXml\/test1014\/UPD-1014-33-01.xml\");\n            string _XMLStr = GetXmlDocument(@\"E:\/AgileXml\/test1014\/CIG000780.xml\");\n            \/\/string _XMLStr = \"AX-MES-RDIF-Go\";\n            try\n            {\n                AXServiceProvider axServiceProvider = new AXServiceProvider();\n                \/\/ret = axServiceProvider.handleRFIDData(\"cig\", _XMLStr);\n                ret = axServiceProvider.handleAgileData(\"cig\", _XMLStr);              \n            }\n            catch (Exception ex)\n            {\n                ret= ex.ToString();\n            }\n            Response.Write(ret);\n        }\n\n        private static string GetXmlDocument(string xmlPath)\n        {\n            try\n            {\n                XmlDocument doc = null;\n                if (File.Exists(xmlPath))\n                {\n                    doc = new XmlDocument();\n                    doc.Load(xmlPath);               \n                }\n                return doc.InnerXml;\n            }\n            catch (Exception ex)\n            {\n                System.Diagnostics.Debug.Write(ex.Message);\n            }\n            return null;\n        }\n    }\n}\n<\/pre>\n\n\n\n

AX\u5185\u90e8\u7a0b\u5e8f\u8c03\u7528\u7b2c\u4e09\u65b9\u63a5\u53e3<\/h2>\n\n\n\n

AX2009 \u8c03\u7528\u5916\u90e8\u63a5\u53e3\u53ea\u9700\u8981\u6253\u5f00AOT-Reference-\u6dfb\u52a0\u4e00\u4e2a\u670d\u52a1\u5f15\u7528\u5373\u53ef\uff0c\u6dfb\u52a0\u5f15\u7528\u65f6\u53ef\u4ee5\u6dfb\u52a0dll\u6587\u4ef6\u3002<\/p>\n\n\n\n

\u5982\u4e0b\u56fe\uff1a<\/p>\n\n\n\n

\"2\"\/<\/figure>\n\n\n\n
\"3\"\/<\/figure>\n\n\n\n

\u8fd9\u6837\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Webservice \u7b2c\u4e09\u65b9\u63a5\u53e3\u8c03\u7528AX\u5185\u90e8\u7a0b\u5e8f SystemConnector \u5728”Csharp”\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528”Systemconnector”\u63d0\u4f9b\u7684\u63a5\u53e3\u4ece\u800c\u5b9e\u73b0\u6267\u884cAX\u5185\u90e8\u7a0b\u5e8f\u7684\u529f\u80fd\u3002 \u5982\uff1aaxServiceProvider.handleAgileData(“cig”, _XMLStr); \u5b9e\u9645\u4e0a “axServiceProvider” \u662f\u901a\u8fc7\u5185\u7f6e\u51fd\u6570 “CallStaticClassMethod” \u6765\u5b9e\u73b0\u8c03\u7528AX\u5185\u90e8\u7a0b\u5e8f\u3002 string returnStr = (string)op.CallStaticClassMethod(“AX Class”, “Class Method”, _legal, _XMLStr); \u5c06\u7b2c\u4e09\u65b9\u5916\u90e8\u7a0b\u5e8f\u7ec4\u7ec7\u7684XML\u6570\u636e\u4e3b\u52a8\u4f20\u9012\u7ed9AX\uff0cAX\u5185\u90e8\u53ea\u9700\u8981\u89e3\u6790\u8be5XML\u6570\u636e\u5373\u53ef\u6267\u884c\u76f8\u5e94\u7684\u4e1a\u52a1\u903b\u8f91\u64cd\u4f5c\u3002 \u5728 axServiceProvider \u4e2d\u6211\u4eec\u53ef\u4ee5\u8bbe\u5b9aAX2009\u7684\u73af\u5883\u7aef\u53e3\uff0c\u7528\u6237\uff0c\u5bc6\u7801\uff0c\u516c\u53f8\u7b49\u4fe1\u606f\uff0c\u540c\u6837\u53ef\u4ee5\u6784\u5efa\u66f4\u591a\u7684\u65b9\u6cd5\u6765\u8c03\u7528Ax\u4e0d\u540c\u7684\u529f\u80fd\u3002 \u4e0b\u6587\u662f\u901a\u8fc7”Csharp”\u4ee3\u7801\u8c03\u7528\u63a5\u53e3\u7684\u6837\u4f8b\uff1a 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 : …<\/p>\n

Continue reading ‘DynamicsAX\u4e0e\u7b2c\u4e09\u65b9\u7cfb\u7edf\uff08Using-webservice-to-connect-with-Dynamics-AX\uff09’ »<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[39],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/posts\/406"}],"collection":[{"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/comments?post=406"}],"version-history":[{"count":12,"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/posts\/406\/revisions"}],"predecessor-version":[{"id":613,"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/posts\/406\/revisions\/613"}],"wp:attachment":[{"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/media?parent=406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/categories?post=406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev-d365fo.pantheonsite.io\/wp-json\/wp\/v2\/tags?post=406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}