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
<services> | |
<service name="<YOUR_SERVICE_NAMESPACE.<YOUR_SERVICE_NAME"> | |
<!-- | |
Dual http binding | |
--> | |
<endpoint address="" | |
binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_<YOUR_SERVICE_INTERFACE>" | |
contract="<YOUR_SERVICE_NAMESPACE.<YOUR_SERVICE_INTERFACE>"> | |
<identity> | |
<dns value="localhost" /> |
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
using System; | |
using System.ServiceModel; | |
using <YORU_SERVICE_NAMESPACE>; | |
namespace <YORU_APP_NAMESPACE> | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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
using System; | |
using System.ServiceModel; | |
using <YOUR_SERVICE_NAMESPACE>; | |
namespace <YOUR_APP_NAMESPACE> | |
{ | |
/// <summary> | |
/// This class receives the callbacks from the server. | |
/// </summary> | |
public class CallbackGetter : <YOUR_SERVICE_CALLBACK_INTERFACE> |
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
</bindings> | |
<wsDualHttpBinding> | |
<binding name="WSDualHttpBinding_<YOUR_SERVICE_INTERFACE>" closeTimeout="00:01:00" | |
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" | |
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" | |
maxBufferPoolSize="524288" maxReceivedMessageSize="65536" | |
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"> | |
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" | |
maxBytesPerRead="4096" maxNameTableCharCount="16384" /> | |
<reliableSession ordered="true" inactivityTimeout="00:10:00" /> |
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
<netTcpBinding> | |
<binding name="DuplexNetTcpBinding_<YOUR_SERVICE_INTERFACE>" | |
sendTimeout="00:00:10" | |
portSharingEnabled="false"> | |
</binding> | |
</netTcpBinding> |
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
<services> | |
<service name="<YOUR_SERVICE_NAMESPACE.<YOUR_SERVICE_NAME"> | |
<!-- | |
Dual http binding | |
--> | |
<endpoint address="" | |
binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_<YOUR_SERVICE_INTERFACE>" | |
contract="<YOUR_SERVICE_NAMESPACE.<YOUR_SERVICE_INTERFACE>"> | |
<identity> | |
<dns value="localhost" /> |
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
<serviceBehaviors> | |
<behavior name="Behaviour_<YOUR_SERVICE_INTERFACE>" > | |
<serviceMetadata /> | |
</behavior> | |
</serviceBehaviors> |
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
using System; | |
using System.ServiceModel; | |
using <YOUR_SERVICE_NAMESPACE>; | |
namespace Host_Service_with_callbacks_via_tcp | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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
using System; | |
using System.ServiceModel; | |
using Client_Service_with_callbacks_via_tcp.<YOUR_SERVICE_NAME>; | |
namespace Client_Service_with_callbacks_via_tcp | |
{ | |
class Program | |
{ | |
/// <summary> | |
/// Handles the callbacks from the server following |
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
public class CustomValidator : UserNamePasswordValidator | |
{ | |
public override void Validate(string user_name, string password) | |
{ | |
if (string.IsNullOrEmpty(user_name) || string.IsNullOrEmpty(password)) | |
throw new SecurityTokenException("Username and password required"); | |
if (!(user_name == "test" && password == "test")) | |
throw new SecurityTokenException("Wrong username or password."); | |
// Not throwing exceptions indicates |
OlderNewer