HTTP Connector .NET Receiver Service Sample

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:

https://devicemagic.zendesk.com/hc/en-us/articles/202100393-HTTP-Connector

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.

Have more questions? Submit a request

Comments

  • Avatar
    dusanb

    For VB.NET users, this attachment is a translation of the C# ReceiverService class. It is untested and unsupported, but hopefully it will help non-C# developers. If you would like a fully-fledged VB.NET sample including solution files and service installer, please comment here.

  • Avatar
    joshua

    I am trying to install the service, but it wont let me install it. Is there a special way i need to do it? 

     

  • Avatar
    joshua

    I just got it working, but how can I test it? I would like to test the service before i put it on my server. Can i send a test from restfull client or something? 

    Thanks in advanced 

     

  • Avatar
    Drew

    Hi, where's the VB.Net attachment mentioned above?

  • Avatar
    scanman

    The attachment only contained a C# project, not a VB.net project.

  • Avatar
    dusanb

    Sorry scanman and Drew - it looks like when we migrated our helpdesk it ate the attachment - we're trying to locate it.

Powered by Zendesk