Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8083879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:37:00+00:00 2026-06-05T17:37:00+00:00

I have the following ServiceContract: [ServiceContract(Namespace = http://WebAdmin.Services.AdministrativeService, Name = AdministrativeService)] public interface IAdministrativeService

  • 0

I have the following ServiceContract:

[ServiceContract(Namespace = "http://WebAdmin.Services.AdministrativeService", Name = "AdministrativeService")]
public interface IAdministrativeService
{
    /// <summary>
    /// Add the group based on the provided criteria 
    /// </summary>
    /// <example>
    /// <code>
    ///     service.AddWebGroup
    ///             (new User   {
    ///                             SequenceNumber = 1,
    ///                         },
    ///              new Group 
    ///                         {
    ///                             GroupName = "Example Group"
    ///                         },
    ///             new Application
    ///                         { 
    ///                             ApplicationCode = "DS"
    ///                         }
    ///             );
    /// </code>
    /// </example>
    /// <param name="webUser"><see cref="WebUser"/>The user a</param>
    /// <param name="group"><see cref="Group"/></param>
    /// <param name="application"><see cref="Application"/></param>
    /// <returns><see cref="Group"/></returns>
    [OperationContract]
    [TransactionFlow(TransactionFlowOption.Mandatory)]
    [FaultContract(typeof(ErrorFault))]
    [PrincipalPermission(SecurityAction.Demand, Role = "WEB_ADMIN_SVC")]
    Group AddWebGroup(WebUser webUser, Group group, Application application);

}

With the following DataContracts:

[DataContract]
public class WebUser
{
    [DataMember]
    public long? SequenceNumber { get; set; }

    [DataMember]
    public List<UserRole> Roles { get; set; }
}

    [DataContract]
public class UserRole
{
    [DataMember]
    public long? RoleID { get; set; }
    [DataMember]
    public string Name { get; set; }
    [DataMember]
    public Application Application { get; set; }
    [DataMember]
    public Group Group { get; set; }
}
{
[DataContract]
public class Application
{
    [DataMember]
    public string ApplicationCode { get; set; }
    [DataMember]
    public string ApplicationName { get; set; }
    [DataMember]
    public string ContactEmailAddress { get; set; }
    [DataMember]
    public string DivisionCode { get; set; }
}
[DataContract]
public class Group
{
    [DataMember]
    public long? GroupID { get; set; }
    [DataMember]
    public string GroupName { get; set; }
}

With the following implementation:

    [ServiceBehavior(
ConcurrencyMode = ConcurrencyMode.Single,
InstanceContextMode = InstanceContextMode.PerSession,
ReleaseServiceInstanceOnTransactionComplete = false,
TransactionIsolationLevel = System.Transactions.IsolationLevel.Serializable
)]
public class AdministrativeService : ServiceBase, IAdministrativeService
{
    #region Implementation of IAdministrativeService

    /// <summary>
    /// Add the group based on the provided criteria 
    /// </summary>
    /// <example>
    /// <code>
    ///     service.AddWebGroup
    ///             (new User   {
    ///                             SequenceNumber = 1,
    ///                         },
    ///              new Group 
    ///                         {
    ///                             GroupName = "Example Group"
    ///                         },
    ///             new Application
    ///                         { 
    ///                             ApplicationCode = "DS"
    ///                         }
    ///             );
    /// </code>
    /// </example>
    /// <param name="webUser"><see cref="WebUser"/>The user adding the group</param>
    /// <param name="group"><see cref="Group"/>The Group being added</param>
    /// <param name="application"><see cref="Application"/>The associated application</param>
    /// <returns><see cref="Group"/> With the ID set</returns>
    [OperationBehavior(TransactionAutoComplete = true, TransactionScopeRequired = true)]
    public Group AddWebGroup(WebUser webUser, Group group, Application application)
    {
        if (webUser == null)
            throw new ArgumentException("user");
        if (webUser.SequenceNumber == long.MinValue)
            throw new ArgumentException("user sequence number");

        if (group == null || string.IsNullOrWhiteSpace(group.GroupName))
            throw new ArgumentNullException("group");
       if (application == null || string.IsNullOrWhiteSpace(application.ApplicationCode))
            throw new ArgumentException("application");


        var service = Resolve<IWebGroupService>();

        var criteria = new GroupCriteriaEntity
                           {
                               ApplicationCode = application.ApplicationCode,
                               Group = new GroupEntity{GroupName = group.GroupName,},
                               User = new UserEntity{SequenceNumber = webUser.SequenceNumber,}
                           };
        GroupEntity result = null;
        try
        {
            result = service.InsertWebGroup(criteria);
        }
        catch (Exception ex)
        {
            ex.Data.Add("result",criteria);
            ExceptionPolicy.HandleException(ex, "Service Policy");
        }
        var groupResult = new Group
        {
            GroupID = result.SequenceNumber
        };

        return groupResult;

    }

The service model binding is using wsHttpBinding with TransportMessageCredential…

All of this excellent stuff works in a dev environment. Transactions commit and roll back as expected. The user credentials allow and prevent the user from executing the codes and all in all everyone is happy happy happy.

The test environment is supposed to be an identical setup as the dev environment. However, when the proxy client invokes the service I get the following exception:

HandlingInstanceID: 44a7c5ae-17fc-4d14-b55e-1aa53bb156e0

An exception of type ‘System.ArgumentException’ occurred and was caught.

06/13/2012 15:39:11
Type : System.ArgumentException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Argument passed in is not serializable.
Parameter name: value
Source : mscorlib
Help link :
ParamName : value
Data : System.Collections.ListDictionaryInternal
TargetSite : Void Add(System.Object, System.Object)
Stack Trace : at System.Collections.ListDictionaryInternal.Add(Object key, Object value)
at Administrative.Service.AdministrativeService.AddWebGroup(WebUser webUser, Group group, Application application)
at SyncInvokeAddWebGroup(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

Any ideas on why this would occur on one machine but not another? Why would I be getting an error that I am passing a non-serializable object when all objects are being passed are objects gnerated in the proxy client and are tagged with DataContract?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T17:37:02+00:00Added an answer on June 5, 2026 at 5:37 pm

    It looks like the exception is happening at the exception handler where you do: ex.Data.Add("result",criteria);, but I don’t see in your data contracts (the ones you showed) where GroupCriteriaEntity is defined, is that one also serializable?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following: [ServiceContract] [ServiceKnownType(typeof(ActionParameters))] [ServiceKnownType(typeof(SportProgram))] [ServiceKnownType(typeof(ActionResult<SportProgram>))] public interface ISportProgramBl { [OperationContract] IActionResult<ISportProgram>
I have defined the following Interface [ServiceContract] public interface IHealthProducts { [OperationContract()] ResponseClass OrderSelfSignedHealthCertificate();
I have the following web service function- [ServiceContract] public interface ITest { [OperationContract] double
I have a WCF webservice that has the following service contract [ServiceContract(Namespace = http://example.org)]
I have following plist: <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd>
I have a ServiceContract on the server like this: [ServiceContract] public interface ICheckService {
Imagine I have the following, standard WCF, code : [ServiceContract] interface ICustomerService { [OperationContract]
please check the below example namespace GServices { [ServiceKnownType(typeof(SearchType))] [ServiceContract(SessionMode = SessionMode.Allowed)] public interface
I have defined the following interface in F# [<ServiceContract>] type ICarRentalService = [<OperationContract>] abstract
I have a ServiceContract which returns dynamic type and looks like following: public dynamic

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.