The most frequently asked question here is 'how do I get started with eConnect?'. I've long known that the first example with any programing paradigm is the hardest thing to do - it's as true with VB.NET or ASP.NET as it is with eConnect. Here is a step by step walk through on how to get started.
Assumptions
The sample code provided written in Visual Studio 2008, VB.NET, ASP.NET in VB, and written against Dynamics GP 10.0. We assume familiarity with that environment.
The sample code is SAMPLE CODE ONLY, NOT FIT FOR PRODUCTION USE. It is intended to teach eConnect, and should not be used for any other purpose.
The files provided are compacted with WinRAR.
Introduction
First, read this, it's a conceptual primer for eConnect. It will tell you what eConnect does. http://vstoolsforum.com/forums/p/350/731.aspx#731
Help File
Download and read the help file, which is here. Yes, read it. Every word.
http://vstoolsforum.com/downloads/eConnect 10ProgrammersGuide.rar
Next, go back to the step above. You really need to do this.
Serialization vs Manual coding
Serialization
Serialization means that we instantiate eConnect objects and populate them, then use those objects to create the XML document that eConnect needs. That's an advanced topic, so we'll skip it for now.
Manual Coding
By 'manual coding', I mean that we're going to create an XML document by hand and then feed it to eConnect. The document that we're going to use will create/update a customer record.
eConnect has a 'client - server' relationship with Dynamics, meaning that your code frequently does not reside on the SQL Server. That can cause issues if you try to send a transaction from your client machine to the server, you have to set up 'DCOM' to make that work. I've had issues with this, so I don't do it. On all my jobs I set up a web service on the SQL Server and send that service an XML doc. It is very easy to do, and works without issue. That's what we're going to do here.
Download the VB.NET solution here
http://vstoolsforum.com/downloads/econnect10.rar
and open it up in VS2008. THE CODE MUST BE INSTALLED ON THE SQL SERVER to work. Once you get it working, you can publish the web service to the SQL Server, set a reference to it, and then move the client code off the server. For this example we're going to do it as simply as possible.
There are three projects in the sample solution. eConnect10 is the main library, Econnect Service is the Web Service, and Tester is a VB application that call the eConnect code and service.
The most frequently asked question here is 'how do I get started with eConnect?'. I've long known that the first example with any programing paradigm is the hardest thing to do - it's as true with VB.NET or ASP.NET as it is with eConnect. Here is a step by step walk through on how to get started.
Assumptions
The sample code provided written in Visual Studio 2008, VB.NET, ASP.NET in VB, and written against Dynamics GP 10.0. We assume familiarity with that environment.
The sample code is SAMPLE CODE ONLY, NOT FIT FOR PRODUCTION USE. It is intended to teach eConnect, and should not be used for any other purpose.
Introduction
First, read this, it's a conceptual primer for eConnect. It will tell you what eConnect does. http://vstoolsforum.com/forums/p/350/731.aspx#731
Help File
Download and read the help file, which is here. Yes, read it. Every word.
http://vstoolsforum.com/downloads/eConnect%2010%20ProgrammersGuide.chm
Serialization vs Manual coding
Serialization
Serialization means that we instantiate eConnect objects and populate them, then use those objects to create the XML document that eConnect needs. That's an advanced topic, so we'll skip it for now.
Manual Coding
By 'manual coding', I mean that we're going to create an XML document by hand and then feed it to eConnect. The document that we're going to use will create/update a customer record.
eConnect has a 'client - server' relationship with Dynamics, meaning that your code frequently does not reside on the SQL Server. That can cause issues if you try to send a transaction from your client machine to the server, you have to set up 'DCOM' to make that work. I've had issues with this, so I don't do it. On all my jobs I set up a web service on the SQL Server and send that service an XML doc. It is very easy to do, and works without issue. That's what we're going to do here.
Download the VB.NET solution here
http://vstoolsforum.com/downloads/econnect10.rar
and open it up in VS2008. THE CODE MUST BE INSTALLED ON THE SQL SERVER to work. Once you get it working, you can publish the web service to the SQL Server, set a reference to it, and then move the client code off the server. For this example we're going to do it as simply as possible.
There are three projects in the sample solution. eConnect10 is the main library, Econnect Service is the Web Service, and Tester is a VB application that call the eConnect code and service.
Steps To Get The Code Working
Open the app.config code in the tester and locate the <appSettings> section. Edit the 'webservice' key to point to the 'Econnect Service' project in the solution. The easiest way to do this is to delete and re add the service reference to the web service in the Tester application. Carefully note the URL for the service as you do it. Note: The application is written is such a way that you can easily change from the development web service to one published on your SQL Server. This is controlled by this appSettings key.
In the app.config file, set the reference to your server and database.
In the VB Code, find and replace the references to your server and database.
Run the Tester application, step through the code and watch the transaction as it goes to Dynamics.
If you have any difficulty with this, or if I haven't explained it right, please write me with suggestions.