-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for dotnet-svcutil type reuse support in multi-target project.
- Loading branch information
1 parent
1ebba03
commit 853f999
Showing
11 changed files
with
405 additions
and
3 deletions.
There are no files selected for viewing
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
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
168 changes: 168 additions & 0 deletions
168
...il/lib/tests/Baselines/MultiTargetTypeReuse/TypeReuseClient/ServiceReference/Reference.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,168 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by a tool. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
namespace ServiceReference | ||
{ | ||
using System.Runtime.Serialization; | ||
|
||
|
||
[System.Diagnostics.DebuggerStepThroughAttribute()] | ||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] | ||
[System.Runtime.Serialization.DataContractAttribute(Name="TypeReuseCompositeType", Namespace="http://schemas.datacontract.org/2004/07/TypesLib")] | ||
public partial class TypeReuseCompositeType : object | ||
{ | ||
|
||
private bool BoolValueField; | ||
|
||
private string StringValueField; | ||
|
||
[System.Runtime.Serialization.DataMemberAttribute()] | ||
public bool BoolValue | ||
{ | ||
get | ||
{ | ||
return this.BoolValueField; | ||
} | ||
set | ||
{ | ||
this.BoolValueField = value; | ||
} | ||
} | ||
|
||
[System.Runtime.Serialization.DataMemberAttribute()] | ||
public string StringValue | ||
{ | ||
get | ||
{ | ||
return this.StringValueField; | ||
} | ||
set | ||
{ | ||
this.StringValueField = value; | ||
} | ||
} | ||
} | ||
|
||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] | ||
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="ServiceReference.ITypeReuseSvc")] | ||
public interface ITypeReuseSvc | ||
{ | ||
|
||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ITypeReuseSvc/GetData", ReplyAction="http://tempuri.org/ITypeReuseSvc/GetDataResponse")] | ||
System.Threading.Tasks.Task<BinLib.BinLibrary> GetDataAsync(int value); | ||
|
||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ITypeReuseSvc/GetDataUsingDataContract", ReplyAction="http://tempuri.org/ITypeReuseSvc/GetDataUsingDataContractResponse")] | ||
System.Threading.Tasks.Task<ServiceReference.TypeReuseCompositeType> GetDataUsingDataContractAsync(ServiceReference.TypeReuseCompositeType composite); | ||
} | ||
|
||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] | ||
public interface ITypeReuseSvcChannel : ServiceReference.ITypeReuseSvc, System.ServiceModel.IClientChannel | ||
{ | ||
} | ||
|
||
[System.Diagnostics.DebuggerStepThroughAttribute()] | ||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] | ||
public partial class TypeReuseSvcClient : System.ServiceModel.ClientBase<ServiceReference.ITypeReuseSvc>, ServiceReference.ITypeReuseSvc | ||
{ | ||
|
||
/// <summary> | ||
/// Implement this partial method to configure the service endpoint. | ||
/// </summary> | ||
/// <param name="serviceEndpoint">The endpoint to configure</param> | ||
/// <param name="clientCredentials">The client credentials</param> | ||
static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); | ||
|
||
public TypeReuseSvcClient() : | ||
base(TypeReuseSvcClient.GetDefaultBinding(), TypeReuseSvcClient.GetDefaultEndpointAddress()) | ||
{ | ||
this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_ITypeReuseSvc.ToString(); | ||
ConfigureEndpoint(this.Endpoint, this.ClientCredentials); | ||
} | ||
|
||
public TypeReuseSvcClient(EndpointConfiguration endpointConfiguration) : | ||
base(TypeReuseSvcClient.GetBindingForEndpoint(endpointConfiguration), TypeReuseSvcClient.GetEndpointAddress(endpointConfiguration)) | ||
{ | ||
this.Endpoint.Name = endpointConfiguration.ToString(); | ||
ConfigureEndpoint(this.Endpoint, this.ClientCredentials); | ||
} | ||
|
||
public TypeReuseSvcClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : | ||
base(TypeReuseSvcClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) | ||
{ | ||
this.Endpoint.Name = endpointConfiguration.ToString(); | ||
ConfigureEndpoint(this.Endpoint, this.ClientCredentials); | ||
} | ||
|
||
public TypeReuseSvcClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : | ||
base(TypeReuseSvcClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) | ||
{ | ||
this.Endpoint.Name = endpointConfiguration.ToString(); | ||
ConfigureEndpoint(this.Endpoint, this.ClientCredentials); | ||
} | ||
|
||
public TypeReuseSvcClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : | ||
base(binding, remoteAddress) | ||
{ | ||
} | ||
|
||
public System.Threading.Tasks.Task<BinLib.BinLibrary> GetDataAsync(int value) | ||
{ | ||
return base.Channel.GetDataAsync(value); | ||
} | ||
|
||
public System.Threading.Tasks.Task<ServiceReference.TypeReuseCompositeType> GetDataUsingDataContractAsync(ServiceReference.TypeReuseCompositeType composite) | ||
{ | ||
return base.Channel.GetDataUsingDataContractAsync(composite); | ||
} | ||
|
||
public virtual System.Threading.Tasks.Task OpenAsync() | ||
{ | ||
return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); | ||
} | ||
|
||
private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) | ||
{ | ||
if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_ITypeReuseSvc)) | ||
{ | ||
System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); | ||
result.MaxBufferSize = int.MaxValue; | ||
result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; | ||
result.MaxReceivedMessageSize = int.MaxValue; | ||
result.AllowCookies = true; | ||
return result; | ||
} | ||
throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); | ||
} | ||
|
||
private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) | ||
{ | ||
if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_ITypeReuseSvc)) | ||
{ | ||
return new System.ServiceModel.EndpointAddress("http://localhost:51074/TypeReuseSvc.svc"); | ||
} | ||
throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); | ||
} | ||
|
||
private static System.ServiceModel.Channels.Binding GetDefaultBinding() | ||
{ | ||
return TypeReuseSvcClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_ITypeReuseSvc); | ||
} | ||
|
||
private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() | ||
{ | ||
return TypeReuseSvcClient.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_ITypeReuseSvc); | ||
} | ||
|
||
public enum EndpointConfiguration | ||
{ | ||
|
||
BasicHttpBinding_ITypeReuseSvc, | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...aselines/MultiTargetTypeReuse/TypeReuseClient/ServiceReference/dotnet-svcutil.params.json
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,18 @@ | ||
{ | ||
"providerId": "Microsoft.Tools.ServiceModel.Svcutil", | ||
"version": "99.99.99", | ||
"options": { | ||
"inputs": [ | ||
"$testCasesPath$/wsdl/TypeReuseSvc.wsdl" | ||
], | ||
"namespaceMappings": [ | ||
"*, ServiceReference" | ||
], | ||
"outputFile": "Reference.cs", | ||
"references": [ | ||
"$TEMP$MultiTargetTypeReuse//TypeReuseClient//bin//Debug//net6.0//BinLib.dll" | ||
], | ||
"targetFramework": "N.N", | ||
"typeReuseMode": "All" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...t-svcutil/lib/tests/Baselines/MultiTargetTypeReuse/TypeReuseClient/TypeReuseClient.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,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFrameworks>net6.0;net7.0</TargetFrameworks> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="BinLib"> | ||
<HintPath>../BinLib/BinLib.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="System.ServiceModel.*", Version="N.N.N"> | ||
<PackageReference Include="System.ServiceModel.*", Version="N.N.N"> | ||
<PackageReference Include="System.ServiceModel.*", Version="N.N.N"> | ||
<PackageReference Include="System.ServiceModel.*", Version="N.N.N"> | ||
<PackageReference Include="System.ServiceModel.*", Version="N.N.N"> | ||
</ItemGroup> | ||
</Project> |
Binary file added
BIN
+4 KB
src/dotnet-svcutil/lib/tests/TestCases/MultiTargetTypeReuse/BinLib/BinLib.dll
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
src/dotnet-svcutil/lib/tests/TestCases/MultiTargetTypeReuse/TypeReuseClient/Program.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,12 @@ | ||
using System; | ||
|
||
namespace TypeReuseClient | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
Console.WriteLine("Hello World!"); | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...t-svcutil/lib/tests/TestCases/MultiTargetTypeReuse/TypeReuseClient/TypeReuseClient.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,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFrameworks>net6.0;net7.0</TargetFrameworks> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="BinLib"> | ||
<HintPath>..\BinLib\BinLib.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.