ASMX services and [Serilizable] tag on Entities/models
-
05 Mart 2012 Pazartesi 08:23
I have a query regarding ASMX webservices. I have worked upon it in 2.0 and also dont have much exposure on the same.
While working with web services I was not required to add [Serilizable] tag to the entity/model that is sent across the network.
- Is it something like the ASMX Webservices have built in serialization?
- If yes, is it required to set the [Serilizable] tag on coressponding Entity/Model for performing serialization?
- If no, then without serialization how data is sent across the network?
Thanks!
Every day its a new learning. Keep Learning!!
If this post answers your question, please click Mark As Answer . If this post is helpful please click Mark as Helpful
Tüm Yanıtlar
-
05 Mart 2012 Pazartesi 13:58Moderatör
The [Serializable] attribute is not used by the XML serialization technology that is used with ASMX web services.
I will presume that you are aware that ASMX web services is a legacy technology and should not be used for new development.
John Saunders
WCF is Web Services. They are not two separate things.
Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
Use File->New Project to create Web Service Projects -
06 Mart 2012 Salı 05:45
I will presume that you are aware that ASMX web services is a legacy technology and should not be used for new development.
Yes, I know the new development is being done on WCF.
But I am still not clear with the points that I have described in my last post.
Can you pls provide some link or suggest some answers to them.
Thanks!
Every day its a new learning. Keep Learning!!
If this post answers your question, please click Mark As Answer . If this post is helpful please click Mark as Helpful -
12 Mart 2012 Pazartesi 16:17Moderatör
The answer is that [Serializable] is not used at all.
What actual problem are you having?
John Saunders
WCF is Web Services. They are not two separate things.
Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
Use File->New Project to create Web Service Projects -
13 Mart 2012 Salı 04:04
Hi John,
Is it like.. ASMX webservices have inbuilt XML serialization feature associated with them?
Thanks for your valuable time and feedback.
Every day its a new learning. Keep Learning!!
If this post answers your question, please click Mark As Answer . If this post is helpful please click Mark as Helpful -
13 Mart 2012 Salı 05:45Moderatör
I don't know that I would call it "inbuilt". ASMX web services use the XML Serializer. This is why [Serializable] is not used - the XML Serializer does not use it.John Saunders
WCF is Web Services. They are not two separate things.
Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
Use File->New Project to create Web Service Projects- Yanıt Olarak İşaretleyen Tiya01 13 Mart 2012 Salı 06:31
-
13 Mart 2012 Salı 06:31
That means [Serializable] is required for other serializers like binary,custom etc.
One more point that keeps me confused.
While using ASMX services I used to send the collection (list) via service to DAL and no serialization code was written.
I dint wrote anything like this
XmlSerializer xmlSerializer = new XmlSerializer(this.GetType()); StringWriter strWriter = new StringWriter(); xmlSerializer.Serialize(strWriter, this); return strWriter.ToString();So is it possible to send data across the n/w with XMLSerialization without using above code?
Thanks.
Every day its a new learning. Keep Learning!!
If this post answers your question, please click Mark As Answer . If this post is helpful please click Mark as Helpful -
13 Mart 2012 Salı 11:56Moderatör
Yes. Just like with WCF, you do not need to write your own serialization when using ASMX web services.
Do remember that you should not be using ASMX services in new development.
John Saunders
WCF is Web Services. They are not two separate things.
Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
Use File->New Project to create Web Service Projects- Yanıt Olarak İşaretleyen Tiya01 13 Mart 2012 Salı 12:12
-
13 Mart 2012 Salı 12:12
Thanks a ton John..
It's clear to me now :)
Every day its a new learning. Keep Learning!!
If this post answers your question, please click Mark As Answer . If this post is helpful please click Mark as Helpful