Skip to content

Commit

Permalink
Example for WCF usage in configuration
Browse files Browse the repository at this point in the history
git-svn-id: http://protobuf-net.googlecode.com/svn/trunk@276 b72047a4-3652-0410-9617-b3994939e97b
  • Loading branch information
marc.gravell committed Nov 11, 2009
1 parent 2f00969 commit d84e28b
Show file tree
Hide file tree
Showing 28 changed files with 1,433 additions and 9 deletions.
1 change: 1 addition & 0 deletions Info.txt
@@ -0,0 +1 @@
See blog for notes on this: http://marcgravell.blogspot.com/2009/11/controlling-wcf-protobuf-net-at.html
90 changes: 88 additions & 2 deletions Proto.sln
Expand Up @@ -5,7 +5,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Examples", "Examples\Exampl
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "protobuf-net", "protobuf-net\protobuf-net.csproj", "{8374E4D7-2A91-48F1-9360-09B09CF27C3F}"
EndProject
Project("{00000000-0000-0000-0000-000000000000}") = "protobuf-net_Silverlight", "protobuf-net_Silverlight\protobuf-net_Silverlight.csproj", "{35032FC5-65E0-4FE4-8DBC-A31F0694EC14}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "protobuf-net_Silverlight", "protobuf-net_Silverlight\protobuf-net_Silverlight.csproj", "{35032FC5-65E0-4FE4-8DBC-A31F0694EC14}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SilverlightExtended", "SilverlightExtended\SilverlightExtended.csproj", "{05A18144-D234-46D7-A36C-CD45BA884746}"
EndProject
Expand All @@ -27,7 +27,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LateLoaded", "LateLoaded\La
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "protobuf-net.Extensions", "protobuf-net.Extensions\protobuf-net.Extensions.csproj", "{927AB924-08B5-4629-B505-3BC78A61B0D6}"
EndProject
Project("{00000000-0000-0000-0000-000000000000}") = "demo-rpc-client-silverlight", "demo-rpc-client-silverlight\demo-rpc-client-silverlight.csproj", "{7C741476-7F39-4C17-9806-C839A5683463}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "demo-rpc-client-silverlight", "demo-rpc-client-silverlight\demo-rpc-client-silverlight.csproj", "{7C741476-7F39-4C17-9806-C839A5683463}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "demo-rpc-server-mvc", "demo-rpc-server-mvc\demo-rpc-server-mvc.csproj", "{2F293C90-1DE4-4CE1-AFA7-D0B36E0CA8A9}"
EndProject
Expand All @@ -42,6 +42,30 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VBTestRig", "VBTestRig\VBTe
EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "protobuf-net-VS9", "protobuf-net-VS9\protobuf-net-VS9.vdproj", "{6F537CE4-FB43-40F0-8F7C-F83BDC11CAE4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "protobuf-net-v2", "protobuf-net-v2\protobuf-net-v2.csproj", "{06EF9CCA-F340-434A-984E-2154BD8C267B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestWcfServer", "TestWcfServer\TestWcfServer.csproj", "{C89574F5-DC36-41D7-8F83-4100C58A9441}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestWcfClient", "TestWcfClient\TestWcfClient.csproj", "{2D434050-3A61-498B-A740-2CD2DC2631EF}"
ProjectSection(ProjectDependencies) = postProject
{C89574F5-DC36-41D7-8F83-4100C58A9441} = {C89574F5-DC36-41D7-8F83-4100C58A9441}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AltBuilds", "AltBuilds", "{71D3E579-BBA2-4020-B3F2-804481770FD2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{58597FF0-C3FC-4D16-9004-1CFBA924161C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeGen", "CodeGen", "{E769FD52-855E-4FD1-A3D5-C86209E4B692}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{A923E15B-C9C7-4A7A-8211-8AEDA2F3F68F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestWcfDto", "TestWcfDto\TestWcfDto.csproj", "{1A08F440-53DC-4C42-9CD1-C1507E5036A7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WcfEndpoint", "WcfEndpoint", "{A3717935-081E-4338-A50B-DCF0B28D7464}"
ProjectSection(SolutionItems) = preProject
Info.txt = Info.txt
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -204,8 +228,70 @@ Global
{6F537CE4-FB43-40F0-8F7C-F83BDC11CAE4}.Profile|Any CPU.ActiveCfg = Release
{6F537CE4-FB43-40F0-8F7C-F83BDC11CAE4}.Release|Any CPU.ActiveCfg = Release
{6F537CE4-FB43-40F0-8F7C-F83BDC11CAE4}.Silverlight2|Any CPU.ActiveCfg = Release
{06EF9CCA-F340-434A-984E-2154BD8C267B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{06EF9CCA-F340-434A-984E-2154BD8C267B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{06EF9CCA-F340-434A-984E-2154BD8C267B}.Net20|Any CPU.ActiveCfg = Release|Any CPU
{06EF9CCA-F340-434A-984E-2154BD8C267B}.Net20|Any CPU.Build.0 = Release|Any CPU
{06EF9CCA-F340-434A-984E-2154BD8C267B}.Profile|Any CPU.ActiveCfg = Release|Any CPU
{06EF9CCA-F340-434A-984E-2154BD8C267B}.Profile|Any CPU.Build.0 = Release|Any CPU
{06EF9CCA-F340-434A-984E-2154BD8C267B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{06EF9CCA-F340-434A-984E-2154BD8C267B}.Release|Any CPU.Build.0 = Release|Any CPU
{06EF9CCA-F340-434A-984E-2154BD8C267B}.Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{06EF9CCA-F340-434A-984E-2154BD8C267B}.Silverlight2|Any CPU.Build.0 = Release|Any CPU
{C89574F5-DC36-41D7-8F83-4100C58A9441}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C89574F5-DC36-41D7-8F83-4100C58A9441}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C89574F5-DC36-41D7-8F83-4100C58A9441}.Net20|Any CPU.ActiveCfg = Release|Any CPU
{C89574F5-DC36-41D7-8F83-4100C58A9441}.Net20|Any CPU.Build.0 = Release|Any CPU
{C89574F5-DC36-41D7-8F83-4100C58A9441}.Profile|Any CPU.ActiveCfg = Release|Any CPU
{C89574F5-DC36-41D7-8F83-4100C58A9441}.Profile|Any CPU.Build.0 = Release|Any CPU
{C89574F5-DC36-41D7-8F83-4100C58A9441}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C89574F5-DC36-41D7-8F83-4100C58A9441}.Release|Any CPU.Build.0 = Release|Any CPU
{C89574F5-DC36-41D7-8F83-4100C58A9441}.Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{C89574F5-DC36-41D7-8F83-4100C58A9441}.Silverlight2|Any CPU.Build.0 = Release|Any CPU
{2D434050-3A61-498B-A740-2CD2DC2631EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D434050-3A61-498B-A740-2CD2DC2631EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D434050-3A61-498B-A740-2CD2DC2631EF}.Net20|Any CPU.ActiveCfg = Release|Any CPU
{2D434050-3A61-498B-A740-2CD2DC2631EF}.Net20|Any CPU.Build.0 = Release|Any CPU
{2D434050-3A61-498B-A740-2CD2DC2631EF}.Profile|Any CPU.ActiveCfg = Release|Any CPU
{2D434050-3A61-498B-A740-2CD2DC2631EF}.Profile|Any CPU.Build.0 = Release|Any CPU
{2D434050-3A61-498B-A740-2CD2DC2631EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D434050-3A61-498B-A740-2CD2DC2631EF}.Release|Any CPU.Build.0 = Release|Any CPU
{2D434050-3A61-498B-A740-2CD2DC2631EF}.Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{2D434050-3A61-498B-A740-2CD2DC2631EF}.Silverlight2|Any CPU.Build.0 = Release|Any CPU
{1A08F440-53DC-4C42-9CD1-C1507E5036A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A08F440-53DC-4C42-9CD1-C1507E5036A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A08F440-53DC-4C42-9CD1-C1507E5036A7}.Net20|Any CPU.ActiveCfg = Release|Any CPU
{1A08F440-53DC-4C42-9CD1-C1507E5036A7}.Net20|Any CPU.Build.0 = Release|Any CPU
{1A08F440-53DC-4C42-9CD1-C1507E5036A7}.Profile|Any CPU.ActiveCfg = Release|Any CPU
{1A08F440-53DC-4C42-9CD1-C1507E5036A7}.Profile|Any CPU.Build.0 = Release|Any CPU
{1A08F440-53DC-4C42-9CD1-C1507E5036A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A08F440-53DC-4C42-9CD1-C1507E5036A7}.Release|Any CPU.Build.0 = Release|Any CPU
{1A08F440-53DC-4C42-9CD1-C1507E5036A7}.Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{1A08F440-53DC-4C42-9CD1-C1507E5036A7}.Silverlight2|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{05A18144-D234-46D7-A36C-CD45BA884746} = {58597FF0-C3FC-4D16-9004-1CFBA924161C}
{65A793DB-49B9-4563-B028-BDF958A915CE} = {58597FF0-C3FC-4D16-9004-1CFBA924161C}
{E1EB9E1A-8BC0-4DA8-983A-6896F523BEE3} = {58597FF0-C3FC-4D16-9004-1CFBA924161C}
{7C741476-7F39-4C17-9806-C839A5683463} = {58597FF0-C3FC-4D16-9004-1CFBA924161C}
{2F293C90-1DE4-4CE1-AFA7-D0B36E0CA8A9} = {58597FF0-C3FC-4D16-9004-1CFBA924161C}
{5298B531-E3E3-4E3B-B8D2-62459C52163B} = {58597FF0-C3FC-4D16-9004-1CFBA924161C}
{816EC137-7AFD-42B3-84A1-447E33A6A8C8} = {58597FF0-C3FC-4D16-9004-1CFBA924161C}
{927AB924-08B5-4629-B505-3BC78A61B0D6} = {A923E15B-C9C7-4A7A-8211-8AEDA2F3F68F}
{06EF9CCA-F340-434A-984E-2154BD8C267B} = {A923E15B-C9C7-4A7A-8211-8AEDA2F3F68F}
{8374E4D7-2A91-48F1-9360-09B09CF27C3F} = {A923E15B-C9C7-4A7A-8211-8AEDA2F3F68F}
{5603E8F8-6425-43BF-849E-C95F1D7A8AEB} = {71D3E579-BBA2-4020-B3F2-804481770FD2}
{C12D2EDB-76A0-4025-AF7A-28766D6AF78C} = {71D3E579-BBA2-4020-B3F2-804481770FD2}
{414BC396-98D1-46F8-B3AA-A77CC87C7C82} = {71D3E579-BBA2-4020-B3F2-804481770FD2}
{35032FC5-65E0-4FE4-8DBC-A31F0694EC14} = {71D3E579-BBA2-4020-B3F2-804481770FD2}
{472D6E77-593E-40EB-993C-5F3EE80E7231} = {E769FD52-855E-4FD1-A3D5-C86209E4B692}
{6F537CE4-FB43-40F0-8F7C-F83BDC11CAE4} = {E769FD52-855E-4FD1-A3D5-C86209E4B692}
{F6CBE303-3B5F-4CCC-B0B7-D81A6BD462C9} = {E769FD52-855E-4FD1-A3D5-C86209E4B692}
{C89574F5-DC36-41D7-8F83-4100C58A9441} = {A3717935-081E-4338-A50B-DCF0B28D7464}
{2D434050-3A61-498B-A740-2CD2DC2631EF} = {A3717935-081E-4338-A50B-DCF0B28D7464}
{1A08F440-53DC-4C42-9CD1-C1507E5036A7} = {A3717935-081E-4338-A50B-DCF0B28D7464}
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions ProtoGen/Properties/AssemblyInfo.cs
Expand Up @@ -33,5 +33,5 @@
// 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.274")]
[assembly: AssemblyFileVersion("1.0.0.274")]
[assembly: AssemblyVersion("1.0.0.275")]
[assembly: AssemblyFileVersion("1.0.0.275")]
18 changes: 18 additions & 0 deletions TestWcfClient/Program.cs
@@ -0,0 +1,18 @@

using TestWcfClient.ServiceReference1;
using TestWcfDto;
namespace TestWcfClient
{
class Program
{
static void Main()
{
using (var client = new Service1Client())
{
string s = client.GetData(123);
var ct = new CompositeType { BoolValue = true, StringValue = s };
var resp = client.GetDataUsingDataContract(ct);
}
}
}
}
36 changes: 36 additions & 0 deletions TestWcfClient/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("TestWcfClient")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TestWcfClient")]
[assembly: AssemblyCopyright("Copyright © 2009")]
[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("d35cacc5-787e-4e68-925f-2916fa5b89f6")]

// 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")]
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="CompositeType" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>TestWcfDto.CompositeType, TestWcfDto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>
60 changes: 60 additions & 0 deletions TestWcfClient/Service References/ServiceReference1/Reference.cs
@@ -0,0 +1,60 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace TestWcfClient.ServiceReference1 {


[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="ServiceReference1.IService1")]
public interface IService1 {

[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetData", ReplyAction="http://tempuri.org/IService1/GetDataResponse")]
string GetData(int value);

[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetDataUsingDataContract", ReplyAction="http://tempuri.org/IService1/GetDataUsingDataContractResponse")]
TestWcfDto.CompositeType GetDataUsingDataContract(TestWcfDto.CompositeType composite);
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public interface IService1Channel : TestWcfClient.ServiceReference1.IService1, System.ServiceModel.IClientChannel {
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class Service1Client : System.ServiceModel.ClientBase<TestWcfClient.ServiceReference1.IService1>, TestWcfClient.ServiceReference1.IService1 {

public Service1Client() {
}

public Service1Client(string endpointConfigurationName) :
base(endpointConfigurationName) {
}

public Service1Client(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}

public Service1Client(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}

public Service1Client(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress) {
}

public string GetData(int value) {
return base.Channel.GetData(value);
}

public TestWcfDto.CompositeType GetDataUsingDataContract(TestWcfDto.CompositeType composite) {
return base.Channel.GetDataUsingDataContract(composite);
}
}
}
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<ReferenceGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ID="d245f643-477e-460f-841f-9f499371176f" xmlns="urn:schemas-microsoft-com:xml-wcfservicemap">
<ClientOptions>
<GenerateAsynchronousMethods>false</GenerateAsynchronousMethods>
<EnableDataBinding>true</EnableDataBinding>
<ExcludedTypes />
<ImportXmlTypes>false</ImportXmlTypes>
<GenerateInternalTypes>false</GenerateInternalTypes>
<GenerateMessageContracts>false</GenerateMessageContracts>
<NamespaceMappings />
<CollectionMappings />
<GenerateSerializableTypes>true</GenerateSerializableTypes>
<Serializer>Auto</Serializer>
<ReferenceAllAssemblies>true</ReferenceAllAssemblies>
<ReferencedAssemblies />
<ReferencedDataContractTypes />
<ServiceContractMappings />
</ClientOptions>
<MetadataSources>
<MetadataSource Address="http://localhost:33545/Service1.svc?wsdl" Protocol="http" SourceId="1" />
</MetadataSources>
<Metadata>
<MetadataFile FileName="Service1.wsdl" MetadataType="Wsdl" ID="c63ad9f1-e21e-40e7-aa91-932d37d130b7" SourceId="1" SourceUrl="http://localhost:33545/Service1.svc?wsdl" />
<MetadataFile FileName="Service1.xsd" MetadataType="Schema" ID="04d4a3a5-514b-43bf-919d-f222dcfb5318" SourceId="1" SourceUrl="http://localhost:33545/Service1.svc?xsd=xsd1" />
<MetadataFile FileName="Service11.xsd" MetadataType="Schema" ID="209faf77-d2ab-42ac-b49d-c9377559b798" SourceId="1" SourceUrl="http://localhost:33545/Service1.svc?xsd=xsd2" />
<MetadataFile FileName="Service12.xsd" MetadataType="Schema" ID="e7b279e2-a58e-488f-b81e-84c0c3046c8b" SourceId="1" SourceUrl="http://localhost:33545/Service1.svc?xsd=xsd0" />
</Metadata>
<Extensions>
<ExtensionFile FileName="configuration91.svcinfo" Name="configuration91.svcinfo" />
<ExtensionFile FileName="configuration.svcinfo" Name="configuration.svcinfo" />
</Extensions>
</ReferenceGroup>

0 comments on commit d84e28b

Please sign in to comment.