mthama
Posts: 15
Joined: Mon Feb 10, 2014 1:49 pm

Can AI communicate via remote http services?

We're building an installer that needs to validate complex strings within Edit fields. These strings are related with the user's document (in USA, it is the tax profile ID, that here in Brazil is a 11 digit number that follows some rules), postal code (from Brazil), email address, and so on. To facilitate these validations, we're trying to communicate with a remote webservice through HTTP get/post that we've implemented. We'd like to know if this scenario is possible to be implemented, and if yes, how we can send the validation request and how we can receive the validation result.
Thank you all in advance.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Can AI communicate via remote http services?

Hello,

In order to achieve that you can go in the Custom Actions page and add the predefined Send install information to your web server custom action.
You can use this UI custom action when you want to collect installation data and send it to your web server for processing. Install information can only be collected through Windows Installer properties (their values). For details please see: Collect installation data and send it to a web server.

If there is anything else I can help with, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mthama
Posts: 15
Joined: Mon Feb 10, 2014 1:49 pm

Re: Can AI communicate via remote http services?

Hi Dan, Thank you for the explanations.
I just have got how to send data to our web-service. But I've not found yet how can I obtain the result. Does it returns as a property value, as a callback? If yes, where this result is stored? Does I need to create it?
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Can AI communicate via remote http services?

Hello,

The HTTP server request response, if any, can be accessed through the Advanced Installer; property: HttpPostServerResponse. You can use the value of this property to organize the logic of your installation package. Please take a look on the Collect installation data and send it to a web server article with related information for hints and guidance.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
valiot
Posts: 80
Joined: Tue Dec 04, 2012 1:41 am

Re: Can AI communicate via remote http services?

In the help doc linked you specify:
The HTTP headers specify the following "Content-Type":
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Is it possible to modify the headers sent?
I'd like to work with JASON.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Can AI communicate via remote http services?

Hello,

Advanced Installer Collect install information tool is not designed as a web API and it does not have native JSON serialization support. It can only POST requests to the web application with a custom PAYLOAD.
You can, however, encode anything you want in the request payload, even a serialized JSON if you so desire.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”