Presenter:Mike Taulty
The DataContract is the standard mechanism in the WCF for serializing .NET object types into XML. This session looks at the various options that DataContract makes available.
The following text is a software generated transcript of the video. Click on a minute link to jump to a location within the video
Minute 0
And to its net nuggets Ash and one in a series of short sessions or antagonisms are looking how we can do things as visual studio net framework minus Mike Tolkien are working the developer and platform group in Microsoft in the UK and is the dataset is one of a series around the Windows communication foundation which are in effect suite of technologies as a distributed application technology hand this ethanol and it is a brief look at Whitley Windows communication foundation how we can control the way that data is represented on the wire and do civilisation using the data contract which is the default mechanism to serialisation Whitley WTF are you doing in visual studio 2005 is in the September technology preview of win effects and whether little too very simple applications via one is there a service and one is a client that both consul applications are
Minute 1
The rest of the downloads in the series is that in a very simple we have a service contract there is called me address service and what we said is that the two operations on this one but the investor personnel director at name and address intestine and get a person s address was a presence name and returns and address and address a defined appeal using data contract and was aimed at an address has has known to the data member and the address on one date manner in which I had an implement of our service we got the person address not really doing anything and get person address just returned some kind of vanilla address everytime we call it are finally using a service hosted in the boilerplate manner by now just to create instances of our service and make them available and of course reconfigured that just to use their HTTP you are
Minute 2
L and a basic binding of a client with an added web reference to the service and then always going in the quietest radiators of the proxy we create one of these addresses set that has mainly addressed line in the court put us an address having done out with ankle get person address and the writer or we get back to the consul in reversing that we can control weird in the day to contract if he can take controls of names theoriginal under up to that actually do we can specify what name would like devices as cool as my address and that set the namespace to beat you end my address calm Anna contains the names of these members as well that strange this to be a mascot house number rather than house names lottery accurate and let s call it
Minute 3
But all the Swan line 1 rather than address and if you had to rebuild our service and has run that I so that we can update a reference over here just he has is down and we cited red if we try to rebuild at this point that require no wonder that no longer builds on the reason why this along the bills is essentially because we should change the name of this address type to be caught my address and similarly revered and you to use that only change the name of the house name to the house number we change the name of the address life one so 30 changes in the server side scheme have affected the clients at proxy because the proxy duly generated from the little document letter to service drives from scheme everything slows
Minute 4
We should be back in business only thing everyone service and we run our client but they re still talking to each other and have a look in tracing folder here is to shut down the service with spot at the trace messages about a mere in heating elements called house number in line 1 and those things come from namespace we can think that he can the 90 17th is Ashley namespace there and that s what examines live to withdrawal names are namespace in the control while what if we had decided on the server side perhaps one line of address information simply isn t enough we
Minute 5
Two lines of address information is a rare and another property you must always address line to am once again will actually this is a day to remember and will call it line to which is patently gone above no true to rebuild this balance fine and what were going to do is not alter the clients of the client is not standing that particular data type that particular message title right now it doesn t know about line to given the service and end a run client with line is that I m still works fine and the service except the message that it gets a some circumstances that is going to be writing in others it s not if address finds it was absolutely vital and we couldn t continue without
Minute 6
There is another parameter here to date and we can specify is required equal is true and if we rebuilt that the violence to stop debugging and rebuild again run a bus service without touching the Clyde and didn t decline we should find is the call from the Finance sales began on the server side were saying that when this address I put here is the serialise we absolutely must have addressed 12 if it doesn t come in when we fail to breaking change to service interface so less go on update the clients are the actually uses address line to really dislike of service your second update the proxy on the client and adjusting their Anglo visit timecode and fill in an online progress line to
Minute 7
And let s also modify this council got right on your story writer he recognized your dress that gets back from the service and it is a service just to make sure that when you return address here that you have something address line to assist building including dealers we can reverse the situation one of her clients to send extra information that the service wasn t necessary expecting to the way we can simulate that is my commenting out the spread of fair plea contract here in the service I am the laws of the con comment at this particular line he resets that address line and if we rebuilt the service without changing the proxy on the client which means that the client is now standing as too much information what happens at the
Minute 8
Where we do that figurehead of the service and debunk the client then alleges that that works very much my profit rises in getting the 30s of address information extracts what happens to that extra bit of information that came from the client of the service and wasn t represented in data contract at the unless it s a specific action extranet is not discarded by the realisation engine the way we can take explicit action is a kinsman I unknown civilisation data if we do that lead to civil Atlanta face here then you consider Sentinel and neither is the property of the on loan civilisation data or would it is just the private member verbal into a class of that time in school that unknown data
Minute 9
And I get operations that are going to return the asset operations run to set it if we know to rebuild and let it slip away content is a lot reluctantly can learn know what s going on to hear what would it is just about right here and run again haven t updated the kind is still selling as more information we really are expecting their money it are great but it was revealed today that inside address we do have some unknown dates only conceal it within their is them the line to elements and various bits is that we can see the list has been captured for a violent serialisation engine and furthermore excessive very very smart if we were to pass this is
Minute 10
Is an address on furthering messaging down at the point where it was recently realised the civilisation and you would have to be smart enough to pull this unknown date back from a greasy realise it to a sense client consent is more information than we need with the news that it s the understand of only seven information back the client will get the full picture again that will remove these bits and go back to where we were watching how we can capture that less uncommon that section and let s not implement interface and were pretty much back to where we were so that should be fine if its rebels and run service and run our client urgently backing working that should make sure that there are no fine now this only has written control within the data contract of the service
Minute 11
We can control the order with which these fields or properties are going to be serialise as with any dependencies between them that might be important to you diverse as we can say the address line to it is going to be serialise first and then perhaps was serialise the house name and am perhaps was serialise address line 1 and a vivid as the separate points over second badger set through great grandson of properties and bills then as it run the client to start there are we noticed that break points around comes through facing legal coming and looking address line to on order zero an adviser of your house and brought one and am going through a looking address line 1 on order to justify dependencies only deserves a default values between the same barely know to control the ordering is quite useful
Minute 12
Any today given further control of Cork into the process and that more deeply than this you can still go and add methods still hook into the whole process of serial as Asian and decent realisation so if you do if you can add methods has had a private method as follows after serialised since they go at context object and if we have to be those with on serialised in this matter will be called when the object has been serialising similarly we can go and take a similar method It is one and change DVD serialised a reactive de serialise and it s not as though she looked in to attribute this there are other members 40 serialising a serialising majority
Minute 13
And through the process is opposed when the process or in done it if you get caught back we can get what call back after these things have actually occurred now this is all grade and but one issue where that is southeast of two of a class of his codeword resulting from another viewpoint which would be starting from a national scheme order with regard to helping of retinal schemas into these data contract that is when I Trotsky Road project and has vinegar over to address service here at the new item of the connector asking and his landlord and that with yet another text editor lets change the names raised at those
Minute 14
A scoreless addressing Tom and that is how original scheme who will not complex I will call this my address type were dismayed that sequence will have an element will call this house name and make it a strange and will have another elements shall call her son address line 1 and may never strained and finally let s say that our scheme as an element name is going to the address site is address five unanswered now we can got out to a
Minute 15
Armed and the use of trawl could be seen exudate contract taxi and with an eye on that scheme that would have created and it will generate code for as a match that scheme to conceive at my address had represented as class and we have a data member that is caught house name and we have another data member of address line while so we ve gone from scheme today to contract by using a PC exe to outside their day contract can t represent a particular moment allows you back to a content attribute and all happen in that case if we were to change something isn t that some of its other simple conflicts type here or go at my tie with attribute and walked within there is just no simple content works than
Minute 16
And strange and will do the ears will add an attribute or call at my attribute I will make it of type string as it then to change house name he is still it wasn t just that mainstream and said it was one of my time with attributes then when you enter me visited the data contract will using that scheme will find that it is an error about this my type of activity doesn t like it and we have a number of choices to what we do about that one of the things we can do is make into to ignore that time is one thing we can do within also tell it to an import that is an XML type on that scheme has just done data and software and video that we still get out of listing what it s done
Minute 17
It is essentially is brought in my thigh attribute but it s just generous by the site code for an implementation of high XML serialise all single and control the civilisation of yourself while still making use of data contracts are the bits of data contract represent their works quite nicely with them civilisation expenses arising as they shall need it and data contract and data member from the bits are actually make transfer for that civilisation for her just to summarise what we do in the short session take a look at data contract and we know as the default civilisation model for the WTF if there is an element centric approach to generating XML we can control names namespace is in control civilisation older or we can specify whether data members are required on and other suddenly began to unknown data and
Minute 18
Not only store up her own use but even in the case will go using at on to somebody else if it ran trickling the data from Austria and other so that we can define it and asking only then will the decent execute life in order to generate data contract code from that to want to deliver here we could also have used the SEC shall we drink the whole whistle document and generates code and again that the generate data contract code for types that can be represented as dirty contracts okay where would you go if you want to get more information on the Windows communication foundation will have expressed the start is theMSDN Microsoft com Fx and if you want to find more information about the protocols that are service open standard protocols of the communication foundation is capable of using a progressive and felt the MSDN Microsoft com Web services and that particularly we have on the site is not understanding that the road
Minute 19
Specifies how all the things that together to make a distribution platforms are posted as a random set of specifications are fine if you want to follow with anything is a little session feel free to drop me an e mail from my address is there on the screen is his and told him Microsoft com other than that I m forever for listening and hope to catch
Click here to go to original video page
Thursday, July 24, 2008
Video: Windows Communication Foundation: DataContract Serialization
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment