forked from microsoft/TailwindTraders-Backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/call registration service (microsoft#4)
* Fixed error on lost using. * Added flag for bypassing the registration users service. * Call to Registration WCF Service from WebBFF API, passing the service address in configuration. * Same for MobileBFF. * Service port. * Added option to select the tag for wcf image. * The changes... * Changes suggested in PR. * Deleted unnecessary variable.
- Loading branch information
Showing
35 changed files
with
543 additions
and
32 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
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
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
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
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
24 changes: 24 additions & 0 deletions
24
...GWs/Tailwind.Traders.Bff/Connected Services/RegistrationUserService/ConnectedService.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,24 @@ | ||
{ | ||
"ProviderId": "Microsoft.VisualStudio.ConnectedService.Wcf", | ||
"Version": "15.0.20628.921", | ||
"ExtendedData": { | ||
"Uri": "http://localhost:51402/UserService.svc", | ||
"Namespace": "RegistrationUserService", | ||
"SelectedAccessLevelForGeneratedClass": "Public", | ||
"GenerateMessageContract": false, | ||
"ReuseTypesinReferencedAssemblies": true, | ||
"ReuseTypesinAllReferencedAssemblies": true, | ||
"CollectionTypeReference": { | ||
"Item1": "System.Array", | ||
"Item2": "System.Runtime.dll" | ||
}, | ||
"DictionaryCollectionTypeReference": { | ||
"Item1": "System.Collections.Generic.Dictionary`2", | ||
"Item2": "System.Collections.dll" | ||
}, | ||
"CheckedReferencedAssemblies": [], | ||
"InstanceId": null, | ||
"Name": "RegistrationUserService", | ||
"Metadata": {} | ||
} | ||
} |
127 changes: 127 additions & 0 deletions
127
Source/ApiGWs/Tailwind.Traders.Bff/Connected Services/RegistrationUserService/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,127 @@ | ||
//------------------------------------------------------------------------------ | ||
// <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 RegistrationUserService | ||
{ | ||
|
||
|
||
[System.CodeDom.Compiler.GeneratedCodeAttribute("dotnet-svcutil", "1.0.0.1")] | ||
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="RegistrationUserService.IUserService")] | ||
public interface IUserService | ||
{ | ||
|
||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IUserService/Registration", ReplyAction="http://tempuri.org/IUserService/RegistrationResponse")] | ||
System.Threading.Tasks.Task<bool> RegistrationAsync(string email); | ||
} | ||
|
||
[System.CodeDom.Compiler.GeneratedCodeAttribute("dotnet-svcutil", "1.0.0.1")] | ||
public interface IUserServiceChannel : RegistrationUserService.IUserService, System.ServiceModel.IClientChannel | ||
{ | ||
} | ||
|
||
[System.Diagnostics.DebuggerStepThroughAttribute()] | ||
[System.CodeDom.Compiler.GeneratedCodeAttribute("dotnet-svcutil", "1.0.0.1")] | ||
public partial class UserServiceClient : System.ServiceModel.ClientBase<RegistrationUserService.IUserService>, RegistrationUserService.IUserService | ||
{ | ||
|
||
/// <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 UserServiceClient() : | ||
base(UserServiceClient.GetDefaultBinding(), UserServiceClient.GetDefaultEndpointAddress()) | ||
{ | ||
this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IUserService.ToString(); | ||
ConfigureEndpoint(this.Endpoint, this.ClientCredentials); | ||
} | ||
|
||
public UserServiceClient(EndpointConfiguration endpointConfiguration) : | ||
base(UserServiceClient.GetBindingForEndpoint(endpointConfiguration), UserServiceClient.GetEndpointAddress(endpointConfiguration)) | ||
{ | ||
this.Endpoint.Name = endpointConfiguration.ToString(); | ||
ConfigureEndpoint(this.Endpoint, this.ClientCredentials); | ||
} | ||
|
||
public UserServiceClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : | ||
base(UserServiceClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) | ||
{ | ||
this.Endpoint.Name = endpointConfiguration.ToString(); | ||
ConfigureEndpoint(this.Endpoint, this.ClientCredentials); | ||
} | ||
|
||
public UserServiceClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : | ||
base(UserServiceClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) | ||
{ | ||
this.Endpoint.Name = endpointConfiguration.ToString(); | ||
ConfigureEndpoint(this.Endpoint, this.ClientCredentials); | ||
} | ||
|
||
public UserServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : | ||
base(binding, remoteAddress) | ||
{ | ||
} | ||
|
||
public System.Threading.Tasks.Task<bool> RegistrationAsync(string email) | ||
{ | ||
return base.Channel.RegistrationAsync(email); | ||
} | ||
|
||
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)); | ||
} | ||
|
||
public virtual System.Threading.Tasks.Task CloseAsync() | ||
{ | ||
return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); | ||
} | ||
|
||
private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) | ||
{ | ||
if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IUserService)) | ||
{ | ||
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_IUserService)) | ||
{ | ||
return new System.ServiceModel.EndpointAddress("http://localhost:51402/UserService.svc"); | ||
} | ||
throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); | ||
} | ||
|
||
private static System.ServiceModel.Channels.Binding GetDefaultBinding() | ||
{ | ||
return UserServiceClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IUserService); | ||
} | ||
|
||
private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() | ||
{ | ||
return UserServiceClient.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IUserService); | ||
} | ||
|
||
public enum EndpointConfiguration | ||
{ | ||
|
||
BasicHttpBinding_IUserService, | ||
} | ||
} | ||
} |
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
9 changes: 9 additions & 0 deletions
9
Source/ApiGWs/Tailwind.Traders.Bff/Services/IRegisterService.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,9 @@ | ||
using System.Threading.Tasks; | ||
|
||
namespace Tailwind.Traders.MobileBff.Services | ||
{ | ||
public interface IRegisterService | ||
{ | ||
Task<bool> RegisterUserIfNotExists(string email); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
Source/ApiGWs/Tailwind.Traders.Bff/Services/RegisterService.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,20 @@ | ||
using RegistrationUserService; | ||
using System.Threading.Tasks; | ||
|
||
namespace Tailwind.Traders.MobileBff.Services | ||
{ | ||
public class RegisterService : IRegisterService | ||
{ | ||
private readonly IUserService _client; | ||
|
||
public RegisterService(IUserService client) | ||
{ | ||
_client = client; | ||
} | ||
|
||
public async Task<bool> RegisterUserIfNotExists(string email) | ||
{ | ||
return await _client.RegistrationAsync(email); | ||
} | ||
} | ||
} |
Oops, something went wrong.