domgreen

The Geek Will Inherit the Earth

  • WCF Hot Fix – Don’t be showing your nodes

    • 26 Jan 2010
    • 0 Responses
    •  views
    • WCF Windows Azure
    • Edit
    • Delete
    • Tags
    • Autopost

    When browsing to a WCF endpoint hosted in an Azure web role you normally get back a web page for the service showing the location of the individual node / web role that is serving up your request (seen blurred out here) instead of the actual endpoint.

    This isn't great as you don't want everyone knowing about your internal system and especially the URL of one of your web roles, with which they could do who know what.

    Media_httpdomgreencom_kopwp

     

    This can easily be fixed with this patch for WCF that will now show the expected endpoint. This endpoint is actually the address of the load balancer that will then forward your request to an web role.

    Once the patch is download and installed you can then simply add the following xml snippet into your behaviour for the WCF service:

    Media_httpdomgreencom_adbrh

    With this snippet added into your web.config you can browse back to the previous service and will now see that the correct URL is displayed for your service.

    Media_httpdomgreencom_thliz

    • Tweet
  • Service management API – REST on REST

    • 12 Jan 2010
    • 0 Responses
    •  views
    • Azure REST WCF WCF REST Windows Azure service management API
    • Edit
    • Delete
    • Tags
    • Autopost

    In a previous post I mentioned using the Service Management API sample library to call out to the Azure fabric from within a C# application.

    The natural progression from here was to get the code working from within a web or worker role instance hosted within the cloud. Using a web role, I used the OnStart method to set up a IServiceManagent class that could then be shared with the remainder of the classes within the role.

    When tracing the hosted services from either the OnStart method or from within default.aspx.cs I could successfully print out all of the services within my account. However, when I set up a WCF REST service to return these hosted services in an array I started to get an error with the connection to the Management API. Giving a argument error stating that a property with the name “httpRequest” is not present. This was even happening when I was using exactly the same code as I was elsewhere.

    Media_httpdomgreencom_yxjeg

    After a push in the right direction from Simon Davies we found out  that the issue was in the WCF REST service already having an OperationContext from the original REST call before calling out to the Service Management API. This handy blog post, help solve all my issues, all that was needed was to create a second OperationalContext before calling the management service.

    Ta dar … everything now works, we can use the above code snippet to retrieve back all our hosted services by calling our own web role.

    • Tweet
  • About

    By day a virtual warrior, hunched over a keyboard cranking out line after line of code at Huddle, living the East London tech dream at Silicon Roundabout. We are an Enterprise collaboration tool that will revolutionise how your company collaborates, shares and operates, we are taking the fight to Microsoft SharePoint, we are David and we're taking on Goliath.

    However, by night this pasty geek escapes his keyboard and monitor with the attempt to get fit. I train at one of the greatest gyms in London, Thames CrossFit. CrossFit is not like other gyms its a lifestyle, and as the guys at Thames say you must be prepared to work hard.

    I also run with the great Run Dem Crew a Shoreditch based running family who run the mean streets of London by night. RDC is a mecca for runners, and creatives alike.

    With all this training its bound to get hard, its bound to be tough but its certainly worth it when you achieve something great and make friends along the way.

    So remember, "Pain is temporary but victory is forever".

    77063 Views
  • Archive

    • 2011 (13)
      • June (2)
      • May (5)
      • April (6)
    • 2010 (3)
      • April (1)
      • January (2)

    Get Updates

    Subscribe via RSS
    TwitterBuzz