1

Doing a very small test, Source Code

I have a database (SQLAzure) and I use EF5.

In my project I create :

  • A "Cloud" project with a "WCF WebRole"
  • A test project to test my DB on the local computer
  • A test project to test my WCF service deployed

My Service has 2 methods :

  • The first named Hello just return the string "hello"
  • The second return an int, this int is the number of record of a table

I test in local, the WCF Service, no problem for both methods.

On Azure :

  • I creates a SQLAzure database, I set the tables and data and I can join the database from "SQL Management studio 2012"
  • A web site named "Pointage"

From VS2012 :

  • I published ("Publish to Azure") the WebRole project (named in the project "PointageOnAzureWcfWebRole"), I can see the service : enter link description here
  • When I test (using AzureOnline.Test), the method Hello(), return the right value and no error but when I try NumberOfUser(), I get this error :

System.ServiceModel.FaultException : The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.

The connectionsgtring is correct, I use the same than the one in "SQL Management Studio", the name is the same than the web.config

I really don't understand what's happen. Something wrong in the Azure configuration ("Windows Azure manager") ? The dashboard look like this :

enter image description here

Update1 :

<configuration>

    <system.serviceModel>

      <bindings>
        <basicHttpBinding>
          <binding name="BasicHttpBinding_IService1"
                   hostNameComparisonMode="StrongWildcard"
                   receiveTimeout="00:10:00"
                   sendTimeout="00:10:00"
                   openTimeout="00:10:00"
                   closeTimeout="00:10:00"
                   maxReceivedMessageSize="65536"
                   maxBufferSize="65536"
                   maxBufferPoolSize="524288"
                   transferMode="Buffered"
                   messageEncoding="Text"
                   textEncoding="utf-8"
                   bypassProxyOnLocal="false"
                   useDefaultWebProxy="true" >
            <security mode="None" />
          </binding>
        </basicHttpBinding>
      </bindings>

      <client>
        <endpoint address="http://pointage.azurewebsites.net/Service1.svc"
                  binding="basicHttpBinding" 
                  bindingConfiguration="BasicHttpBinding_IService1"
                  contract="PointageOnAzureOnlineService.IService1" 
                  name="BasicHttpBinding_IService1" />
      </client>
    </system.serviceModel>

</configuration>

Update2 :

The connection string is set when I publish the service

enter image description here

TheBoubou
  • 19,487
  • 54
  • 148
  • 236
  • Have you configured your Azure SQL Database Firewall settings? – JuneT Jan 06 '13 at 10:20
  • @JuneT if you talk about "Allowed Services", "Windows Azure Services" is set to yes. – TheBoubou Jan 06 '13 at 10:27
  • I would you follow the instructions in the error message. You are receiving a generic error message; I would want to find out what the actual error message is to troubleshoot further. Try using IncludeExceptionDetailInFaults as specified. – Herve Roggero Jan 06 '13 at 15:33
  • @HerveRoggero you are right, I tried but You don't find where set IncludeExceptionDetailInFaults in the client configuration :( See my update – TheBoubou Jan 06 '13 at 17:00
  • 1
    You can add a ServiceBehavior node. Look at this thread for how to turn it on. http://stackoverflow.com/questions/8315633/turn-on-includeexceptiondetailinfaults-either-from-servicebehaviorattribute-or – Herve Roggero Jan 06 '13 at 22:46
  • I wonder if your web.config is pointing to the right server. Your connectionstrings section has the entity model point to LocalHost, but you are trying to connect to SQL Database, are you not? – Herve Roggero Jan 06 '13 at 22:51
  • @HerveRoggero see update2. Followed your link, when I place the code , I have an error (invalid child). I tried to place in several node but still the error. – TheBoubou Jan 07 '13 at 04:55
  • If you are not comfortable editing the service configuration file directly, try using the Configuration editor; there is a shortcut from Visual Studio. http://msdn.microsoft.com/en-us/library/ms732009.aspx – Herve Roggero Jan 07 '13 at 17:53
  • Don't you need one of those EDMX connection strings? – Richard Astbury Jan 08 '13 at 17:51

0 Answers0