1#if !NETSTANDARD2_0 && !NET5_0
10using System.ServiceModel;
11using System.ServiceModel.Activation;
13using System.Security.Principal;
14using System.Threading.Tasks;
23 [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
24 [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
28#region IWcfPortal Members
34 [OperationBehavior(Impersonation = ImpersonationOption.Allowed)]
53 (IPrincipal)SerializationFormatterFactory.GetFormatter().Deserialize(request.
Principal),
59 var createResponse = await processor.Create(createRequest).ConfigureAwait(
false);
60 if (createResponse.Error !=
null)
62 result.ErrorData =
new WcfErrorInfo(createResponse.Error);
64 result.GlobalContext = SerializationFormatterFactory.GetFormatter().Serialize(createResponse.GlobalContext);
65 result.ObjectData = SerializationFormatterFactory.GetFormatter().Serialize(createResponse.Object);
83 [OperationBehavior(Impersonation = ImpersonationOption.Allowed)]
100 (IPrincipal)SerializationFormatterFactory.GetFormatter().Deserialize(request.
Principal),
106 var fetchResponse = await processor.Fetch(fetchRequest).ConfigureAwait(
false);
107 if (fetchResponse.Error !=
null)
109 result.ErrorData =
new WcfErrorInfo(fetchResponse.Error);
111 result.GlobalContext = SerializationFormatterFactory.GetFormatter().Serialize(fetchResponse.GlobalContext);
112 result.ObjectData = SerializationFormatterFactory.GetFormatter().Serialize(fetchResponse.Object);
129 [OperationBehavior(Impersonation = ImpersonationOption.Allowed)]
142 (IPrincipal)SerializationFormatterFactory.GetFormatter().Deserialize(request.
Principal),
148 var updateResponse = await processor.Update(updateRequest).ConfigureAwait(
false);
149 if (updateResponse.Error !=
null)
151 result.ErrorData =
new WcfErrorInfo(updateResponse.Error);
153 result.GlobalContext = SerializationFormatterFactory.GetFormatter().Serialize(updateResponse.GlobalContext);
154 result.ObjectData = SerializationFormatterFactory.GetFormatter().Serialize(updateResponse.Object);
171 [OperationBehavior(Impersonation = ImpersonationOption.Allowed)]
189 (IPrincipal)SerializationFormatterFactory.GetFormatter().Deserialize(request.
Principal),
195 var deleteResponse = await processor.Delete(deleteRequest).ConfigureAwait(
false);
196 if (deleteResponse.Error !=
null)
198 result.ErrorData =
new WcfErrorInfo(deleteResponse.Error);
200 result.GlobalContext = SerializationFormatterFactory.GetFormatter().Serialize(deleteResponse.GlobalContext);
201 result.ObjectData = SerializationFormatterFactory.GetFormatter().Serialize(deleteResponse.Object);
218 private static object GetCriteria(
byte[] criteriaData)
220 object criteria =
null;
221 if (criteriaData !=
null)
222 criteria = SerializationFormatterFactory.GetFormatter().Deserialize(criteriaData);
228#region Extention Method for Requests
Dictionary type that is serializable with the SerializationFormatterFactory.GetFormatter().
Class used as a wrapper for criteria based requests that use primitives
Message sent to the WCF data portal.
string ClientCulture
Serialized client culture.
string ClientUICulture
Serialized client UI culture.
byte[] Principal
Serialized data for the principal object.
byte[] CriteriaData
Serialized data for the criteria object.
byte[] GlobalContext
Serialized data for the global context object.
string TypeName
Assembly qualified name of the business object type to create.
byte[] ClientContext
Serialized data for the client context object.
Class that will be used to execute a request from a client.
Object that processes all the requests from a client
static void ClearContext()
Clears the application context and current principal.
Class that will be used to execute an Update request from a client.
Message sent to the WCF data portal.
string ClientCulture
Serialized client culture.
string ClientUICulture
Serialized client UI culture.
byte[] Principal
Serialized principal object.
byte[] GlobalContext
Serialized global context object.
byte[] ClientContext
Serialized client context object.
byte[] ObjectData
Serialized object data.
Message containing details about any server-side exception.
Exposes server-side DataPortal functionality through WCF.
async Task< WcfResponse > Delete(CriteriaRequest request)
Delete a business object.
virtual WcfResponse ConvertResponse(WcfResponse response)
Override to convert the response data after it comes back from the network.
async Task< WcfResponse > Fetch(CriteriaRequest request)
Get an existing business object.
virtual CriteriaRequest ConvertRequest(CriteriaRequest request)
Override to convert the request data before it is transferred over the network.
virtual UpdateRequest ConvertRequest(UpdateRequest request)
Override to convert the request data before it is transferred over the network.
async Task< WcfResponse > Update(UpdateRequest request)
Update a business object.
async Task< WcfResponse > Create(CriteriaRequest request)
Create a new business object.
Response message returned from the WCF data portal methods.
Defines the service contract for the WCF data portal.