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

  • Home
  • SEARCH
  • 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 9201001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:54:00+00:00 2026-06-17T22:54:00+00:00

How can I pass an entire defined class through a WCF service? I have

  • 0

How can I pass an entire defined class through a WCF service? I have the class defined on both the service and client side. I keep getting an error:

Best overloaded method match has some invalid arguments.

The whole class was copied from the client-side to the service-side.

Client side calling:

TransferProxy.PutTransferOnService(Transfer);

Defined on service:

[OperationContract]
bool PutTransferOnService(TypeTransfer Transfer);

I don’t want to access individual items on the class from the client, I just want to move the WHOLE populated object through and do processing on the server side.

    [DataContract]
    public class TypeTransfer
    {

        private string userID;
        private string transferNum;
        private DateTime effectiveDate;
        private int unitCount;
        private int skuCount;
        private string reason;
        private string localStatus;
        private string destStatus;
        private string carrier;
        private string sourceStore;
        private string destinationStore;
        private string inSeal;
        private string outSeal;

        [DataMember]
        private List<TypeSOQ> correspondingSOQ = new List<TypeSOQ>();

        [DataMember]
        private List<TypeProductList> ProductList = new List<TypeProductList>();


        public TypeTransfer() { }

        // Function adds single item to transfer object
        public void AddItem(int ProductID, string SKU, string PrimarySKU, string SCC, string ProductDescription, int TransferQty)
        {
            ProductList.Add(new TypeProductList
            {
                productID = ProductID,
                sku = SKU,
                primaryUPC = PrimarySKU,
                scc = SCC,
                description = ProductDescription,
                transferQty = TransferQty
            });
        }

        // Add SOQ to transfer object (can support multiple SOQ's)        
        public void AddSOQ(TypeSOQ soq)
        {
            correspondingSOQ.Add(soq);
        }

        // Function returns number of skus in Product List        
        public int GetSKUTotal()
        {
            return ProductList.Count();
        }

        // Function returns total number of items in transfer
        public int GetItemTotal()
        {
            int itemtotal = 0;
            for (int i = 0; i < ProductList.Count(); i++)
            {
                itemtotal += ProductList[i].transferQty;
            }
            return itemtotal;

        }

        // Return entire SOQ list        
        public List<TypeSOQ> GetSOQs()
        {
            return correspondingSOQ;
        }

        // Returns full product list in transfer object        
        public List<TypeProductList> GetProductList()
        {
            return ProductList;
        }

        [DataMember]
        public string UserID
        {
            get { return userID; }
            set { userID = value; }
        }
        [DataMember]
        public string TransferNum
        {
            get { return transferNum; }
            set { transferNum = value; }
        }
        [DataMember]
        public DateTime EffectiveDate
        {
            get { return effectiveDate; }
            set { effectiveDate = value; }
        }
        [DataMember]
        public int UnitCount
        {
            get { return unitCount; }
            set { unitCount = value; }
        }
        [DataMember]
        public string Reason
        {
            get { return reason; }
            set { reason = value; }
        }
        [DataMember]
        public string LocalStatus
        {
            get { return localStatus; }
            set { localStatus = value; }
        }
        [DataMember]
        public string DestStatus
        {
            get { return destStatus; }
            set { destStatus = value; }
        }
        [DataMember]
        public string Carrier
        {
            get { return carrier; }
            set { carrier = value; }
        }
        [DataMember]
        public string SourceStore
        {
            get { return sourceStore; }
            set { sourceStore = value; }
        }
        [DataMember]
        public string DestStore
        {
            get { return destinationStore; }
            set { destinationStore = value; }
        }
        [DataMember]
        public string InSeal
        {
            get { return inSeal; }
            set { inSeal = value; }
        }
        [DataMember]
        public string OutSeal
        {
            get { return outSeal; }
            set { outSeal = value; }
        }
        [DataMember]
        public int SKUCount
        {
            get { return skuCount; }
            set { skuCount = value; }
        }

    }
  • 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-17T22:54:01+00:00Added an answer on June 17, 2026 at 10:54 pm

    You said – The whole class was copied from the client-side to the service-side.

    You don’t need to copy your class to server side. just define your class in a separate library and give reference of that same library to both client and server.

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

Sidebar

Related Questions

If I have a auto_ptr I can pass it for a reference?Like: auto_ptr<MyClass>Class(new MyClass);
In JQuery, how we can pass entire $(this) to a functions? Possible?
Can i pass the entire POST array into a function and handle it within
You can pass special strings into jQuery's Datepicker class setDate() method like +7 which
I know you can pass arguments through the RunWorkerAsync function call when you first
Is there any way that I can pass arguments in selector? example: I have
I have a class Message that has a std::string as a data member, defined
I want to pass a struct array into a function and I keep getting
I was going through Facebook's authentication mechanism. and understood the client side, server side
How can I pass an entire array to a method? private void PassArray() {

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.