다음을 통해 공유


Azure Training Kit - WCF Problems

After having recently downloaded the Azure Training Kit I launched straight into trying to build some of the demos to get my head around how Azure works, especially the use of the storage areas (Blobs, Tables and Queues) that developers can access to store various data within there cloud application.

Whilst doing this the first demo tell us to create a WCF web service which can then be consumed by a windows console app and later a WorkerRole. However, after following all the steps in the demo my Console app and WorkerRole kept throwing up errors when I tried to consume the service. Browsing to the URL of the service then gave me the following error:

Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [].

After, hours of searching and help from a fellow tweeter and Azure enthusiast (@DavidBurela) I have managed to get around this problem.

First thing to do is to remove the following section of code from the web.config file of the WebRole:

    1: <serviceHostingEnvironment>
    2:     <baseAddressPrefixFilters>
    3:         <add prefix="https://localhost"/>
    4:     </baseAddressPrefixFilters>
    5: </serviceHostingEnvironment>

Then make sure that the service input endpoint within in the ServiceDefinition and the client.endpoint both are connection via the same port:

app.config

    1: <client>
    2:     <endpoint address="https://localhost:83/MessageLogger.svc" 
    3:               binding="basicHttpBinding"
    4:               bindingConfiguration="BasicHttpBinding_IMessageLogger"
    5:               contract="RDService.IMessageLogger"
    6:               name="BasicHttpBinding_IMessageLogger" />
    7: </client>

ServiceDefinition.csdef

    1: <InputEndpoints>
    2:   <InputEndpoint name="HttpIn" protocol="http" port="83" />
    3: </InputEndpoints>

This should make sure that the WCF service functions correctly.

 

azuretest

 

Technorati Tags: azure,windows Azure,Cloud Computing

Comments