Topic
  • 15 replies
  • Latest Post - ‏2015-11-18T08:06:05Z by VolkerFriedrich
dchambers
dchambers
1 Post

Pinned topic SDK - first time setup

‏2013-06-24T16:39:17Z |

I have been using ConnectDirect to transfer files but I have no direct knowledge of the product.  An admin set it up and I just drop files into a folder and write an OK file to send them.  Then I can request receipts.

I have now been tasked with using the SDK (in dotNet) to transfer the files.  I have installed the SDK and referenced it in my program.

Can I use the SDK to work with the existing ConnectDirect implementation I described above?  With I need changes to this implementation to use the SDK?

Do I need ConnectDirect for Windows running on my develop machine?  Or can I use the network instance?

 

  • VolkerFriedrich
    VolkerFriedrich
    178 Posts

    Re: SDK - first time setup

    ‏2013-06-28T08:04:58Z  

    Yes, you can use the SDK to work with an existing Connect:Direct node instance. That's the way to do it.

    The node does not require any extra configurations.

    Whether the node is installed locally or on the network does not matter. The SDK always attaches to it using a TCP/IP connection to the node's API port, typically 1363.

    Have a look at the samples provided in the SDK.Net\Samples folder. They should be a good starting point.

  • Mr. Satish
    Mr. Satish
    4 Posts

    Re: SDK - first time setup

    ‏2014-01-15T15:51:10Z  

    Provided sample files does not work and when i run the program it thorws error msg.

    Could not load file or assembly 'ConnectDirectSdk, Version=4.4.3629.27808, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

     

    May i know the reason for it?

  • VolkerFriedrich
    VolkerFriedrich
    178 Posts

    Re: SDK - first time setup

    ‏2014-01-15T17:16:49Z  

    Provided sample files does not work and when i run the program it thorws error msg.

    Could not load file or assembly 'ConnectDirectSdk, Version=4.4.3629.27808, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

     

    May i know the reason for it?

    Make sure you copied the required Connect:Direct SDK files into your the application's folder. For a Release build the files are:
    ConnectDirectSdk.dll
    ConnectDirectSdk.xml
    CdCore.dll
     
    Also make sure the appropriate Visual C++ run-time libraries are installed on your system. For SDK 4.5 and 4.6, download the latest Visual C++ 2008 SP1 Redistributable from Microsoft.
    If you're still using SDK 4.4, then you will need to upgrade. This version is no longer supported.

     

  • Mr. Satish
    Mr. Satish
    4 Posts

    Re: SDK - first time setup

    ‏2014-01-16T08:41:20Z  

    Make sure you copied the required Connect:Direct SDK files into your the application's folder. For a Release build the files are:
    ConnectDirectSdk.dll
    ConnectDirectSdk.xml
    CdCore.dll
     
    Also make sure the appropriate Visual C++ run-time libraries are installed on your system. For SDK 4.5 and 4.6, download the latest Visual C++ 2008 SP1 Redistributable from Microsoft.
    If you're still using SDK 4.4, then you will need to upgrade. This version is no longer supported.

     

    I installed 4.5 version. But when i run the dlls' error shows 4.4 version. I already copied all required dlls and vc++ redstributable already installed. Not sure, why i am getting error. Am i missing anything? I am using Windows 7.
  • VolkerFriedrich
    VolkerFriedrich
    178 Posts

    Re: SDK - first time setup

    ‏2014-01-16T09:35:36Z  
    I installed 4.5 version. But when i run the dlls' error shows 4.4 version. I already copied all required dlls and vc++ redstributable already installed. Not sure, why i am getting error. Am i missing anything? I am using Windows 7.

    Try building one of the provided SDK samples like DotNetSample2 as provided out of the box. Build it for Any CPU or x86, not for x64.

    When I build it here, it creates the following files in the bin\Release folder:

    CdCore.dll
    ConnectDirectSdk.dll
    ConnectDirectSdk.xml
    DotNetSample2.exe
    DotNetSample2.pdb
    DotNetSample2.vshost.exe
    DotNetSample2.vshost.exe.manifest
    

    You error message seems to imply something is missing.

    If you cannot get it to run, open a ticket with IBM support.

  • Mr. Satish
    Mr. Satish
    4 Posts

    Re: SDK - first time setup

    ‏2014-01-27T17:09:00Z  

    Try building one of the provided SDK samples like DotNetSample2 as provided out of the box. Build it for Any CPU or x86, not for x64.

    When I build it here, it creates the following files in the bin\Release folder:

    <pre dir="ltr">CdCore.dll ConnectDirectSdk.dll ConnectDirectSdk.xml DotNetSample2.exe DotNetSample2.pdb DotNetSample2.vshost.exe DotNetSample2.vshost.exe.manifest </pre>

    You error message seems to imply something is missing.

    If you cannot get it to run, open a ticket with IBM support.

    I installed the Version 4.6. it is compiling and working. I am facing new issues now. Thanks for help.

    Let me put my requirement here. so that, you can understnad my issue.

    .Net program creates the file with different file name during the program execution. This file needs to send to remote server through NDM in Async mode. I am trying to use SDK to implement this requirement. Right now, i am using SubmitFile(), Submit() functions. I am not able to meet my requirement by using above statements. Do you have any suggestions or examples which works? IBM provided examples are very generic. It does not have minimum functionality.

    Here is the issues which i am facing to send the file.

    1. I have 2 API;s to submit the file transfer request CD.

    1. Submit

    2. SubmitFile

    When i am using the SubmitFile(), i need to have predefined .cdp file with statements. In my case, i can't use it because my file name changes every time.  Do we have any other options here?

    Submit() - I took the text from working .cdp file and i assigned to string variable and called this API call.  This API call takes first statement from the text and ignores rest. Do you know, how to use this?

    We have very very limited documentation about these API's and examples. Very tough to use .NET SDK with limited knowledge.

    Could you please help on this? Right now, this is a showstopper for me.

     

  • VolkerFriedrich
    VolkerFriedrich
    178 Posts

    Re: SDK - first time setup

    ‏2014-01-30T15:48:56Z  

    I installed the Version 4.6. it is compiling and working. I am facing new issues now. Thanks for help.

    Let me put my requirement here. so that, you can understnad my issue.

    .Net program creates the file with different file name during the program execution. This file needs to send to remote server through NDM in Async mode. I am trying to use SDK to implement this requirement. Right now, i am using SubmitFile(), Submit() functions. I am not able to meet my requirement by using above statements. Do you have any suggestions or examples which works? IBM provided examples are very generic. It does not have minimum functionality.

    Here is the issues which i am facing to send the file.

    1. I have 2 API;s to submit the file transfer request CD.

    1. Submit

    2. SubmitFile

    When i am using the SubmitFile(), i need to have predefined .cdp file with statements. In my case, i can't use it because my file name changes every time.  Do we have any other options here?

    Submit() - I took the text from working .cdp file and i assigned to string variable and called this API call.  This API call takes first statement from the text and ignores rest. Do you know, how to use this?

    We have very very limited documentation about these API's and examples. Very tough to use .NET SDK with limited knowledge.

    Could you please help on this? Right now, this is a showstopper for me.

     

    Use symbolic variables in your C:D process. This will work for both API's, i.e. whether you call Submit() for an in-memory process or call SubmitFile() for a pre-defined .cdp file.

    DotNetSample2 gives an example. The steps are basically:

     

    (1) Modify your C:D process text to use symbolic variables, like &FNAME in this example.

    TEST PROCESS
        &FNAME=""
        SNODE=MYSNODE

     COPY FROM (FILE="&FNAME") TO (FILE="destfile.txt" DISP=RPL)

    PEND

     

    (2) Let your SDK program assign values to those symbolic variables

    Dictionary<String, String> mySymbolics = new Dictionary<String, String>();
    mySymbolics.Add("&NAME", "myfile.txt");

     

    (2) Submit your process passing the passing the symbolic variables along. It's similar for both the Submit() and SubmitFile() method:

    _node.SubmitFile(stProcess, Node.Hold.holdNo, null,mySymbolics);
    _node.Submit(stText, Node.Hold.holdNo, null, mySymbolics);

    Updated on 2014-01-30T15:51:22Z at 2014-01-30T15:51:22Z by VolkerFriedrich
  • Mr. Satish
    Mr. Satish
    4 Posts

    Re: SDK - first time setup

    ‏2014-01-31T02:06:52Z  

    Use symbolic variables in your C:D process. This will work for both API's, i.e. whether you call Submit() for an in-memory process or call SubmitFile() for a pre-defined .cdp file.

    DotNetSample2 gives an example. The steps are basically:

     

    (1) Modify your C:D process text to use symbolic variables, like &FNAME in this example.

    TEST PROCESS
        &FNAME=""
        SNODE=MYSNODE

     COPY FROM (FILE="&FNAME") TO (FILE="destfile.txt" DISP=RPL)

    PEND

     

    (2) Let your SDK program assign values to those symbolic variables

    Dictionary<String, String> mySymbolics = new Dictionary<String, String>();
    mySymbolics.Add("&NAME", "myfile.txt");

     

    (2) Submit your process passing the passing the symbolic variables along. It's similar for both the Submit() and SubmitFile() method:

    _node.SubmitFile(stProcess, Node.Hold.holdNo, null,mySymbolics);
    _node.Submit(stText, Node.Hold.holdNo, null, mySymbolics);

    Thank you for your reply. I will check tomorrow and let you know the status. 

     

    I observed that, some typo in my requirement. I need to send file through Synchronous mode   not Asynchronous mode.  Do we have any command to make it sync mode?

    I want to check the status of Copy command. Do we have any static audit field to get the status of copy command?

     

    string stText = "TEST PROCESS
        &FNAME=""
        SNODE=MYSNODE

     COPY FROM (FILE="&FNAME") TO (FILE="destfile.txt" DISP=RPL)

    PEND"

     

    When i  call _node.Submit(stText, Node.Hold.holdNo, null, mySymbolics);

    it just takes the "TEST PROCESS" statement and rest ignores it and no execution of copy statement. Do you know the reason for it?

    if you have any working example, can you forward to me? satishnetmeeting@yahoo.com

     

     

    If   file transfer failed after executing  submit() API, i am writing custom logic to re call the submit() API. Do we really need this mechanism or NDM can do the retry of file transfer automatically after a failure?

     

     

  • VolkerFriedrich
    VolkerFriedrich
    178 Posts

    Re: SDK - first time setup

    ‏2014-01-31T11:48:39Z  

    Thank you for your reply. I will check tomorrow and let you know the status. 

     

    I observed that, some typo in my requirement. I need to send file through Synchronous mode   not Asynchronous mode.  Do we have any command to make it sync mode?

    I want to check the status of Copy command. Do we have any static audit field to get the status of copy command?

     

    string stText = "TEST PROCESS
        &FNAME=""
        SNODE=MYSNODE

     COPY FROM (FILE="&FNAME") TO (FILE="destfile.txt" DISP=RPL)

    PEND"

     

    When i  call _node.Submit(stText, Node.Hold.holdNo, null, mySymbolics);

    it just takes the "TEST PROCESS" statement and rest ignores it and no execution of copy statement. Do you know the reason for it?

    if you have any working example, can you forward to me? satishnetmeeting@yahoo.com

     

     

    If   file transfer failed after executing  submit() API, i am writing custom logic to re call the submit() API. Do we really need this mechanism or NDM can do the retry of file transfer automatically after a failure?

     

     

    Once submitted, get the process entry from the node and use WaitForCompletion() to wait for process completion. Shown in SDK.Net\Samples\CSharp Managed\DotNetSample2.

    Process process = _node.ProcessEntry;
    process.WaitForCompletion(timeout);

    Retries of the file transfer are done automatically by the C:D node. No need to call Submit() again.

    Try adding some "\n" to your process text to separate statements accordingly, like between the PROCESS, COPY and PEND statements. The parser cannot recognize them when your process is basically a single line of text. Statements need to be in separate lines.

  • upenlatha
    upenlatha
    2 Posts

    Re: SDK - first time setup

    ‏2014-09-03T05:35:14Z  

    Try building one of the provided SDK samples like DotNetSample2 as provided out of the box. Build it for Any CPU or x86, not for x64.

    When I build it here, it creates the following files in the bin\Release folder:

    <pre dir="ltr">CdCore.dll ConnectDirectSdk.dll ConnectDirectSdk.xml DotNetSample2.exe DotNetSample2.pdb DotNetSample2.vshost.exe DotNetSample2.vshost.exe.manifest </pre>

    You error message seems to imply something is missing.

    If you cannot get it to run, open a ticket with IBM support.

    I am getting following error.  I am not abe to figure out what is the issue.

    Could not load file or assembly 'ConnectDirectSdk.dll' or one of its dependencies. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail. (Exception from HRESULT: 0x800736B1)

    I copied all the DLLs to the bin\debug folder. 

     

  • VolkerFriedrich
    VolkerFriedrich
    178 Posts

    Re: SDK - first time setup

    ‏2014-09-12T08:13:35Z  
    • upenlatha
    • ‏2014-09-03T05:35:14Z

    I am getting following error.  I am not abe to figure out what is the issue.

    Could not load file or assembly 'ConnectDirectSdk.dll' or one of its dependencies. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail. (Exception from HRESULT: 0x800736B1)

    I copied all the DLLs to the bin\debug folder. 

     

    Are you using SDK 4.6.0 with Visual Studio 2010 or later?

    Then have a look a this Technote: Sterling Connect Direct SDK is failing while trying to run sample

     

  • upenlatha
    upenlatha
    2 Posts

    Re: SDK - first time setup

    ‏2014-09-17T04:26:31Z  

    Are you using SDK 4.6.0 with Visual Studio 2010 or later?

    Then have a look a this Technote: Sterling Connect Direct SDK is failing while trying to run sample

     

    Thanks Volker.  Yes.  I am running VS 2010.  It was DLL location issue.  I copied right DLL to exe folder and I was able to run.

     

  • Ameya02
    Ameya02
    2 Posts

    Re: SDK - first time setup

    ‏2015-10-16T13:47:09Z  
    • upenlatha
    • ‏2014-09-17T04:26:31Z

    Thanks Volker.  Yes.  I am running VS 2010.  It was DLL location issue.  I copied right DLL to exe folder and I was able to run.

     

    Hi, 

    Where can I get the connectdirectsdk.dll from?

  • Ameya02
    Ameya02
    2 Posts

    Re: SDK - first time setup

    ‏2015-10-16T13:47:43Z  

    Are you using SDK 4.6.0 with Visual Studio 2010 or later?

    Then have a look a this Technote: Sterling Connect Direct SDK is failing while trying to run sample

     

    Hi, 

    Where can I get the connectdirectsdk.dll from?

  • VolkerFriedrich
    VolkerFriedrich
    178 Posts

    Re: SDK - first time setup

    ‏2015-11-18T08:06:05Z  
    • Ameya02
    • ‏2015-10-16T13:47:43Z

    Hi, 

    Where can I get the connectdirectsdk.dll from?

    connectdirectsdk.dll is part of the SDK.