Presenter:Mike Taulty
This session looks at the SoapExtension extensibility mechanism for ASP.NET Web Services and how we can make use of it.
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
Oh and welcome to the net framework nugget session 1 in a series of short sessions were invited and it just looking at we can do things with the net framework minus m Tolkien I work in the developer and platform group in Microsoft in the UK and in this particular set of going to take a look at how Andy can extend the Hall AFP net Web services framework to use a technology called soap extensions to get full control over what happens in Web services okay so here we are in visual studio net 2003 and ago when service project of use for a lot of the short demonstrations is Ashley and orator Missy and all that is what stirs it has a single operation on here call get employee we didn t identify it reaches into the North database and the employee s fitness in particular looks are a particular employee based on identify and
Minute 1
Past and selects the first and last name and title and we don t go to discos and construct an instance of this employee class which ultimately returns from the method unemployed glass just looks like this appears it has has an very very simply a first and last name in the title that has very little to my work service is also an timestamp ever gone backwards and forwards at the moment is just a hangover from a previous demo here and so really we can ignore that for what were doing right now with a client that hit against a super console application I ve added a web reference to my servers and then the client is contained in senseless proxy and then calls the method to assess the first employee from that table to it as his number one man I ve also got the URL is likely to eat so that we can run the soap traced also 30 runners a moment echo the call across the client on Saturday to the screen and will see that the stroke of combat for the rescue degree and there s less at message and have
Minute 2
Response okay so what do soap expenses givers and this is a scenario which saw something that 10 seconds of callout service in Cormack and looked at her watch of extensions before it wanted to try and illustrate this by using my amazing drawing skills inside a video so ideologically got some kind of client and client is calling to some kind of service which might resign on the server are supposed and is now serving a bigger cake and a kind falling across his sewers if we can draw a line from the client of service do a certificate drawn back a dandelion and a scrape and then essentially the client sends message in this direction and the service so that s all fine and dandy so what s happening down at the client end the client can you get into a proxy and so without proxy some adherents of important text proxy that proxy goes wrong
Minute 3
net object classes unite and serialise interest in on the receiving server side we ve got arrested at their infrastructure essentially and this code here takes XML and turns it back into classes so essentially he serialised in it also has to work out and once is done at the serialisation probably based on the soap action after the HTTP header but also possibly based on just the root element within the XML messages self methods to invoke which which will method on your web server actually wrote so as to work them out over here and a high note that went when the matter that she completed on the side we have to change things back into a thousand letters were to return return value to get here what we need to do is an go from classes backed about an hour ago and serialise that stuff and then finally the XML client where the proxy has the job
Minute 4
Taking action from the service and are about to classes again for the phone so what the service that allows to do well essential are to do is to plug in code that will run here blogging code that will run here plugging total run here and looking to build on here so before other clients are only serialising classes that are now and then there after we serialise classes at Wrexham now than help over the wire to the server side and we can plug in before we turn the XML back into classes and work out which method to invoke and after we can yet another glasses and work out which method to invoke and coming back again as we doesn t assess it and now we can hold him before and after and the comeback of the wire get back to the proxy and again we can look in before and after yet another turn that into classes to say to get eight
Minute 5
Places across interaction diagram we can run code and really take full control over what happens with the soap and the indications stuff so it s really a case of us then you get lower controller of power from doing it having fully exhausted my drawing skills at a visual studio and the disadvantages of coders opposed to the diagrams of vizier so here Advocaat to application servers or a showdown discussed ad in an existing project which invites a certain extent in Ireland as he stole the soap expansion summer from the public Internet all point out quite remember exactly where I got it from plan is that if you have a look at this the way it works is I ve got this extension which does a very basic form of encryption on the XML soap data travels backwards and forwards across the network to whether this is written
Minute 6
Perceive that as yet there is about a cryptography coding and that s really not that that relevant to what we do it sexy what is relevant is that if you want to write a soap extension you start off by the rising from a classical soap extension in case that s easy enough and a few methods that you can invent if you want to read how initialisation works but it is in this particular case we haven t done that and then I am not key to implement is this method down here that you need to override whole process message can undertake to this process message is exactly what we do is illustrate on diagram this method is that he called on the client side to the proxy and on the server side and is going to recall that those stages and we just talked about so both on the proxy site and on the server side this thing will be called before we serialise things aren t from classes that are now after we ve done that before we be serialise from excellent classes and after we ve done
Minute 7
And you can see that each one of those for staging and it is a message and you get to play with it is a little things we can do with this method is currently and callousness on here you can see everything out and that the action we can get hold of things like that particular parameters coming in all browsers going out the return value to get hold of the soap headers we can work out which stayed roughly before after and so on and so forth with the holders stream of data that represents them the message that is coming her way out and we doesn t do things that get hold of the headers and then the method info to this is that United tell you as a message comes in on the service side and it s been deserialise essentially back into classes listed at their other work out which method is going to be invoked and you can go and get hold of that thing he was well snazzy scene which target method is God evoked with the soap is common and classes of parameters that have been deserialise to that point to this gives you a whole ton of power of programme against the best
Minute 8
Is the flying backwards and forwards you can see how particular example here that after we have serialised from classes to use it while we going equipped something and that will happen on this lovely proxy side is a message that proxy it also happened on the service I has a message littered to that and then before we deserialise before we go from excellent classes we decrypt things forget this will happen on the server side as it receives the message was that the proxy side as it was systematic and encrypt and decrypt in here there s no ago be there to mess around with many streams and streams and so on David encrypt invariably decrypting there anything in Monifieth that affords through an system doctor Security cryptography in order to do that work but really that s not sought solace in the soap extensions such as the mechanics of how we make the stuff work here but then so if you have a service to
Minute 9
To build in order to use it you need to go and configure it into the consideration of the applications won t want to use it in this particular case I ve already rebuilt a set of config settings are described to a borrow from here to settle his copies are vertigo first advice service application into its web config and within this web config I ve already have a place holder had to drop a piece of configuring configurations and is described to her remove most of that here because it is a fit character that looks care if we just get that closing down the and you can see the doing of adding a soap extension type which is naming the extensions and the underclass and so on arrival at the class at the class of the assembly and then we can also prioritise and reducing to control when they run the particular to doing something like decryption decryption if a
Minute 10
That it is run as near to the wire as you possibly can so the last thing on the sending side of the first thing on the receiving site that normally what you want to happen time to figure back in here that is to say that config file Wesco visit our Consul application band into its consideration file let s gone out at the sentence information of their so having done that we rigidly to make sure the two projects are all observers console you see this extension on the run respect of the insult was whether they doubt his need to see it a facility to add you wouldn t need to do this undiscovered and a reference to the other project in both of those two projects just to get visual studio to copy a file full services either to drop at commandline so forget it and rebuild and never go ahead and run the application council is run a think and crisscrossing of data which are
Minute 11
And a cigarette trace tool we would should go to see that we can see now that the body of this message across a get employee is encrypted of such an awful advice is still the number one band on the way back that we consider this has been decrypted but notice that full advantage of the person calling the method on proxy and the point who the person like me has been a service that that mattered nothing changes because these things are floating around the net after seeing it as witches by the benefit of it that they don t see what s going on out with all these extensions are running before and after at their respective code to find it if I illustrate what is happening on client and server side let s go back to code you are stranded but the selectors of the extension and we just replace a break point in this process message function very and a lot will do little start debugging the Web service and pay animals start debugging and will also stop
Minute 12
In the council application protector of the Whitsun break points in case of imposing courtesies which particular application here so at the first break point were in the client side and within before serialisation if we run from there was still on the client side now we should be doing after a serialisation that is before we lies on to the wire if we run from here they now were on the server side and we should be doing this for these serialisation are running from their again were on the server side and we are doing after serialisation after deserialisation excuse me is if it did I look at the soap message at this point I have a bit of a look through here we should even go to finding their feet the method information which shows a switch method is about to the invoked and you can see here the declaring type parameters have been worked out
Minute 13
Anthony Method Main as my method is going to get the vote out socially quite funky singles gone that you can happen if we run from here were still on the server side but now the method has been completed were about to serialise to go back to the client again on the server side the message is to be and has now been serialise clients have gripped it in the next process it will be run again were back on the client and the client is now de serialise into this is before it is serialise back to objects we decrypt and finally the client gets its activity serialise as last data processed a debate at on screen to throw around the whole thing there is to house how messages go from client to service and back again and all the stages in a so bit that you can play with as as an assistant at the thought just to summarise what everything in this short session always seen that through the use of soap extra
Minute 14
Derived classes we can take full control over what goes on in that a speed network service pipeline if you like the runs between the call and recall either clients in the service of fanatical than those two things and this is where he do this is through a classical soap extension you to write something from and start writing your own code to do everyone in this particular stuff we looked at encryption but is unlikely never really do that because there s of services standards have been there but many has intraocular compression and various other things and in writing those extensions you get a run in Bonn both the client side web proxy excuse for you the service site resting on executes an anti gay talk in those four stages of processing as classes are changed into XML and that XML is change back into instances of classes to get a replay at at all levels there are a few complete extensibility is interesting to note that things like the wide services enhancements of the
Minute 15
V2 0 and the previously receiving version 1 0 both written as soap extension so even franchisees advanced as was the is is capable of being written in this kind of technology so you ve got a full framework ever expanding SQLNet Web services where can you go to get more information about services well probably the best place to start would be at MSDN developer Santos that s just MSDN Microsoft com web services all one word there s some great stuff up there in the section on the left and cycled understanding of services are some really brilliant articles include air to get a good picture of Oscar nod in this area and if the something is seen specifically in this session only thinking hang on and I want more information on that there feel free to drop him a line and Tolkien Microsoft com has a seven screen their drop a line and I ll drop your response other than that I look forward to hearing seeing you next
Click here to go to original video page
Thursday, July 24, 2008
Video: Working with SOAP extensions in ASP.NET Web Services
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment