Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As promised, here is the code for integrating with JDEdewards using XML. It's a webservice, but could be used as you see fit.</p> <pre><code>namespace YourNameSpace </code></pre> <p>{</p> <pre><code>/// &lt;summary&gt; /// This webservice allows you to submit JDE XML CallObject requests via a c# webservice /// &lt;/summary&gt; [WebService(Namespace = "http://WebSite.com/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class JdeBFService : System.Web.Services.WebService { private string _strServerName; private UInt16 _intServerPort; private Int16 _intServerTimeout; public JdeBFService() { // Load JDE ServerName, Port, &amp; Connection Timeout from the Web.config file. _strServerName = ConfigurationManager.AppSettings["JdeServerName"]; _intServerPort = Convert.ToUInt16(ConfigurationManager.AppSettings["JdePort"], CultureInfo.InvariantCulture); _intServerTimeout = Convert.ToInt16(ConfigurationManager.AppSettings["JdeTimeout"], CultureInfo.InvariantCulture); } /// &lt;summary&gt; /// This webmethod allows you to submit an XML formatted jdeRequest document /// that will call any Master Business Function referenced in the XML document /// and return a response. /// &lt;/summary&gt; /// &lt;param name="Xml"&gt; The jdeRequest XML document &lt;/param&gt; [WebMethod] public XmlDocument JdeXmlRequest(XmlDocument xmlInput) { try { string outputXml = string.Empty; outputXml = NativeMethods.JdeXmlRequest(xmlInput, _strServerName, _intServerPort, _intServerTimeout); XmlDocument outputXmlDoc = new XmlDocument(); outputXmlDoc.LoadXml(outputXml); return outputXmlDoc; } catch (Exception ex) { ErrorReporting.SendEmail(ex); throw; } } } /// &lt;summary&gt; /// This interop class uses pinvoke to call the JDE C++ dll. It only has one static function. /// &lt;/summary&gt; /// &lt;remarks&gt; /// This class calls the xmlinterop.dll which can be found in the B9/system/bin32 directory. /// Copy the dll to the webservice project's /bin directory before running the project. /// &lt;/remarks&gt; internal static class NativeMethods { [DllImport("xmlinterop.dll", EntryPoint = "_jdeXMLRequest@20", CharSet = CharSet.Auto, ExactSpelling = false, CallingConvention = CallingConvention.StdCall, SetLastError = true)] private static extern IntPtr jdeXMLRequest([MarshalAs(UnmanagedType.LPWStr)] StringBuilder server, UInt16 port, Int32 timeout, [MarshalAs(UnmanagedType.LPStr)] StringBuilder buf, Int32 length); public static string JdeXmlRequest(XmlDocument xmlInput, string strServerName, UInt16 intPort, Int32 intTimeout) { StringBuilder sbServerName = new StringBuilder(strServerName); StringBuilder sbXML = new StringBuilder(); XmlWriter xWriter = XmlWriter.Create(sbXML); xmlInput.WriteTo(xWriter); xWriter.Close(); string result = Marshal.PtrToStringAnsi(jdeXMLRequest(sbServerName, intPort, intTimeout, sbXML, sbXML.Length)); return result; } } </code></pre> <p>}</p> <p>You have to send it messages like the following one:</p> <pre><code>&lt;jdeRequest type='callmethod' user='USER' pwd='PWD' environment='ENV'&gt; &lt;callMethod name='GetEffectiveAddress' app='JdeWebRequest' runOnError='no'&gt; &lt;params&gt; &lt;param name='mnAddressNumber'&gt;10000&lt;/param&gt; &lt;/params&gt; &lt;/callMethod&gt; &lt;/jdeRequest&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload