diff --git a/manifest.samples.json b/manifest.samples.json index 3da3e7755..50c33977a 100644 --- a/manifest.samples.json +++ b/manifest.samples.json @@ -50,6 +50,68 @@ } } ] + }, + { + "sharedTags": { + "wcfservice":{} + }, + "platforms": [ + { + "dockerfile": "samples/wcfapp/Dockerfile.web", + "os": "windows", + "osVersion": "ltsc2016", + "tags": { + "wcfservice-windowsservercore-ltsc2016": {} + } + }, + { + "dockerfile": "samples/wcfapp/Dockerfile.web", + "os": "windows", + "osVersion": "1709", + "tags": { + "wcfservice-windowsservercore-1709": {} + } + }, + { + "dockerfile": "samples/wcfapp/Dockerfile.web", + "os": "windows", + "osVersion": "1803", + "tags": { + "wcfservice-windowsservercore-1803": {} + } + } + ] + }, + { + "sharedTags": { + "wcfclient":{} + }, + "platforms": [ + { + "dockerfile": "samples/wcfapp/Dockerfile.client", + "os": "windows", + "osVersion": "ltsc2016", + "tags": { + "wcfclient-windowsservercore-ltsc2016": {} + } + }, + { + "dockerfile": "samples/wcfapp/Dockerfile.client", + "os": "windows", + "osVersion": "1709", + "tags": { + "wcfclient-windowsservercore-1709": {} + } + }, + { + "dockerfile": "samples/wcfapp/Dockerfile.client", + "os": "windows", + "osVersion": "1803", + "tags": { + "wcfclient-windowsservercore-1803": {} + } + } + ] } ] } diff --git a/samples/README.md b/samples/README.md index eafb74595..de4873516 100644 --- a/samples/README.md +++ b/samples/README.md @@ -2,7 +2,7 @@ The samples show various ways to use .NET Framework and Docker together. You can use the samples as the basis of your own Docker images or just to play. -The samples exercise various levels of functionality. The [.NET Framework Docker sample](dotnetapp/README.md) includes the most functionality, including build, unit testing, and pushing images to a container registry. The [ASP.NET Docker sample](aspnetapp/README.md) includes instructions for testing images with [Azure Container Instances](https://azure.microsoft.com/services/container-instances/). The samples include detailed instructions for use with and without Docker. +The samples exercise various levels of functionality. The [.NET Framework Docker sample](dotnetapp/README.md) includes the most functionality, including build, unit testing, and pushing images to a container registry. The [ASP.NET Docker sample](aspnetapp/README.md) includes instructions for testing images with [Azure Container Instances](https://azure.microsoft.com/services/container-instances/). The samples include detailed instructions for use with and without Docker. The [WCF Docker sample](wcfapp/README.md) includes instructions for dockerizing WCF services, either IIS-hosted or self-hosted, and how to run client app against them. ## Try a pre-built .NET Framework Docker Image @@ -19,6 +19,7 @@ docker run --rm microsoft/dotnet-framework-samples * [.NET Framework Console Docker Sample](dotnetapp/README.md) - This [sample](dotnetapp/Dockerfile) builds, tests, and runs the sample. It includes and builds multiple projects. * [ASP.NET Web Forms Docker Sample](aspnetapp/README.md) - This [sample](aspnetapp/Dockerfile) demonstrates using Docker with an ASP.NET Web Forms app. * [ASP.NET MVC Docker Sample](aspnetmvcapp/README.md) - This [sample](aspnetmvcapp/Dockerfile) demonstrates using Docker with an ASP.NET MVC app. +* [WCF Docker Sample](wcfapp/README.md) - This [sample](wcfapp/) demonstrates using Docker with a WCF app. ## Push Images to a Container Registry @@ -36,6 +37,7 @@ Docs and More Information: * [.NET Docs](https://docs.microsoft.com/dotnet/) * [ASP.NET Docs](https://docs.microsoft.com/aspnet/) +* [WCF Docs](https://docs.microsoft.com/dotnet/framework/wcf/) * [dotnet/core](https://github.com/dotnet/core) for starting with .NET Core on GitHub. * [dotnet/announcements](https://github.com/dotnet/announcements/issues) for .NET announcements. @@ -52,4 +54,5 @@ Docs and More Information: * [microsoft/aspnet](https://hub.docker.com/r/microsoft/aspnet/) for ASP.NET Web Forms and MVC images. * [microsoft/dotnet-framework](https://hub.docker.com/r/microsoft/dotnet-framework/) for .NET Framework images. -* [microsoft/dotnet-framework-samples](https://hub.docker.com/r/microsoft/dotnet-framework-samples/) for .NET Framework and ASP.NET sample images. \ No newline at end of file +* [microsoft/dotnet-framework-samples](https://hub.docker.com/r/microsoft/dotnet-framework-samples/) for .NET Framework and ASP.NET sample images. +* [microsoft/wcf](https://hub.docker.com/r/microsoft/wcf) for WCF images. \ No newline at end of file diff --git a/samples/wcfapp/Dockerfile.client b/samples/wcfapp/Dockerfile.client new file mode 100644 index 000000000..b5c39006a --- /dev/null +++ b/samples/wcfapp/Dockerfile.client @@ -0,0 +1,9 @@ +FROM microsoft/dotnet-framework:4.7.2-sdk AS build +WORKDIR /app +COPY WcfClient/. . +RUN msbuild /p:Configuration=Release + +FROM microsoft/dotnet-framework:4.7.2-runtime AS runtime +WORKDIR /app +COPY --from=build /app/bin/Release . +ENTRYPOINT WcfClient.exe \ No newline at end of file diff --git a/samples/wcfapp/Dockerfile.console b/samples/wcfapp/Dockerfile.console new file mode 100644 index 000000000..12c19d915 --- /dev/null +++ b/samples/wcfapp/Dockerfile.console @@ -0,0 +1,11 @@ +FROM microsoft/dotnet-framework:4.7.2-sdk AS build +WORKDIR /app +COPY WcfServiceConsoleApp/. . +RUN msbuild /p:Configuration=Release + +FROM microsoft/dotnet-framework:4.7.2-runtime AS runtime +EXPOSE 80 +EXPOSE 808 +WORKDIR /app +COPY --from=build /app/bin/Release . +ENTRYPOINT WcfServiceConsoleApp.exe diff --git a/samples/wcfapp/Dockerfile.web b/samples/wcfapp/Dockerfile.web new file mode 100644 index 000000000..f28e6da01 --- /dev/null +++ b/samples/wcfapp/Dockerfile.web @@ -0,0 +1,8 @@ +FROM microsoft/dotnet-framework:4.7.2-sdk AS build +WORKDIR /app +COPY WcfServiceWebApp/. . +RUN msbuild /p:Configuration=Release + +FROM microsoft/wcf:4.7.2 AS runtime +WORKDIR /inetpub/wwwroot +COPY --from=build /app/ . \ No newline at end of file diff --git a/samples/wcfapp/README.md b/samples/wcfapp/README.md new file mode 100644 index 000000000..f7b8678f5 --- /dev/null +++ b/samples/wcfapp/README.md @@ -0,0 +1,141 @@ +# WCF Docker Sample +This sample demonstrates how to dockerize WCF services, either IIS-hosted or self-hosted. A simple "hello world" service contract is used in all samples for both HTTP and NET.TCP transport bindings. The sample can also be used without Docker. + +The sample builds the application in a container based on the larger [.NET Framework SDK Docker image](https://hub.docker.com/r/microsoft/dotnet-framework-build/). It builds the application and then copies the final build result into a Docker image based on the smaller [WCF Runtime Docker image](https://hub.docker.com/r/microsoft/wcf/) or [.NET Framework Runtime Docker image](https://hub.docker.com/r/microsoft/dotnet-framework/). It uses Docker [multi-stage build](https://github.com/dotnet/announcements/issues/18) and [multi-arch tags](https://github.com/dotnet/announcements/issues/14). + +This sample requires [Docker 17.06](https://docs.docker.com/release-notes/docker-ce) or later of the [Docker client](https://store.docker.com/editions/community/docker-ce-desktop-windows). + +## Try pre-built WCF Docker Images +You can quickly run a container with a pre-built [sample WCF Docker image](https://hub.docker.com/r/microsoft/dotnet-framework-samples/), based on the WCF Docker sample. + +Type the following [Docker](https://www.docker.com/products/docker) command to start a WCF service container: +```console +docker run --name wcfservicesample --rm -it microsoft/dotnet-framework-samples:wcfservice +``` +Find the IP address of the container instance. +```console +docker inspect --format="{{.NetworkSettings.Networks.nat.IPAddress}}" wcfservicesample +172.26.236.119 +``` +Type the following Docker command to start a WCF client container, set environment variable HOST to the IP address of the wcfservicesample container: +```console +docker run --name wcfclientsample --rm -it -e HOST=172.26.236.119 microsoft/dotnet-framework-samples:wcfclient +``` + +## Getting the sample + +The easiest way to get the sample is by cloning the samples repository with [git](https://git-scm.com/downloads), using the following instructions. + +```console +git clone https://github.com/microsoft/dotnet-framework-docker/ +``` + +You can also [download the repository as a zip](https://github.com/microsoft/dotnet-framework-docker/archive/master.zip). + +## Build and run the sample with Docker +WCF service is supported on .NET Framework, which can run in Windows Server Core based containers. For simplicity, we disabled security in these samples. + +### Build a Container with IIS-hosted WCF Service +Project `WcfServiceWebApp` is created from 'WCF Service Application' template in Visual Studio. A [Dockerfile](/Dockerfile.web) is added to the project. We use `microsoft/wcf` image as the base image, which has both HTTP and NET.TCP protocols enabled in IIS and exposes ports 80 (for HTTP) and 808 (for NET.TCP) for the container. We use WCF image with tag `4.7.2` for .NET Framework 4.7.2 in this example, but you can change it to use other tags (eg. `microsoft/wcf:4.7` with tag `4.7`) for WCF images with different versions of .NET Framework. The complete list of [WCF image tags](https://hub.docker.com/r/microsoft/wcf/tags/) can be found from Docker Hub. + +Run commands below to build the container image with name `iishostedwcfservice` and start an instance of it named `myservice1`. Docker parameter `-d` will run the container in background (detached mode). +``` +cd samples +cd wcfapp +docker build --pull -t iishostedwcfservice -f Dockerfile.web . +docker run -d --rm --name myservice1 iishostedwcfservice +``` +Find the IP address of the container instance. This will be used later for a WCF client to connect to the service. +``` +docker inspect --format="{{.NetworkSettings.Networks.nat.IPAddress}}" myservice1 +172.23.70.146 +``` +### Build a Container with Self-hosted WCF Service +Project `WcfServiceConsoleApp` is created from Windows Classic Desktop 'Console App' template in Visual Studio. We added a [Dockerfile](/Dockerfile.console) to the project. We use `microsoft/dotnet-framework` image as the base image and expose ports 80 (for HTTP) and 808 (for NET.TCP) for the container. + +Run commands below to build the container image with name `selfhostedwcfservice` and start an instance of it named `myservice2`. +``` +docker build --pull -t selfhostedwcfservice -f Dockerfile.console . +docker run -it --rm --name myservice2 selfhostedwcfservice +``` +Open another console window to find the IP address of the self-hosted WCF service (alternatively, you can run the self-hosted WCF service container in detached mode by `docker run -d --rm --name myservice2 selfhostedwcfservice`). +``` +docker inspect --format="{{.NetworkSettings.Networks.nat.IPAddress}}" myservice2 +172.23.69.75 +``` +### Build a Container to run WCF Client against the Service +Now that we have WCF services running in containers. Let's run the WCF client against them. Run commands below to build the container image with name `wcfclient`. The IP address of the WCF service is passed through the environment variable `host`. +``` +docker build --pull -t wcfclient -f Dockerfile.client . +docker run -it --rm -e HOST=172.23.70.146 --name myclient wcfclient +Client OS: Microsoft Windows NT 6.2.9200.0 +Service Host: 172.23.70.146 +Hello WCF via Http from Container! +Hello WCF via Net.Tcp from Container! +``` +The result above is from running the WCF client against the IIS-hosted WCF service. Changing the environment variable `host` to the IP address of the self-hosted WCF service, you will get a similar result. + +*To run WCF client on a different machine other than the one that hosts container instance*, we will need to map ports of a container to ports of its host by using Docker parameter `-p` when we start a constainer instance. For example, the command below started an instance of the self-hosted WCF service container named `myservice3` with its ports 80 and 808 mapped to ports 80 and 808 of its host machine respectively. +``` +C:\wcfapp\WcfServiceConsoleApp>docker run -d -p 80:80 -p 808:808 --name myservice3 selfhostedwcfservice +``` +Then for the WCF client to connect to the service, we need to set the `host` to be the IP address (or DNS name) of the container host machine (instead of the IP address of the container instance). The rest will be the same to start the WCF client. + +## Build and run the sample with Docker Compose +[Docker Compose](https://docs.docker.com/compose/overview/) is a tool for defining and running multi-container Docker applications. In this sample, we also added YML files to configure WCF server and client applications. You can directly start and run service and client applications without having to do any work to hookup the client to the WCF service. + +Type the following Docker Compose command to start both iis-hosted WCF service container and client container: +``` +docker-compose -f docker-compose-iishosted.yml up +``` +Alternatively, if you want to build and run self-hosted WCF service container, run commands below: +``` +docker-compose -f docker-compose-selfhosted.yml up +``` + +## Build the sample locally + +You can build this [.NET Framework 4.7.2](https://www.microsoft.com/net/download/dotnet-framework-runtime/net472) application locally with MSBuild using the following instructions. The instructions assume that you are in the root of the repository and using the `Developer Command Prompt for VS 2017`. + +You must have the [.NET Framework 4.7.2 targeting pack](https://go.microsoft.com/fwlink/?LinkId=863261) installed. It is easiest to install with [Visual Studio 2017](https://www.microsoft.com/net/download/Windows/build) with the Visual Studio Installer. + +```console +cd samples +cd wcfapp +msbuild wcfapp.sln /p:Configuration=Release +``` + +Note: The /p:Configuration=Release argument builds the application in release mode (the default is debug mode). See the [MSBuild Command-Line reference](https://msdn.microsoft.com/en-us/library/ms164311.aspx) for more information on commandline parameters. +You can also build, test and debug the application with [Visual Studio 2017](https://www.microsoft.com/net/download/Windows/build). + +## .NET Resources + +More Samples + +* [.NET Framework Docker Samples](../README.md) +* [.NET Core Docker Samples](https://github.com/dotnet/dotnet-docker/blob/master/samples/README.md) + +Docs and More Information: + +* [.NET Docs](https://docs.microsoft.com/dotnet/) +* [WCF Docs](https://docs.microsoft.com/dotnet/framework/wcf/) +* [ASP.NET Docs](https://docs.microsoft.com/aspnet/) +* [dotnet/core](https://github.com/dotnet/core) for starting with .NET Core on GitHub. +* [dotnet/announcements](https://github.com/dotnet/announcements/issues) for .NET announcements. + +## Related Repositories + +.NET Core Docker Hub repos: + +* [microsoft/aspnetcore](https://hub.docker.com/r/microsoft/aspnetcore/) for ASP.NET Core images. +* [microsoft/dotnet](https://hub.docker.com/r/microsoft/dotnet/) for .NET Core images. +* [microsoft/dotnet-nightly](https://hub.docker.com/r/microsoft/dotnet-nightly/) for .NET Core preview images. +* [microsoft/dotnet-samples](https://hub.docker.com/r/microsoft/dotnet-samples/) for .NET Core sample images. + +.NET Framework Docker Hub repos: + +* [microsoft/wcf](https://hub.docker.com/r/microsoft/wcf/) for WCF images. +* [microsoft/aspnet](https://hub.docker.com/r/microsoft/aspnet/) for ASP.NET Web Forms and MVC images. +* [microsoft/dotnet-framework](https://hub.docker.com/r/microsoft/dotnet-framework/) for .NET Framework images. +* [microsoft/dotnet-framework-build](https://hub.docker.com/r/microsoft/dotnet-framework-build/) for building .NET Framework applications with Docker. +* [microsoft/dotnet-framework-samples](https://hub.docker.com/r/microsoft/dotnet-framework-samples/) for .NET Framework and ASP.NET sample images. \ No newline at end of file diff --git a/samples/wcfapp/WcfClient/App.config b/samples/wcfapp/WcfClient/App.config new file mode 100644 index 000000000..ecdcf8a54 --- /dev/null +++ b/samples/wcfapp/WcfClient/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/samples/wcfapp/WcfClient/IService1.cs b/samples/wcfapp/WcfClient/IService1.cs new file mode 100644 index 000000000..fde1449b0 --- /dev/null +++ b/samples/wcfapp/WcfClient/IService1.cs @@ -0,0 +1,11 @@ +using System.ServiceModel; + +namespace WcfClient +{ + [ServiceContract] + public interface IService1 + { + [OperationContract] + string Hello(string name); + } +} \ No newline at end of file diff --git a/samples/wcfapp/WcfClient/Program.cs b/samples/wcfapp/WcfClient/Program.cs new file mode 100644 index 000000000..72f3f905f --- /dev/null +++ b/samples/wcfapp/WcfClient/Program.cs @@ -0,0 +1,41 @@ +using System; +using System.ServiceModel; + +namespace WcfClient +{ + class Program + { + static string host; + + static void Main(string[] args) + { + Console.WriteLine("Client OS: {0}", Environment.OSVersion); + host = Environment.GetEnvironmentVariable("host") ?? "localhost"; + Console.WriteLine("Service Host: {0}", host); + + CallViaHttp(); + + CallViaNetTcp(); + } + + static void CallViaHttp() + { + var address = string.Format("http://{0}/Service1.svc", host); + var binding = new BasicHttpBinding(); + var factory = new ChannelFactory(binding, address); + var channel = factory.CreateChannel(); + + Console.WriteLine(channel.Hello("WCF via Http")); + } + + static void CallViaNetTcp() + { + var address = string.Format("net.tcp://{0}/Service1.svc", host); + var binding = new NetTcpBinding(SecurityMode.None); + var factory = new ChannelFactory(binding, address); + var channel = factory.CreateChannel(); + + Console.WriteLine(channel.Hello("WCF via Net.Tcp")); + } + } +} diff --git a/samples/wcfapp/WcfClient/Properties/AssemblyInfo.cs b/samples/wcfapp/WcfClient/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..d3daad307 --- /dev/null +++ b/samples/wcfapp/WcfClient/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("WcfClient")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WcfClient")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ebd37df1-f83c-40c1-ba61-1f6d652a1f60")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/samples/wcfapp/WcfClient/WcfClient.csproj b/samples/wcfapp/WcfClient/WcfClient.csproj new file mode 100644 index 000000000..a73188814 --- /dev/null +++ b/samples/wcfapp/WcfClient/WcfClient.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + {EBD37DF1-F83C-40C1-BA61-1F6D652A1F60} + Exe + WcfClient + WcfClient + v4.7.2 + 512 + true + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/wcfapp/WcfServiceConsoleApp/App.config b/samples/wcfapp/WcfServiceConsoleApp/App.config new file mode 100644 index 000000000..c89370cb1 --- /dev/null +++ b/samples/wcfapp/WcfServiceConsoleApp/App.config @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/wcfapp/WcfServiceConsoleApp/IService1.cs b/samples/wcfapp/WcfServiceConsoleApp/IService1.cs new file mode 100644 index 000000000..e5a0171ff --- /dev/null +++ b/samples/wcfapp/WcfServiceConsoleApp/IService1.cs @@ -0,0 +1,11 @@ +using System.ServiceModel; + +namespace WcfServiceConsoleApp +{ + [ServiceContract] + public interface IService1 + { + [OperationContract] + string Hello(string name); + } +} diff --git a/samples/wcfapp/WcfServiceConsoleApp/Program.cs b/samples/wcfapp/WcfServiceConsoleApp/Program.cs new file mode 100644 index 000000000..c9e521880 --- /dev/null +++ b/samples/wcfapp/WcfServiceConsoleApp/Program.cs @@ -0,0 +1,35 @@ +using System; +using System.ServiceModel; +using System.Threading; + +namespace WcfServiceConsoleApp +{ + class Program + { + static void Main(string[] args) + { + // Create the ServiceHost + ServiceHost host = new ServiceHost(typeof(Service1)); + + try { + // Open the ServiceHost to start listening for messages + host.Open(); + + foreach (var uri in host.BaseAddresses) + { + Console.WriteLine("The service is ready at {0}", uri); + } + + // Leave the service running + Console.WriteLine("The service is running..."); + Thread.Sleep(-1); + } + catch + { + host?.Close(); + Console.WriteLine("The service is closed"); + } + + } + } +} diff --git a/samples/wcfapp/WcfServiceConsoleApp/Properties/AssemblyInfo.cs b/samples/wcfapp/WcfServiceConsoleApp/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..0bdfe122e --- /dev/null +++ b/samples/wcfapp/WcfServiceConsoleApp/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("WcfServiceConsoleApp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WcfServiceConsoleApp")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d8005be4-532e-4ea0-b269-e820ff482fb4")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/samples/wcfapp/WcfServiceConsoleApp/Service1.cs b/samples/wcfapp/WcfServiceConsoleApp/Service1.cs new file mode 100644 index 000000000..11cb5f71a --- /dev/null +++ b/samples/wcfapp/WcfServiceConsoleApp/Service1.cs @@ -0,0 +1,10 @@ +namespace WcfServiceConsoleApp +{ + public class Service1 : IService1 + { + public string Hello(string name) + { + return string.Format("Hello {0} from Container!", name); + } + } +} diff --git a/samples/wcfapp/WcfServiceConsoleApp/WcfServiceConsoleApp.csproj b/samples/wcfapp/WcfServiceConsoleApp/WcfServiceConsoleApp.csproj new file mode 100644 index 000000000..0a537bf9e --- /dev/null +++ b/samples/wcfapp/WcfServiceConsoleApp/WcfServiceConsoleApp.csproj @@ -0,0 +1,54 @@ + + + + + Debug + AnyCPU + {D8005BE4-532E-4EA0-B269-E820FF482FB4} + Exe + WcfServiceConsoleApp + WcfServiceConsoleApp + v4.7.2 + 512 + true + True + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/wcfapp/WcfServiceWebApp/IService1.cs b/samples/wcfapp/WcfServiceWebApp/IService1.cs new file mode 100644 index 000000000..9c96c2fd1 --- /dev/null +++ b/samples/wcfapp/WcfServiceWebApp/IService1.cs @@ -0,0 +1,11 @@ +using System.ServiceModel; + +namespace WcfServiceWebApp +{ + [ServiceContract] + public interface IService1 + { + [OperationContract] + string Hello(string name); + } +} diff --git a/samples/wcfapp/WcfServiceWebApp/Properties/AssemblyInfo.cs b/samples/wcfapp/WcfServiceWebApp/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..2ecb3c7d3 --- /dev/null +++ b/samples/wcfapp/WcfServiceWebApp/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("WcfServiceWebApp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WcfServiceWebApp")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("439f14a2-b5d4-45e6-a108-38a76125696e")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/samples/wcfapp/WcfServiceWebApp/Service1.svc b/samples/wcfapp/WcfServiceWebApp/Service1.svc new file mode 100644 index 000000000..e855f7e58 --- /dev/null +++ b/samples/wcfapp/WcfServiceWebApp/Service1.svc @@ -0,0 +1 @@ +<%@ ServiceHost Language="C#" Debug="true" Service="WcfServiceWebApp.Service1" CodeBehind="Service1.svc.cs" %> \ No newline at end of file diff --git a/samples/wcfapp/WcfServiceWebApp/Service1.svc.cs b/samples/wcfapp/WcfServiceWebApp/Service1.svc.cs new file mode 100644 index 000000000..0d50010e6 --- /dev/null +++ b/samples/wcfapp/WcfServiceWebApp/Service1.svc.cs @@ -0,0 +1,10 @@ +namespace WcfServiceWebApp +{ + public class Service1 : IService1 + { + public string Hello(string name) + { + return string.Format("Hello {0} from Container!", name); + } + } +} diff --git a/samples/wcfapp/WcfServiceWebApp/WcfServiceWebApp.csproj b/samples/wcfapp/WcfServiceWebApp/WcfServiceWebApp.csproj new file mode 100644 index 000000000..b56e714c1 --- /dev/null +++ b/samples/wcfapp/WcfServiceWebApp/WcfServiceWebApp.csproj @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + + + 2.0 + {439F14A2-B5D4-45E6-A108-38A76125696E} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + WcfServiceWebApp + WcfServiceWebApp + v4.7.2 + True + true + true + + + + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + Service1.svc + + + + + + + + + Web.config + + + Web.config + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + False + True + 52617 + / + http://localhost:52617/ + False + False + + + False + + + + + + \ No newline at end of file diff --git a/samples/wcfapp/WcfServiceWebApp/Web.Debug.config b/samples/wcfapp/WcfServiceWebApp/Web.Debug.config new file mode 100644 index 000000000..fae9cfefa --- /dev/null +++ b/samples/wcfapp/WcfServiceWebApp/Web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/samples/wcfapp/WcfServiceWebApp/Web.Release.config b/samples/wcfapp/WcfServiceWebApp/Web.Release.config new file mode 100644 index 000000000..da6e960b8 --- /dev/null +++ b/samples/wcfapp/WcfServiceWebApp/Web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/samples/wcfapp/WcfServiceWebApp/Web.config b/samples/wcfapp/WcfServiceWebApp/Web.config new file mode 100644 index 000000000..95bbe457e --- /dev/null +++ b/samples/wcfapp/WcfServiceWebApp/Web.config @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/wcfapp/docker-compose-iishosted.yml b/samples/wcfapp/docker-compose-iishosted.yml new file mode 100644 index 000000000..4106779ae --- /dev/null +++ b/samples/wcfapp/docker-compose-iishosted.yml @@ -0,0 +1,14 @@ +version: '3' +services: + wcfservicewebapp: + build: + context: . + dockerfile: Dockerfile.web + wcfclient: + build: + context: . + dockerfile: Dockerfile.client + depends_on: + - wcfservicewebapp + environment: + Host: wcfservicewebapp diff --git a/samples/wcfapp/docker-compose-selfhosted.yml b/samples/wcfapp/docker-compose-selfhosted.yml new file mode 100644 index 000000000..8305df0b0 --- /dev/null +++ b/samples/wcfapp/docker-compose-selfhosted.yml @@ -0,0 +1,14 @@ +version: '3' +services: + wcfserviceconsoleapp: + build: + context: . + dockerfile: Dockerfile.console + wcfclient: + build: + context: . + dockerfile: Dockerfile.client + depends_on: + - wcfserviceconsoleapp + environment: + Host: wcfserviceconsoleapp diff --git a/samples/wcfapp/wcfapp.sln b/samples/wcfapp/wcfapp.sln new file mode 100644 index 000000000..47032962f --- /dev/null +++ b/samples/wcfapp/wcfapp.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27019.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WcfServiceWebApp", "WcfServiceWebApp\WcfServiceWebApp.csproj", "{439F14A2-B5D4-45E6-A108-38A76125696E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WcfServiceConsoleApp", "WcfServiceConsoleApp\WcfServiceConsoleApp.csproj", "{D8005BE4-532E-4EA0-B269-E820FF482FB4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WcfClient", "WcfClient\WcfClient.csproj", "{EBD37DF1-F83C-40C1-BA61-1F6D652A1F60}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {439F14A2-B5D4-45E6-A108-38A76125696E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {439F14A2-B5D4-45E6-A108-38A76125696E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {439F14A2-B5D4-45E6-A108-38A76125696E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {439F14A2-B5D4-45E6-A108-38A76125696E}.Release|Any CPU.Build.0 = Release|Any CPU + {D8005BE4-532E-4EA0-B269-E820FF482FB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D8005BE4-532E-4EA0-B269-E820FF482FB4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D8005BE4-532E-4EA0-B269-E820FF482FB4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D8005BE4-532E-4EA0-B269-E820FF482FB4}.Release|Any CPU.Build.0 = Release|Any CPU + {EBD37DF1-F83C-40C1-BA61-1F6D652A1F60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EBD37DF1-F83C-40C1-BA61-1F6D652A1F60}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EBD37DF1-F83C-40C1-BA61-1F6D652A1F60}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EBD37DF1-F83C-40C1-BA61-1F6D652A1F60}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B9747BB6-3F43-4ED4-A463-49165911FB3C} + EndGlobalSection +EndGlobal