Configure callback api .NET

39 views
Skip to first unread message

Jarno Verreyt

unread,
Dec 6, 2012, 7:50:11 AM12/6/12
to rogerthat...@googlegroups.com
Hi,

How can i start from scratch to configure the callback api (CallbackHandler) with .NET? 
I tried a lot of things with HTTP(s) and also with XMPP but it doesn't work..
I downloaded the files from git and tried it with them, but also no results.

Geert Audenaert (Rogerthat staff)

unread,
Dec 6, 2012, 4:53:19 PM12/6/12
to rogerthat...@googlegroups.com
Hi Jarno,

  1. Create a new ASP.NET project in Visual Studio
  2. Add a reference to the Rogerthat integration library for .NET
    You can download it at the following location:
    https://github.com/fastgeert/Rogerth.at-Messenger-dotnet-api-bindings/downloads
  3. Create a new class that inherits from Com.Mobicage.Rogerthat.CallbackApiHttpHandler
    The following class shows a nice example how you can implement the Rogerthat callbacks in your subclass of the CallbackApiHttpHandler https://github.com/fastgeert/Rogerth.at-Messenger-dotnet-api-bindings/blob/master/Com.Mobicage.Rogerthat/Com.Mobicage.Rogerthat.TestWeb/CallbackHandler.cs
  4. Configure in web.config on which URL you want to listen for callbacks originating from the Rogerthat cloud
    The following piece of configuration configures that requests received on /callback are being handeld by the class specified in the type attribute.
    <httpHandlers>
      <add verb="*" path="/callback" type="Com.Mobicage.Rogerthat.TestWeb.CallbackHandler,Com.Mobicage.Rogerthat.TestWeb" />
    </httpHandlers>
    The complete web.config can be found on the following url.
    https://github.com/fastgeert/Rogerth.at-Messenger-dotnet-api-bindings/blob/master/Com.Mobicage.Rogerthat/Com.Mobicage.Rogerthat.TestWeb/web.config
  5. The following step is to reflect the configuration in your Rogerthat service configuration panel.
    The easiest is via HTTP.
    In the Configuration panel navigate to the Service callback configuration section, select the HTTP method and fill the URL to the server and callback listener of your ASP.NET web application.
    eg: https://myserver.be/mywebproject/myhttpcallbackhandler
    Save the configuration and test if the configuration works via the [Test configuration] button.
    If you followed the steps before, you should be ale to get it working.
At this point you have a working setup, but it requires you to host the ASP.NET project on a location which is reachable via the public internet, which is not an optimal solution, because it prevents you to test your work from your development IDE (Visual Studio). So Ideally you should be able to host the callback handler locally and still be reachable from the Rogerthat cloud.
This is possible via the HTTP over XMPP bridge that we offer as a development tool. We use XMPP (jabber) to deliver the callbacks to an application you download from out website (http://www.rogerthat.net/wp-content/uploads/tools/RogerthatDevConnector/setup.exe). This application will then invoke the callbacks locally to your development server.
Perform the following steps to get going:
  1. Create a new XMPP account on jabber.org
  2. Configure the XMPP account in the RogerthatDevConnector you just installed. See http://www.rogerthat.net/developers/rogerthat-service-development-tools/ for more information.
  3. Configure the location where the devconnector must forward the callback to. 
    eg 
     http://127.0.0.1/mywebproject/myhttpcallbackhandler
  4. Configure the XMPP account in your Rogerthat service panels
  5. Start the devconnector and perform the [Test configuration] to validate your setup.
Happy coding!

Regards, Geert

Jasper Van Kerschaver

unread,
Dec 6, 2012, 6:41:17 PM12/6/12
to rogerthat...@googlegroups.com
Hi Geert,

I'm wondering, does this setup and configuration also works within a ASP.NET Web site project?
I've been trying to get the callbackhandler to work online with the settings you instructed, but a Web site project does not work with assembly or namespaces.
So, the <httpHandler> in the web.config won't be able to recognize the class that should handle the callbacks.

In my case I have the Callbackhandler.cs in the App_Data folder. The <httpHandler> in the web.config is defined as followed: <add verb="*" path="/callback" type="CallbackHandler"/>
But I get a 404 respond when trying to test the service (http://myserver.be/callback)

Best regards
Jasper

Geert Audenaert (Rogerthat staff)

unread,
Dec 9, 2012, 10:47:08 AM12/9/12
to rogerthat...@googlegroups.com
Hi Jasper,
 
I ain't a Visual Studio expert, and to be able to reply to your question I installed Visual Studio 2012.
 
I must confirm that using a ASP.NET website project does not work. I got stuck with something called managed pipeline mode, that conflicts with the use of httpHandlers.
 
I suggest that you create a normal ASP.NET webform project. If you would get it working with an ASP.NET Website project, please let us know which steps you took to achief this.
 
Regards, Geert
 
 
Reply all
Reply to author
Forward
0 new messages