Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Apress
committed
Oct 11, 2016
0 parents
commit 1aa0b8e
Showing
1,952 changed files
with
86,399 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Freeware License, some rights reserved | ||
|
||
Copyright (c) 2007 Amit Bahree, Dennis Mulder, Shawn Cicoria, Chris Peiris, and Nishith Pathak | ||
|
||
Permission is hereby granted, free of charge, to anyone obtaining a copy | ||
of this software and associated documentation files (the "Software"), | ||
to work with the Software within the limits of freeware distribution and fair use. | ||
This includes the rights to use, copy, and modify the Software for personal use. | ||
Users are also allowed and encouraged to submit corrections and modifications | ||
to the Software for the benefit of other users. | ||
|
||
It is not allowed to reuse, modify, or redistribute the Software for | ||
commercial use in any way, or for a user�s educational materials such as books | ||
or blog articles without prior permission from the copyright holder. | ||
|
||
The above copyright notice and this permission notice need to be included | ||
in all copies or substantial portions of the software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS OR APRESS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<system.diagnostics> | ||
<trace autoflush="false" /> | ||
</system.diagnostics> | ||
<system.serviceModel> | ||
<diagnostics wmiProviderEnabled="false" performanceCounters="Off"> | ||
<messageLogging logMalformedMessages="false" logMessagesAtTransportLevel="false" /> | ||
</diagnostics> | ||
<services> | ||
<service behaviorConfiguration="tradeServiceBehavior" name="QuickReturns.StockTrading.ExchangeService.TradeService"> | ||
<endpoint address="Exchange" binding="basicHttpBinding" bindingConfiguration="" | ||
name="basicHttpBinding" contract="QuickReturns.StockTrading.ExchangeService.Contracts.ITradeService" /> | ||
<endpoint address="mex" binding="mexHttpBinding" name="mexHttpBinding" | ||
contract="IMetadataExchange" /> | ||
<host> | ||
<baseAddresses> | ||
<add baseAddress="http://localhost:8080/QuickReturns" /> | ||
</baseAddresses> | ||
</host> | ||
</service> | ||
</services> | ||
<behaviors> | ||
<serviceBehaviors> | ||
<behavior name="tradeServiceBehavior"> | ||
<serviceMetadata httpGetEnabled="true"/> | ||
<serviceDebug httpHelpPageEnabled="true" | ||
includeExceptionDetailInFaults="true"/> | ||
</behavior> | ||
</serviceBehaviors> | ||
</behaviors> | ||
</system.serviceModel> | ||
</configuration> |
Large diffs are not rendered by default.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
PRO WCF Final Code/Chapter 03/ConsoleHost/App_tracelog.e2e
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using System; | ||
using System.ServiceModel; | ||
using QuickReturns.StockTrading.ExchangeService; | ||
using QuickReturns.StockTrading.ExchangeService.Contracts; | ||
|
||
namespace QuickReturns.StockTrading.ExchangeService.Hosts | ||
{ | ||
public class ConsoleHost | ||
{ | ||
/// <summary> | ||
/// This ConsoleHost uses all three methods used for hosting: | ||
/// 1) Imperative code | ||
/// 2) Configuration | ||
/// 3) A Custom Service Host | ||
/// Uncomment each section to test out. | ||
/// Both "Host with config" and "CustomServiceHost" require the configuration in app.config | ||
/// to be uncommented. For the Host with imperative code you have to comment out the | ||
/// configuration! | ||
/// </summary> | ||
/// <param name="args"/> | ||
static void Main(string[] args) | ||
{ | ||
#region Host with imperative code | ||
//Uri baseAddress = new Uri | ||
// ("http://localhost:8080/QuickReturns"); | ||
//Type serviceType = typeof(TradeService); | ||
//BasicHttpBinding binding = new BasicHttpBinding(); | ||
//ServiceHost host = new ServiceHost(serviceType, baseAddress); | ||
//host.Description.Endpoints.Clear();//This line is added for convenience (and allows you to leave the app.config as-is. | ||
//host.AddServiceEndpoint(typeof(ITradeService), binding, "Exchange"); | ||
#endregion | ||
|
||
#region Host with config | ||
// Note make sure that config is not commented out | ||
Type serviceType = typeof(TradeService); | ||
ServiceHost host = new ServiceHost(serviceType); | ||
#endregion | ||
|
||
#region CustomServiceHost | ||
//Uri baseAddress = | ||
// new Uri("http://localhost:8080/QuickReturns"); | ||
//CustomServiceHost host = | ||
// new CustomServiceHost(typeof(TradeService), baseAddress); | ||
#endregion | ||
|
||
// Open the defined host | ||
host.Open(); | ||
Console.WriteLine("Service started: Press Return to exit"); | ||
Console.ReadLine(); | ||
|
||
} | ||
} | ||
|
||
public class CustomServiceHost : ServiceHost | ||
{ | ||
public CustomServiceHost(Type serviceType, params Uri[] baseAddresses) | ||
: base(serviceType, baseAddresses) | ||
{ | ||
} | ||
|
||
protected override void ApplyConfiguration() | ||
{ | ||
base.ApplyConfiguration(); | ||
BasicHttpBinding binding = new BasicHttpBinding(); | ||
AddServiceEndpoint(typeof(ITradeService), binding, "Exchange"); | ||
} | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
PRO WCF Final Code/Chapter 03/ConsoleHost/ConsoleHost.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>8.0.50727</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{62049C0F-CDF0-4332-BB80-EC78CD55232A}</ProjectGuid> | ||
<OutputType>Exe</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>QuickReturns.StockTrading.ExchangeServiceHost</RootNamespace> | ||
<AssemblyName>QuickReturns.StockTrading.ExchangeServiceHost</AssemblyName> | ||
<SccProjectName> | ||
</SccProjectName> | ||
<SccLocalPath> | ||
</SccLocalPath> | ||
<SccAuxPath> | ||
</SccAuxPath> | ||
<SccProvider> | ||
</SccProvider> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Runtime.Serialization" /> | ||
<Reference Include="System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="ConsoleHost.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="App.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\ExchangeService\ExchangeService.csproj"> | ||
<Project>{89B39ED1-3CD4-4F5D-B7BA-A4527CD22B54}</Project> | ||
<Name>ExchangeService</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
5 changes: 5 additions & 0 deletions
5
PRO WCF Final Code/Chapter 03/ConsoleHost/ConsoleHost.csproj.user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<ProjectView>ProjectFiles</ProjectView> | ||
</PropertyGroup> | ||
</Project> |
10 changes: 10 additions & 0 deletions
10
PRO WCF Final Code/Chapter 03/ConsoleHost/ConsoleHost.csproj.vspscc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"" | ||
{ | ||
"FILE_VERSION" = "9237" | ||
"ENLISTMENT_CHOICE" = "NEVER" | ||
"PROJECT_FILE_RELATIVE_PATH" = "" | ||
"NUMBER_OF_EXCLUDED_FILES" = "0" | ||
"ORIGINAL_PROJECT_FILE_PATH" = "" | ||
"NUMBER_OF_NESTED_PROJECTS" = "0" | ||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" | ||
} |
33 changes: 33 additions & 0 deletions
33
PRO WCF Final Code/Chapter 03/ConsoleHost/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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("ExchangeServiceHost")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("Development Company")] | ||
[assembly: AssemblyProduct("ExchangeServiceHost")] | ||
[assembly: AssemblyCopyright("Copyright © Development Company 2006")] | ||
[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("47c62010-bea7-4ef0-be46-334e25a3b59b")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
15 changes: 15 additions & 0 deletions
15
PRO WCF Final Code/Chapter 03/ExchangeService/Contracts/ITradeService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.ServiceModel; | ||
using QuickReturns.StockTrading.ExchangeService.DataContracts; | ||
|
||
namespace QuickReturns.StockTrading.ExchangeService.Contracts | ||
{ | ||
[ServiceContract(Namespace = "http://QuickReturns")] | ||
public interface ITradeService | ||
{ | ||
[OperationContract()] | ||
Quote GetQuote(string ticker); | ||
|
||
[OperationContract()] | ||
void PublishQuote(Quote quote); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
PRO WCF Final Code/Chapter 03/ExchangeService/Contracts/ITradeServiceMessage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Note that this class is not used in the solution | ||
using System.ServiceModel; | ||
using System.ServiceModel.Channels; | ||
|
||
namespace QuickReturns.StockTrading.ExchangeService.Contracts | ||
{ | ||
[ServiceContract(Namespace = "http://QuickReturns")] | ||
interface ITradeServiceMessage | ||
{ | ||
[OperationContract()] | ||
Message GetQuote(string ticker); | ||
|
||
[OperationContract()] | ||
void PublishQuote(Message quote); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
PRO WCF Final Code/Chapter 03/ExchangeService/DataContracts/Quote.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Runtime.Serialization; | ||
|
||
namespace QuickReturns.StockTrading.ExchangeService.DataContracts | ||
{ | ||
[DataContract(Namespace = "http://QuickReturns")] | ||
public class Quote | ||
{ | ||
[DataMember(Name = "Ticker")] | ||
public string Ticker; | ||
|
||
[DataMember(Name = "Bid")] | ||
public decimal Bid; | ||
|
||
[DataMember(Name = "Ask")] | ||
public decimal Ask; | ||
|
||
[DataMember(Name = "Publisher")] | ||
public string Publisher; | ||
|
||
[DataMember(Name = "UpdateDateTime")] | ||
private DateTime UpdateDateTime; | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
PRO WCF Final Code/Chapter 03/ExchangeService/ExchangeService.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>8.0.50727</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{89B39ED1-3CD4-4F5D-B7BA-A4527CD22B54}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>QuickReturns.StockTrading.ExchangeService</RootNamespace> | ||
<AssemblyName>QuickReturns.StockTrading.ExchangeService</AssemblyName> | ||
<SccProjectName> | ||
</SccProjectName> | ||
<SccLocalPath> | ||
</SccLocalPath> | ||
<SccAuxPath> | ||
</SccAuxPath> | ||
<SccProvider> | ||
</SccProvider> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Runtime.Serialization" /> | ||
<Reference Include="System.ServiceModel" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Contracts\ITradeService.cs" /> | ||
<Compile Include="Contracts\ITradeServiceMessage.cs" /> | ||
<Compile Include="DataContracts\Quote.cs" /> | ||
<Compile Include="MessageContracts\QuoteMessage.cs" /> | ||
<Compile Include="TradeService.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
10 changes: 10 additions & 0 deletions
10
PRO WCF Final Code/Chapter 03/ExchangeService/ExchangeService.csproj.vspscc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"" | ||
{ | ||
"FILE_VERSION" = "9237" | ||
"ENLISTMENT_CHOICE" = "NEVER" | ||
"PROJECT_FILE_RELATIVE_PATH" = "" | ||
"NUMBER_OF_EXCLUDED_FILES" = "0" | ||
"ORIGINAL_PROJECT_FILE_PATH" = "" | ||
"NUMBER_OF_NESTED_PROJECTS" = "0" | ||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" | ||
} |
Oops, something went wrong.