I have code as following:
Public Class xxxSvcHostFactory
Inherits ServiceHostFactory
Protected Overrides Function CreateServiceHost(ByVal serviceType As Type, ByVal baseAddresses As Uri()) As ServiceHost
Dim result As New WebServiceHost2(serviceType, True, baseAddresses)
Return result
End Function
End Class
Service contract is defined as below:
<ServiceContract()>
Public Interface IxxxSvc
<Description("")>
<OperationContract()>
<WebGet(ResponseFormat:=WebMessageFormat.Json,
UriTemplate:="CustomerDetails?id={CustomerId}")>
Function GetCustomerDetails(ByVal CustomerId As String) As Customer
End Interface
Public Class MySvc
Implements IxxxSvc
Public Function GetCustomerDetails(ByVal CustomerId As String) As Customer Implements IxxxSvc.GetCustomerDetails
.
.
.
End Function
End Class
When would CreateServiceHost gets executed?
Is it for every call, or for every transport session, or when the application startsup?
When does the ServiceHost expire?
If I implement static variable it is available through multiple sessions (say from IE and Firefox). How can I maintain static variable for a particular session (say if I access from IE, the same session should not be shared when I access from FF).
I am using WCF REST functionality in my application (core REST and not REST Starter kit). thanks