Reputation:
I'm using C# and I have windows form and web service...
I have a custom object that I want to send to the web service..
sometime, the object may contain a huge of data..
as a best performance, what is the best way to send a custom object to the web service?
Upvotes: 2
Views: 5807
Reputation: 6145
If you are using / plan to use WCF within the network(as opposed to internet), named pipes on WCF is fast and simple. Use primitive types to pass objects. A string xml (although verbose) or a light weight binary object will do.
If it's a wsHttp webservice, use string, I can't think of any other way you would pass a custom object, unless the service knows about it.
Upvotes: 0
Reputation: 95614
Web Services are designed to handle custom objects as long as they eventually breakdown into some standard types. As per sending a huge data, there are MTOM and older DIME. If it's within LAN and against other .NET client, you might want to look into non-Web Services ways like Remoting or plain http.
See How to: Enable a Web Service to Send and Receive Large Amounts of Data.
Upvotes: 2