Patrick Wensel
Member
I am a C# developer and am struggling!!!
I used this article which has been mentioned in JDEList to build a client for C#.
http://it.toolbox.com/blogs/daniel-at-work/calling-xmlinterop-from-c-via-a-com-object-20923
I am now running the console app to test it and i am getting:
<returnCode code='14'> Connection to OneWorld Failed</returnCode>
I have seen this message on the forums before but nothing has seemed to help. Here is my code:
C++
STDMETHODIMP CXmlinteropClass::jdeXmlRequest(BSTR request, BSTR* response , BSTR host, SHORT port, SHORT timeout)
{
CString csReq(request);
char* cRequest; cRequest = csReq.GetBuffer();
char* presp = jdeXMLRequest( (unsigned short*)host, port, timeout, (void*)cRequest, 0);
CComBSTR* foo = new CComBSTR();
foo->Append(presp);
*response = foo->Detach();
jdeFreeXMLResponse(presp);
return S_OK;
}
C#
static void Main(string[] args)
{
string response;
string request = @"<?xml version='1.0' encoding='utf-8'?> <jdeRequest pwd='Apple2' role='*ALL' type='callmethod' user='sduvedi' session='' environment='DV811' sessionidle=''> <callMethodTemplate name='GetAuditInfo' app='AwiIntegrations' /> </jdeRequest>";
string host = "10.8.66.107";
short port = 6014;
short timeout = 10000;
xmlinterop_comLib.XmlinteropClass foo = new xmlinterop_comLib.XmlinteropClass();
foo.jdeXmlRequest(request, out response, host, port, timeout);
Console.WriteLine(response);
Console.Read();
}
I used this article which has been mentioned in JDEList to build a client for C#.
http://it.toolbox.com/blogs/daniel-at-work/calling-xmlinterop-from-c-via-a-com-object-20923
I am now running the console app to test it and i am getting:
<returnCode code='14'> Connection to OneWorld Failed</returnCode>
I have seen this message on the forums before but nothing has seemed to help. Here is my code:
C++
STDMETHODIMP CXmlinteropClass::jdeXmlRequest(BSTR request, BSTR* response , BSTR host, SHORT port, SHORT timeout)
{
CString csReq(request);
char* cRequest; cRequest = csReq.GetBuffer();
char* presp = jdeXMLRequest( (unsigned short*)host, port, timeout, (void*)cRequest, 0);
CComBSTR* foo = new CComBSTR();
foo->Append(presp);
*response = foo->Detach();
jdeFreeXMLResponse(presp);
return S_OK;
}
C#
static void Main(string[] args)
{
string response;
string request = @"<?xml version='1.0' encoding='utf-8'?> <jdeRequest pwd='Apple2' role='*ALL' type='callmethod' user='sduvedi' session='' environment='DV811' sessionidle=''> <callMethodTemplate name='GetAuditInfo' app='AwiIntegrations' /> </jdeRequest>";
string host = "10.8.66.107";
short port = 6014;
short timeout = 10000;
xmlinterop_comLib.XmlinteropClass foo = new xmlinterop_comLib.XmlinteropClass();
foo.jdeXmlRequest(request, out response, host, port, timeout);
Console.WriteLine(response);
Console.Read();
}