1
+ //------------------------------------------------------------------------------
2
+ // <auto-generated>
3
+ // This code was generated by a tool.
4
+ //
5
+ // Changes to this file may cause incorrect behavior and will be lost if
6
+ // the code is regenerated.
7
+ // </auto-generated>
8
+ //------------------------------------------------------------------------------
9
+
10
+ namespace SspiNegoAuthRequireCancelTokenFasle_NS
11
+ {
12
+
13
+
14
+ [ System . CodeDom . Compiler . GeneratedCodeAttribute ( "Microsoft.Tools.ServiceModel.Svcutil" , "99.99.99" ) ]
15
+ [ System . ServiceModel . ServiceContractAttribute ( ConfigurationName = "SspiNegoAuthRequireCancelTokenFasle_NS.IService" ) ]
16
+ public interface IService
17
+ {
18
+
19
+ [ System . ServiceModel . OperationContractAttribute ( Action = "http://tempuri.org/IService/GetData" , ReplyAction = "http://tempuri.org/IService/GetDataResponse" ) ]
20
+ System . Threading . Tasks . Task < string > GetDataAsync ( int value ) ;
21
+ }
22
+
23
+ [ System . CodeDom . Compiler . GeneratedCodeAttribute ( "Microsoft.Tools.ServiceModel.Svcutil" , "99.99.99" ) ]
24
+ public interface IServiceChannel : SspiNegoAuthRequireCancelTokenFasle_NS . IService , System . ServiceModel . IClientChannel
25
+ {
26
+ }
27
+
28
+ [ System . Diagnostics . DebuggerStepThroughAttribute ( ) ]
29
+ [ System . CodeDom . Compiler . GeneratedCodeAttribute ( "Microsoft.Tools.ServiceModel.Svcutil" , "99.99.99" ) ]
30
+ public partial class ServiceClient : System . ServiceModel . ClientBase < SspiNegoAuthRequireCancelTokenFasle_NS . IService > , SspiNegoAuthRequireCancelTokenFasle_NS . IService
31
+ {
32
+
33
+ /// <summary>
34
+ /// Implement this partial method to configure the service endpoint.
35
+ /// </summary>
36
+ /// <param name="serviceEndpoint">The endpoint to configure</param>
37
+ /// <param name="clientCredentials">The client credentials</param>
38
+ static partial void ConfigureEndpoint ( System . ServiceModel . Description . ServiceEndpoint serviceEndpoint , System . ServiceModel . Description . ClientCredentials clientCredentials ) ;
39
+
40
+ public ServiceClient ( ) :
41
+ base ( ServiceClient . GetDefaultBinding ( ) , ServiceClient . GetDefaultEndpointAddress ( ) )
42
+ {
43
+ this . Endpoint . Name = EndpointConfiguration . CustomBinding_IService . ToString ( ) ;
44
+ ConfigureEndpoint ( this . Endpoint , this . ClientCredentials ) ;
45
+ }
46
+
47
+ public ServiceClient ( EndpointConfiguration endpointConfiguration ) :
48
+ base ( ServiceClient . GetBindingForEndpoint ( endpointConfiguration ) , ServiceClient . GetEndpointAddress ( endpointConfiguration ) )
49
+ {
50
+ this . Endpoint . Name = endpointConfiguration . ToString ( ) ;
51
+ ConfigureEndpoint ( this . Endpoint , this . ClientCredentials ) ;
52
+ }
53
+
54
+ public ServiceClient ( EndpointConfiguration endpointConfiguration , string remoteAddress ) :
55
+ base ( ServiceClient . GetBindingForEndpoint ( endpointConfiguration ) , new System . ServiceModel . EndpointAddress ( remoteAddress ) )
56
+ {
57
+ this . Endpoint . Name = endpointConfiguration . ToString ( ) ;
58
+ ConfigureEndpoint ( this . Endpoint , this . ClientCredentials ) ;
59
+ }
60
+
61
+ public ServiceClient ( EndpointConfiguration endpointConfiguration , System . ServiceModel . EndpointAddress remoteAddress ) :
62
+ base ( ServiceClient . GetBindingForEndpoint ( endpointConfiguration ) , remoteAddress )
63
+ {
64
+ this . Endpoint . Name = endpointConfiguration . ToString ( ) ;
65
+ ConfigureEndpoint ( this . Endpoint , this . ClientCredentials ) ;
66
+ }
67
+
68
+ public ServiceClient ( System . ServiceModel . Channels . Binding binding , System . ServiceModel . EndpointAddress remoteAddress ) :
69
+ base ( binding , remoteAddress )
70
+ {
71
+ }
72
+
73
+ public System . Threading . Tasks . Task < string > GetDataAsync ( int value )
74
+ {
75
+ return base . Channel . GetDataAsync ( value ) ;
76
+ }
77
+
78
+ public virtual System . Threading . Tasks . Task OpenAsync ( )
79
+ {
80
+ return System . Threading . Tasks . Task . Factory . FromAsync ( ( ( System . ServiceModel . ICommunicationObject ) ( this ) ) . BeginOpen ( null , null ) , new System . Action < System . IAsyncResult > ( ( ( System . ServiceModel . ICommunicationObject ) ( this ) ) . EndOpen ) ) ;
81
+ }
82
+
83
+ #if ! NET6_0_OR_GREATER
84
+ public virtual System . Threading . Tasks . Task CloseAsync ( )
85
+ {
86
+ return System . Threading . Tasks . Task . Factory . FromAsync ( ( ( System . ServiceModel . ICommunicationObject ) ( this ) ) . BeginClose ( null , null ) , new System . Action < System . IAsyncResult > ( ( ( System . ServiceModel . ICommunicationObject ) ( this ) ) . EndClose ) ) ;
87
+ }
88
+ #endif
89
+
90
+ private static System . ServiceModel . Channels . Binding GetBindingForEndpoint ( EndpointConfiguration endpointConfiguration )
91
+ {
92
+ if ( ( endpointConfiguration == EndpointConfiguration . CustomBinding_IService ) )
93
+ {
94
+ System . ServiceModel . Channels . CustomBinding result = new System . ServiceModel . Channels . CustomBinding ( ) ;
95
+ System . ServiceModel . Channels . TransportSecurityBindingElement transportSecurityBindingElement = System . ServiceModel . Channels . SecurityBindingElement . CreateSspiNegotiationOverTransportBindingElement ( false ) ;
96
+ transportSecurityBindingElement . MessageSecurityVersion = System . ServiceModel . MessageSecurityVersion . WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10 ;
97
+ result . Elements . Add ( transportSecurityBindingElement ) ;
98
+ System . ServiceModel . Channels . TextMessageEncodingBindingElement textBindingElement = new System . ServiceModel . Channels . TextMessageEncodingBindingElement ( ) ;
99
+ textBindingElement . MessageVersion = System . ServiceModel . Channels . MessageVersion . CreateVersion ( System . ServiceModel . EnvelopeVersion . Soap11 , System . ServiceModel . Channels . AddressingVersion . WSAddressing10 ) ;
100
+ result . Elements . Add ( textBindingElement ) ;
101
+ result . Elements . Add ( new System . ServiceModel . Channels . WindowsStreamSecurityBindingElement ( ) ) ;
102
+ System . ServiceModel . Channels . TcpTransportBindingElement tcpBindingElement = new System . ServiceModel . Channels . TcpTransportBindingElement ( ) ;
103
+ tcpBindingElement . MaxBufferSize = int . MaxValue ;
104
+ tcpBindingElement . TransferMode = System . ServiceModel . TransferMode . Streamed ;
105
+ tcpBindingElement . MaxReceivedMessageSize = int . MaxValue ;
106
+ result . Elements . Add ( tcpBindingElement ) ;
107
+ return result ;
108
+ }
109
+ throw new System . InvalidOperationException ( string . Format ( "Could not find endpoint with name \' {0}\' ." , endpointConfiguration ) ) ;
110
+ }
111
+
112
+ private static System . ServiceModel . EndpointAddress GetEndpointAddress ( EndpointConfiguration endpointConfiguration )
113
+ {
114
+ if ( ( endpointConfiguration == EndpointConfiguration . CustomBinding_IService ) )
115
+ {
116
+ return new System . ServiceModel . EndpointAddress ( "net.tcp://localhost:8189/Service" ) ;
117
+ }
118
+ throw new System . InvalidOperationException ( string . Format ( "Could not find endpoint with name \' {0}\' ." , endpointConfiguration ) ) ;
119
+ }
120
+
121
+ private static System . ServiceModel . Channels . Binding GetDefaultBinding ( )
122
+ {
123
+ return ServiceClient . GetBindingForEndpoint ( EndpointConfiguration . CustomBinding_IService ) ;
124
+ }
125
+
126
+ private static System . ServiceModel . EndpointAddress GetDefaultEndpointAddress ( )
127
+ {
128
+ return ServiceClient . GetEndpointAddress ( EndpointConfiguration . CustomBinding_IService ) ;
129
+ }
130
+
131
+ public enum EndpointConfiguration
132
+ {
133
+
134
+ CustomBinding_IService ,
135
+ }
136
+ }
137
+ }
0 commit comments