Advice and answers from the Device Magic Team

For maximum flexibility, use our HTTP Connector to send raw submitted XML data to an endpoint you define. This works just like a webhook you can find on many products from online vendors. You can find some developer documentation on the connector here:

We've provided a code sample here to illustrate how to process this data in a .NET Windows Service, as well as provide some boilerplate code to get you started. The ZIP file contains a Visual Studio 2010 Solution file.

As with any code sample, realize this is not production-quality and is for instructional purposes only.

Configuring the sample

Line 13 defines the port number the service will listen on. Be sure that any firewalls are allowing incoming traffic to this port. Then, add a remote connection to your form and define the destination as your hostname/IP address where you are running the service (be sure to include http(s) too), plus the port number you specified in code. Of course, you can run this on port 80 and then omit the port in the connector configuration.

Dealing with images

Remember that binary data such as an image needs to be Base64 encoded to be included in an XML document. You'll need to convert back to the original bytes on your side.

Want to see your language here?

Let us know if you'd like a similar sample in other languages, or any other feedback you have on the article, sample or HTTP Connector itself. We also have a PHP sample.

Did this answer your question?