Changeset 6794
- Timestamp:
- 09/17/11 18:31:34 (13 years ago)
- Location:
- branches/GeneralizedQAP/HeuristicLab.Services.Hello/3.3
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/HeuristicLab.Services.Hello/3.3/HelloService.svc.cs
r6780 r6794 20 20 #endregion 21 21 22 23 using System; 22 24 namespace HeuristicLab.Services.Hello { 23 25 public class HelloService : IHelloService { … … 25 27 return "Hello"; 26 28 } 29 30 public string Say(string phrase) { 31 using (HelloEntities context = new HelloEntities()) { 32 Saying s = context.Sayings.CreateObject(); 33 s.message = phrase.Length > 256 ? phrase.Substring(0, 256) : phrase; 34 s.date = DateTime.Now; 35 context.Sayings.AddObject(s); 36 context.SaveChanges(); 37 } 38 return phrase; 39 } 27 40 } 28 41 } -
branches/GeneralizedQAP/HeuristicLab.Services.Hello/3.3/HeuristicLab.Services.Hello-3.3.csproj
r6780 r6794 31 31 <ErrorReport>prompt</ErrorReport> 32 32 <WarningLevel>4</WarningLevel> 33 <PublishDatabaseSettings> 34 <Objects> 35 <ObjectGroup Name="HelloEntities-Deployment" Order="1" Enabled="True"> 36 <Destination Path="Data Source=SERVICES%3bInitial Catalog=HelloDatabase%3bIntegrated Security=True" /> 37 <Object Type="dbFullSql" Enabled="False"> 38 <PreSource Path="Data Source=LOCALHOST\SQLEXPRESS%3bInitial Catalog=HelloDatabase%3bIntegrated Security=True" ScriptSchema="True" ScriptData="False" CopyAllFullTextCatalogs="False" /> 39 <Source Path="obj\Release\AutoScripts\HelloEntities-Deployment_SchemaOnly.sql" Transacted="True" /> 40 </Object> 41 <Object Type="dbFullSql" xmlns="" Enabled="False"> 42 <Source Path="SQLScripts\CreateDatabase.sql" Transacted="False" /> 43 </Object> 44 </ObjectGroup> 45 </Objects> 46 </PublishDatabaseSettings> 33 47 </PropertyGroup> 34 48 <ItemGroup> 35 49 <Reference Include="Microsoft.CSharp" /> 50 <Reference Include="System.Data.Entity" /> 51 <Reference Include="System.Security" /> 36 52 <Reference Include="System.Web.DynamicData" /> 37 53 <Reference Include="System.Web.Entity" /> … … 54 70 <ItemGroup> 55 71 <Content Include="HelloService.svc" /> 72 <Content Include="SQLScripts\CreateDatabase.sql" /> 56 73 <Content Include="Web.config" /> 57 74 <Content Include="Web.Debug.config"> … … 63 80 </ItemGroup> 64 81 <ItemGroup> 82 <Compile Include="HelloModel.Designer.cs"> 83 <AutoGen>True</AutoGen> 84 <DesignTime>True</DesignTime> 85 <DependentUpon>HelloModel.edmx</DependentUpon> 86 </Compile> 65 87 <Compile Include="HelloService.svc.cs"> 66 88 <DependentUpon>HelloService.svc</DependentUpon> … … 71 93 <ItemGroup> 72 94 <Folder Include="App_Data\" /> 95 </ItemGroup> 96 <ItemGroup> 97 <EntityDeploy Include="HelloModel.edmx"> 98 <Generator>EntityModelCodeGenerator</Generator> 99 <LastGenOutput>HelloModel.Designer.cs</LastGenOutput> 100 </EntityDeploy> 73 101 </ItemGroup> 74 102 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -
branches/GeneralizedQAP/HeuristicLab.Services.Hello/3.3/IHelloService.cs
r6780 r6794 21 21 22 22 using System.ServiceModel; 23 using System.ServiceModel.Web; 23 24 24 25 namespace HeuristicLab.Services.Hello { … … 26 27 public interface IHelloService { 27 28 [OperationContract] 29 [WebGet(UriTemplate = "SayHello")] 28 30 string SayHello(); 31 32 [OperationContract] 33 [WebGet(UriTemplate = "Say/{phrase}")] 34 string Say(string phrase); 29 35 } 30 36 } -
branches/GeneralizedQAP/HeuristicLab.Services.Hello/3.3/Web.Release.config
r6780 r6794 8 8 <compilation xdt:Transform="RemoveAttributes(debug)" /> 9 9 </system.web> 10 <connectionStrings> 11 <add xdt:Transform="Replace" name="HelloEntities" connectionString="metadata=res://*/HelloModel.csdl|res://*/HelloModel.ssdl|res://*/HelloModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=SERVICES;Initial Catalog=HelloDatabase;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" /> 12 </connectionStrings> 10 13 11 14 </configuration> -
branches/GeneralizedQAP/HeuristicLab.Services.Hello/3.3/Web.config
r6780 r6794 3 3 4 4 <system.web> 5 <compilation debug="true" targetFramework="4.0" /> 5 <compilation debug="true" targetFramework="4.0"> 6 <assemblies> 7 <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 8 </assemblies> 9 </compilation> 6 10 </system.web> 11 7 12 <system.serviceModel> 13 <bindings> 14 <webHttpBinding> <!-- separate bindings are necessary --> 15 <binding name="jsonBinding" /> 16 <binding name="xmlBinding" /> 17 </webHttpBinding> 18 </bindings> 19 8 20 <behaviors> 9 21 <serviceBehaviors> 10 22 <behavior> 11 <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 12 <serviceMetadata httpGetEnabled="true"/> 13 <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 14 <serviceDebug includeExceptionDetailInFaults="false"/> 23 <serviceMetadata httpGetEnabled="true" /> 24 <serviceDebug includeExceptionDetailInFaults="true" /> 15 25 </behavior> 16 26 </serviceBehaviors> 27 28 <endpointBehaviors> 29 <behavior name="xmlEndpoint"> 30 <webHttp helpEnabled="true" defaultOutgoingResponseFormat="Xml" /> 31 </behavior> 32 <behavior name="jsonEndpoint"> <!-- do not specify enableWebScript or UriTemplate will not work --> 33 <webHttp helpEnabled="true" defaultOutgoingResponseFormat="Json" /> 34 </behavior> 35 </endpointBehaviors> 17 36 </behaviors> 37 38 <services> 39 <service name="HeuristicLab.Services.Hello.HelloService"> <!-- name needs to match the service entry in the .svc markup file --> 40 <!-- URL: HelloService.svc --> 41 <!-- URL: HelloService.svc?wsdl --> 42 <endpoint name="soap" address="" binding="basicHttpBinding" contract="HeuristicLab.Services.Hello.IHelloService" /> 43 <endpoint name="mex" address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 44 <!-- URL: HelloService.svc/json/... --> 45 <!-- URL: HelloService.svc/json/help --> 46 <endpoint name="restJson" address="json" binding="webHttpBinding" bindingConfiguration="jsonBinding" contract="HeuristicLab.Services.Hello.IHelloService" behaviorConfiguration="jsonEndpoint" /> 47 <!-- URL: HelloService.svc/xml/... --> 48 <!-- URL: HelloService.svc/xml/help --> 49 <endpoint name="restXml" address="xml" binding="webHttpBinding" bindingConfiguration="xmlBinding" contract="HeuristicLab.Services.Hello.IHelloService" behaviorConfiguration="xmlEndpoint" /> 50 </service> 51 </services> 52 18 53 <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 19 54 </system.serviceModel> 20 <system.webServer> 21 <modules runAllManagedModulesForAllRequests="true"/> 55 56 <system.webServer> 57 <modules runAllManagedModulesForAllRequests="true" /> 22 58 </system.webServer> 23 59 60 <connectionStrings> 61 <add name="HelloEntities" connectionString="metadata=res://*/HelloModel.csdl|res://*/HelloModel.ssdl|res://*/HelloModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=LOCALHOST\SQLEXPRESS;Initial Catalog=HelloDatabase;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" /> 62 </connectionStrings> 24 63 </configuration>
Note: See TracChangeset
for help on using the changeset viewer.