XML Interoperability

batoha

Active Member
Hello, everybody.
Can anyone list the steps I have to perfom in order to setup XML interoperability on B7333 (Xe) on Windows?
I tried to modify server side jde.ini (KERNEL #6 and #15).
I tried to modify workstation side jde.ini in the same manner.
I get C# code which marshalls strings passed to jdenet.
Nothing helps me to pass through. I always get return code 14 OneWorld connection failed.
Should I create explicit socket connection or should I setup any environment variables? Which port I have to use and do I really have to pay attention to it? What server process I have to start?
I found no information about it. So I got into some kind of vicious circle trying to make it work.

Here is the C# I use to do "CallObject" calls:
///////////////////////////////
[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);

[DllImport("xmlinterop.dll",
EntryPoint = "_jdeFreeXMLResponse@4",
CharSet = CharSet.Auto,
ExactSpelling = false,
CallingConvention = CallingConvention.StdCall,
SetLastError = true)]
private static extern void jdeFreeXMLResponse(IntPtr buf);

public static string JdeXmlRequest(XmlDocument xmlInput, StringBuilder sbServerName,
UInt16 intPort, Int32 intTimeout)
{
StringBuilder sbXML = new StringBuilder();
XmlWriter xWriter = XmlWriter.Create(sbXML);
string result;

xmlInput.WriteTo(xWriter);
xWriter.Close();

IntPtr JDEXMLData = jdeXMLRequest(sbServerName, intPort, intTimeout, sbXML, sbXML.Length);
result = Marshal.PtrToStringAnsi(JDEXMLData);
jdeFreeXMLResponse(JDEXMLData);

return result;

}
///////////////////////////////

With respect, Sergey.
 
Hi Sergey ;

I see nothing wrong with your C# code - not exactly the way I've done it but pretty close. The fact that you are getting the error response '14' tells me that you are 'getting through' to the xmlInterop dll. The thing to check here is to ensure that the jdeRequest element of the xml you are sending contains the attributes 'user' and 'pwd' with a valid + enabled OneWorld userid and password. For example :

<?xml version='1.0' ?>
<jdeRequest type='callmethod' environment='DV7333' user='JDE' pwd='jdepswd' sessionidle='300' session=''>
.
.
.
</jdeResponse>

and yes, the port # is important. Your call should include :

servername - name of the application server
port # - this should be the same port as the serviceNameListen value in the JDENET section of your jde.ini.
timeout - a timeout value
xmlString - the xml you wish to send (as a string)
xmlStringLength - the length of the xml string

I have used this successfully in ERP8.0 (B7334), 8.11 and 8.12 for xml List and callmethod so, uless there is an issue with B7333 xmlinterop, it should work.
 
The only thing i see, would be to change where you are declaring your server & xml in your import statement....Change the stringbuilders to string. Hope that helps.
 
Thanks you for reply. I checked the jde.ini and changed StringBuilders to strings but still no success:

That is what I send as xml:
<?xml version='1.0' ?>
<jdeRequest type='callmethod' user='usrname' pwd='secret' environment='PD7333' session=''>
<callMethodTemplate name='GetAuditInfo' app='xmlinttst'/>
</jdeRequest>

And here is an excerpt from my local jde.ini (kernels sections are included as "last hope"):
[JDENET]
serviceNameListen=6009
serviceNameConnect=6009
netTrace=0

[JDENET_KERNEL_DEF6]
krnlName=CALL OBJECT KERNEL
dispatchDLLName=XMLCallObj.dll
dispatchDLLFunction=_XMLCallObjectDispatch@28
maxNumberOfProcesses=1
numberOfAutoStartProcesses=1

[JDENET_KERNEL_DEF15]
krnlName=XML TRANSACTION KERNEL
dispatchDLLName=XMLTransactions.dll
dispatchDLLFunction=_XMLTransactionDispatch@28
maxNumberOfProcesses=1
numberOfAutoStartProcesses=1

For the beginning I'm just trying to get something from JDEdwards using interoperability. So here I want to get method template. XML code I send is from Xe documentation.
Surely username, password and environment in xml are all exist and ok. And I send it to port 6009 of course.
 
Well, guys.
Here is what I found.
When I changed "[MarshalAs(UnmanagedType.LPWStr)] StringBuilder server" to "[MarshalAs(UnmanagedType.LPStr)] StringBuilder server" it started to connect to my server on port I used (6009). I ran network monitor and saw network packets and my xml request text inside of them. Since that I'm getting the following as a result:
<?xml version='1.0'?>
<jdeResponse>
<returnCode code='16'>jdeXMLResponse receive failed</returnCode>
</jdeResponse>

So, the new question is does anybody know what does that mean and how to cure it?

With respect, Sergey.
 
Sergey

That message means that jdeXMLRequest did not receive a response from the E1 server within the number of seconds passed in the Int32 timeout parameter. Either the value of that parameter is to short or the Call Object kerrnels are having a problem processing the request. Check the value you are passing or the JDE error logs for the COKs on the E1 server to see if they are 'complaining' about anything.
 
Thanks, guys.
Finally I got it working.
Guy who modified server side jde.ini made a minor mistake - he missed one single letter. So kernel didn't work properly.
Now he found this mistake and corrected it. So now everything's fine.
Thanks to all who responded.

With respect, Sergey.
 
Hi I saw your post on this, I am not from DOT Net developer, I have xmlinterop.dll to call "jdeXMLRequest" method, Your code really helped me, but I have a question I thought you could answer it, why "jdeFreeXMLResponse" method is for?
 
Back
Top