Excerpts from Web Service Software Factory: Modeling Edition
- Web Service Architecture
--- Planning for Windows Communication Foundation (WCF)
------ Differences between ASMX and WCF Services
----------
State Management follows:
internal class StateData: IExtension<InstanceContext>
{
public string Identifier = string.Empty;
public string Data = string.Empty;
public StateData( string data )
{
Identifier = Guid.NewGuid().ToString();
Data = data;
}
}
public string AddStateData( string data )
{
StateData state = new StateData( data );
OperationContext.Current.InstanceContext.Extensions.Add(state);
return state.Identifier;
}
public string GetStateData( string identifier )
{
Collection<StateData> dataCollection =
OperationContext.Current.InstanceContext.Extensions.FindAll<StateData>();
string result = string.Empty;
foreach( StateData data in dataCollection )
{
if( data.Identifier == identifier )
{
Result = data.Data;
break;
}
}
return result;
}
- Web Service Architecture
--- Planning for Windows Communication Foundation (WCF)
------ Technical Supplements
----------
ASP.NET Compatibility states the following:
As discussed in Differences Between ASMX and WCF Services, some capabilities can be supported only when using the
ASP.NET Compatibility mode. These capabilities include the following:
Security. With WCF, active control lists (ACLs) cannot be used to restrict access to the file system. In addition, WCF does
not support the use of profiles introduced in ASP.NET 2.0.
State management. WCF provides limited support for state management. Maintaining state in a Web service is not
recommended, but you may be migrating an application that depends on state that is managed by the HttpContext object.