diff options
Diffstat (limited to 'qpid/dotnet/client-010/wcf/demo/wcfHelloClient')
6 files changed, 315 insertions, 0 deletions
diff --git a/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/App.config b/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/App.config new file mode 100644 index 0000000000..1545d71d6f --- /dev/null +++ b/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/App.config @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +--> + +<configuration> + <system.serviceModel> + + <client> + <endpoint address="soap.amqp:///Hello" + binding="customBinding" + bindingConfiguration="QpidBinding" + contract="org.apache.qpid.wcf.demo.helloClient.IHelloContract" + name="HelloService" /> + </client> + + + <bindings> + <customBinding> + <binding name="QpidBinding"> + <textMessageEncoding /> + <QpidTransport + host="localhost" + port="5672" /> + </binding> + </customBinding> + </bindings> + + <extensions> + <bindingElementExtensions> + <add + name="QpidTransport" + type="org.apache.qpid.wcf.model.QpidTransportElement, qpidWCFModel"/> + </bindingElementExtensions> + </extensions> + + + </system.serviceModel> +</configuration> diff --git a/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/HelloClient.cs b/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/HelloClient.cs new file mode 100644 index 0000000000..31743c62cf --- /dev/null +++ b/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/HelloClient.cs @@ -0,0 +1,36 @@ +/* +* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +* +*/ + +using System.ServiceModel; + +namespace org.apache.qpid.wcf.demo.helloClient +{ + public class HelloClient : ClientBase<IHelloContract>, IHelloContract + { + public HelloClient(string configurationName) + : base(configurationName) { } + + public void Hello(string name) + { + Channel.Hello(name); + } + } +} diff --git a/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/IHelloService.cs b/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/IHelloService.cs new file mode 100644 index 0000000000..d3b9a354ba --- /dev/null +++ b/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/IHelloService.cs @@ -0,0 +1,33 @@ +/* +* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +* +*/ + +using System.ServiceModel; + +namespace org.apache.qpid.wcf.demo.helloClient +{ + [ServiceContract] + public interface IHelloContract + { + [OperationContract(IsOneWay=true)] + void Hello(string name); + } + +} diff --git a/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/Program.cs b/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/Program.cs new file mode 100644 index 0000000000..fc68d2556a --- /dev/null +++ b/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/Program.cs @@ -0,0 +1,48 @@ +/* +* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +* +*/ + +using System; + +namespace org.apache.qpid.wcf.demo.helloClient +{ + class Program + { + static void Main(string[] args) + { + Console.Title = "Hello Service Client"; + Console.ForegroundColor = ConsoleColor.White; + Console.WriteLine("Hello Service Client"); + Console.ForegroundColor = ConsoleColor.Gray; + Console.WriteLine(); + // create a client using the configuration file App.config + var client = new HelloClient("HelloService"); + Console.WriteLine("Client Saying Hello to Qpid"); + client.Hello("Qpid"); + Console.WriteLine("Client Saying Hello to AMQP"); + client.Hello("AMQP"); + // closing the client service + client.ChannelFactory.Close(); + Console.WriteLine(); + Console.Write("Press Enter to Exit..."); + Console.ReadLine(); + } + } +} diff --git a/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/Properties/AssemblyInfo.cs b/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..83dfbcd5f4 --- /dev/null +++ b/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/Properties/AssemblyInfo.cs @@ -0,0 +1,57 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +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("Qpid WCF Hello Client")] +[assembly: AssemblyDescription("Built from svn revision number: ")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Apache Software Foundation")] +[assembly: AssemblyProduct("Qpid WCF Hello Client")] +[assembly: AssemblyCopyright("Apache Software Foundation")] +[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("f7628695-280a-4689-ac6f-1186177f9a25")] + +// 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("0.5.0.0")] +[assembly: AssemblyVersion("0.5.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/wcfHelloClient.csproj b/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/wcfHelloClient.csproj new file mode 100644 index 0000000000..2e518d0da0 --- /dev/null +++ b/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/wcfHelloClient.csproj @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + - + - Licensed to the Apache Software Foundation (ASF) under one + - or more contributor license agreements. See the NOTICE file + - distributed with this work for additional information + - regarding copyright ownership. The ASF licenses this file + - to you under the Apache License, Version 2.0 (the + - "License"); you may not use this file except in compliance + - with the License. You may obtain a copy of the License at + - + - http://www.apache.org/licenses/LICENSE-2.0 + - + - Unless required by applicable law or agreed to in writing, + - software distributed under the License is distributed on an + - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + - KIND, either express or implied. See the License for the + - specific language governing permissions and limitations + - under the License. + - + --> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{A24E27DB-A38D-40C9-9879-8390B68C2F06}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>wcfHelloClient</RootNamespace> + <AssemblyName>Qpid WCF Hello Client</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </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.configuration" /> + <Reference Include="System.ServiceModel"> + <RequiredTargetFramework>3.0</RequiredTargetFramework> + </Reference> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="HelloClient.cs" /> + <Compile Include="IHelloService.cs" /> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\wcf.csproj"> + <Project>{F1D80D9D-FE22-4213-A760-BFFDE7D131DD}</Project> + <Name>wcf</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\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>
\ No newline at end of file |