1
여러 가지 이유로 내 WCF 서비스 호출 사이에 변수를 저장할 수 있기를 원합니다. 나는 다음과 같은 것을 가지고있다. 그러나 나는 "Single"을 사용하는 것이 정말 나쁜 생각이라는 것을 읽었다. 이것은 실제로 프로토 타입이고 중요한 것은 아니지만 여러 사용자가 있습니다. 단일 사용자가 모든 사용자 세션에서 동일한 변수를 설정한다는 것을 두려워합니다. 누군가 확인/거부 할 수 있습니까? PerSession으로 설정할 때 전혀 작동하지 않습니다. 이는 논리적으로 내가 원하는 것이라고 생각합니다. WCF 영구 vars?
<ServiceContract(Namespace:="")> _
<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)> _
<ServiceBehavior(InstanceContextMode:=ServiceModel.InstanceContextMode.Single, ConcurrencyMode:=ServiceModel.ConcurrencyMode.Single)> _
Public Class MyServices
Public testint As Integer = 0
<WebGet()>
<OperationContract()> _
Public Function test1() As Boolean
testint = 42
return true
End Function
<WebGet()>
<OperationContract()> _
Public Function test2() As Integer
return testint
End Function
End Class
은 내가 "영구"서비스에 대해 뭔가를 읽었지만 VS2010는 나를 InstanceContextMode에 대한 PerCall, PerSession 이와과 싱글을 선택할 수 있습니다.
는