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:
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
The information is very useful!Thank you for sharing the information!Keep up the great works !
Business Planning Brisbane
Hi,
Is it possible to expose your web service as a data source? So one could call the service and get mapped data out of GP.
Hi Chris,
Do you have an answer on the question from Adriaan? I have the same question, where a client wants to use SmartConnect version 20.13.1.89 to export data to the SmartConnect Web Service.
Can I just create a XML map and use the RunMapwith DataTable on the web service site?
Thanks
Regards,
Geoff James
In regards to Adriaans question you wouldn’t get ‘mapped’ data out of GP. “Mapped” implies destination.
For Geoff’s question, you ask “Can I just create a XML map and use the RunMapwith DataTable on the web service site?”
This is about the same – not sure what you mean here because if you use RunMapWithDataTable, you are _sending_ the data to the map to process.
But assuming both questions are “i want to get data OUT of the eOne web service”, you can’t do that directly with the asmx service.
But the REST service has this.
http://www.eonesolutions.com/Manuals/SmartConnect/SmartConnect%202016/?page=gp_get_data
This is, I believe, the same method that the Excel Addin uses to pull data into Excel from a map. It calls the method which then invokes the Source Data routine of the map and sends the data back to Excel.
patrick
In regards to Adrian’s question and assuming you want to pull data from GP you can be creative in doing so.
Create a map that exports to excel text or whatever and call it using RunmapwithDatatable. Add a Task to the map to call another map and use the data from the original map to push data back to your site.