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

4

0 回答 0