Tuesday, November 06, 2012

Tech Tuesday - Calling the SmartConnect Web Service


For this week we have a little more content than normal for our tech article. Chris Dew has put together a couple of Visual Studio projects along with a map so developers can take a look at how to run maps from our web service in their own programs:

We are seeing more developers wanting to use SmartConnect and eConnect and they are finding the use of our webservice one of the best ways to quickly roll out solutions that need to push instead of pull when it comes to integration with Dynamics GP and CRM.

Last month we introduced the new Excel GL Template that calls our web service from VBA. This week we will explore calling two methods of our web service from C# or VB.NET. I won’t go into the specifics of the code here because you can download the code as Visual Studio projects that will work on Visual Studio 2010 or Visual Studio 2012 from the link below:

Web Service Sample

There are two main methods that you will want to use, RunMap and RunMapWithDataTable. The RunMap method of the web service is very simple, the only parameter it accepts is a SmartConnect Map ID. This will then run the specified map with whatever the data source was configured (ie. Excel Sheet, Text File, SQL table). The second function, RunMapWithDataTable, accepts two parameters. The first parameter is the SmartConnect Map ID like the previous method but the second parameter is the XML representation of the data you want. What does this mean? Well, now you can overwrite the data source for the map and use your own. This means that even a map that was configured to use a data source of Excel can now push data from a website. The main requirement is that the columns you pass in must match the originally configured data source.

We will have a new web service coming out next year that will have some additional features on requesting information and returning it to your application so stay tuned for that.

Again, we always appreciate your feedback on what we are providing so let me know!

Thanks,
Chris Dew

1 comment:

john steve said...

The information is very useful!Thank you for sharing the information!Keep up the great works !
Business Planning Brisbane