Google Search

Google
 

Thursday, July 24, 2008

Video: Working online/offline with the Offline Block

Presenter:Mike Taulty

Working online/offline with the Offline Block

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

Hello and welcome to the net framework nugget session 1 in a series of short sessions will look at key technologies in and around the net framework my name is Mike Holden and working the developer and platform group at Microsoft in the UK and in this particular certain I want to talk about the smart client offline block so what is this and exactly it s a bunch of code a bunch of samples and a bunch of documentation that you can get from the MSDN practices side so easy tiny missing a total search engine as you type in smart client offline block then you find yourself up here at the MSDN practices site where you can read about the block and you can download the block so it s very easy to find them from financing their so what is it like to see and can do with this well is essentially one of the key features of the smart client application is to be able to work both online and offline unlike a web browser solution to the idea would be that term firstly the application

Minute 1

Detect whether the network is currently connected on and in the absence of a network you can still provide functionality to the user only offline application block that looking at here helps you with providing functionality so provides you with a bunch of code are in a live reform that you can use in order to build this fun chatting to your applications without having to start from scratch now the approach that leads smart client application block takes to working on and offline is very much a service oriented approach this doesn t mean that it s necessarily tied to Web services but it s very service oriented so the offline block models the interaction between the client and some other are backend results as a service oriented interaction and it allows you to program in a service oriented way and programme just one seat programme one way and the block takes care of whether the network is actually there in and does the right thing for you depending on on whether it is on

Minute 2

So as a said when you download this block you get and documentation you get code libraries annual to get South applications and you see how stuff Works but in order to demonstrate to the offline Nokia what I ve done it have taken an existing in a sample application again you can search the summer working fine photo vision very quickly and this allows so this is an application that allows you to manager a library of photographs through one of three acts you get a desktop application Pocket PC application under Web application is one of those taken the source lead the Web application and modified it slightly I have it here in visual studio and is indeed be right here and modified it is likely to include some web service calls which are not used as the basis of my online offline demo so desperate service and that without it here is that she allows us to get photo information upload photos are achieved get hold of thumbnails of photos and

Minute 3

Or so forth from the photo vision applications the rest of this coat was already there and I just add this to the work done is built applying for that makes use of the online offline block so you can see straight away that we ve added references to this application for the smart client offline block so with programming as us astonishingly to provide references and also added some consideration information will look at in a while everywhere this application that we ve written it s very simple land is not as functional as the original photo vision desktop application and quite deliberately but you see the unscreened it is a simple client application and as it moves through these sections of photographs hearing different than she conceivably a thumbnail sketch splayed anomaly click on a particular picture the actual picture gets displayed and was allowed to show here is a

Minute 4

Application currently thinks that the network is connected politically to my machine and disable my network what we were purposes of the application them very quickly shows its networks edited in if we were to go and reconnect that network sites go and just re enable my network connection here then again the application should sense that the network is now reconnected and is the sinister networks that wakes up the application to spot that and I m sure that it s connected again and everybody applications connect so how has this been done from the point of view the code will stop developing and go have a look at the code that facilitates functionality so here it are former figures look at the coastal form you see that we have a former vote and form logos and calls initialise offline blocked noses at the

Minute 5

Up a file that we brought in namespace is forgiving that the offline block if we look at this initialise offline block SPAM function you ll see that what this function built in years firstly it gets hold of the instance of the offline block that this class from the block gives as anything told in an end of variable and to that instance I am it has a property call connection manager which has an event call connection state changed event and you can see it were just thinking about event handler for that event and then restart the block processing he is event handler to stand here so whenever the network the connection state changes were going to get cold on the site event handler here and you can see we get argument of customers which tell us what the current state of the network is so here we check to see whether its online or offline and we set these this text on the status accordingly so checking your network connection state is as simple as that in using the online offline block

Minute 6

What to say that this is comedy or Micro this is probably legitimate I should really be transferring onto the UI thread in order to do this work here I am I I should really do that it s it easy to the demo purpose is not to do it I seem to get away with it but I recommend it case so that only detect the network state that we run the application look at another piece of shutting up an application that is one piece of functionality that of Renate were both online and offline just illustrate how this has functioned so it s actually a what we can do is we can upload a photograph to this application am you select a photograph and upload it and what have those made that functionality works whether we are online or offline select or make ourselves offline again by disabling network connection so the networks they should go back down to disabled disconnected and it does and now let s go and upload photographs so we go and upload a

Minute 7

Pick a photograph and click save now the application straight over to the dialogue is as a way currently working on either networks are not quite sure how long this is going to take and this is my dialogue was he when this comes from and while we re going and any application is sitting there with that request pending but notice that the young deep the UI still can work something out the hunger anything like that and if there was another fun chances we could do her use of a gun use that let s got ourselves back into connected states are once again let s go and them unable that network connection to the network connection comes back the application should realise that that network connection comes back and if it is wafer a second it does go connected and what would be looking to the actor do at this point is to flush through that pending request that we made Walter offline and there are put back to the back end servers coverage is wafer as I can hear then hopefully we will get that time completed

Minute 8

And into the acting combatants and said that the photograph has a deep and uploaded and the UI Versace refresh itself as my back programme here if we has switched backwards and forwards you would see that we have a new photograph here of a frog and then conquest at all sunscreen and he definitely front and then it has indeed been uploaded how does the online sunblock helpers with this well essentially what s nice about the block is that we only programme one way and the block takes care of handling the online offline aspects so added I walked through the code we got thought leading photographs of us will look at the code in the form so when a user clicks upload and what happens as we show that dialogue and they select the information that they need in order to perform the load so name of the father at loading what they want to call it on the server and then the photograph outvoted in and then we go and invoke and g upload photographs on this age and class that we have

Minute 9

Such a look at that that method now upload photographs is interesting because this really is where the heart of the working of the online block and comes content so it here first a notice that this gas agent is derived from the classical service agent which lives within the offline block so this is a base class at the age and get that block gives us the working and then if you re what we do easily checked to see three make an explicit check on the current connection state using the offline block and if there are finally got the message boxes and Hayward currently offline to use others that is what at the second regardless of whether we are online or offline and this is the beauty of the block really regardless of whether we online or offline have one piece of code and what we do fundamentally it is we put some information onto a queue which is managed by the offline block now in a case where the networks connected

Minute 10

The execution will be immediate in the case whether the network is not an active execution will have to wait compared that s why were you thinking anything that is what we got onto that he was a payload and that Halo consists of what we call an online proxy service agent context and some data any conceive that the data is just done the details of the photograph album of photographs and violent this is the data that needs to be used to invoke the back end web servers in the online proxy is essentially and just Klass so here we have a classical online proxy and a method called at the photograph so this is then saying that in the case where the network comes online I want you to create an instance of this online proxy and call that a low photograph method with this payload data and indeed if we discard a slightly legal see and hear is my online proxy class here is its or

Minute 11

Autographed method and here it is receiving payload data any conceive at what it does is it actually unpacks that payload data and it then uses a web service proxy to really make the call and the motor photograph so this is just really grappling at the Web service proxy adequately could be that were not using Web services we could you do anything here it s just a coat to execute only network is actually on my Saddam Hussein would unlock the online proxy with a payload of data but we also have the single the agent context and essentially an whereas the proxy is what to do when the network is online the service agent context of what to do when the work is completed and what we asked for here is that when the work is completed we get called back in a photograph uploaded method and it is either that dies just here and then again it receives a payload checks to see if it was successful as it was difficult at the officials who is also an

Minute 12

Graph is a loaded seat is either be online offline bloc Glam partition is a service implication into the piece of code needed to do it did it to do the service syndication the data that is the past that it code and abuse occurred to be executed when the service syndication is finished it takes us three things and put onto the queue now is important to say that and the queue that we ve got here is driven by configuration is quite a lot of configurations that the online offline block but particularly here were using in a queue which you can see is an inland meat you thought this means is that this cue from the Will survive as long as my application is running so if you were to make her a request while the applications offline and then shut down the application in this case we are to lose their last but the identity online offline bloc also has an as sequel server queue and it has on Amazon and some queue to you but you could just configure that different

Minute 13

To provide a here and purely by configuration you can get your offline service request that he be persisting across implications of the applications it is very flexible very considerable as to how you want it to work okay so went missing on this very short session we ve seen that we can get hold of the offline block it on the code documentation samples quick start to get you going and it provides to gobbets of functionality for as it detects a network presents and saw how that worked out to write code to do that it also manages service implications for us and detects when the network is present and if it is a census the request across the service and if it s not accuse it for us and we talked about how we can configure if on cue is just a minute ago and until the network actually is present in a small functionality in the offline block around providing reference data and keeping that cash for us in again the presence and the absence of network so that the offline block has its own cash that you can put data in

Minute 14

It again is modelled on their son partition service syndication since very similar model to what it showed you but instead of making one call it has to have the block maintain a cash of data for you such my interesting functionality is well said he wanted a more about time this nanotechnology is the smart client developer Centre at Amnesty and Leicester photo vision sample which received little pieces of here of course there s the smart client offline block the best way to find out is by great search engine and typing in smart client offline block and you ll find it very quickly there s the webcast series on Windows forms around building spotlights and Windows forms are fine if you want follow up on the session then feel free to send me mail my e mail address is there on the screen other than that he very much listening

Click here to go to original video page

[+/-] Show Full Post...

Video: Calling Web Services Asynchronously

Presenter:Mike Taulty

Want to invoke a back-end web service without hanging your user interface? Let's look how.

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

Hello and welcome to stop the framework nugget session 1 in a series of short sessions will look interesting and key technologies within the net framework minus m Tolkien and working the developer and platform group in Microsoft in the UK and in this particular certain I want to look at its options around calling back services asynchronously so specifically here a look at how we can do this from a smart client application but the techniques can also apply perhaps from a service application at its ready just around him invoking these services are asynchronously totally straight over into a demonstration over visual studio here this grammar saw some sunscreen space at the solutions of the project I have got a web service that I ve built its called slow service and if we have a look at this is a quick look at the code and it are very simple service it has a single method on a call to get customers just hide that when of

Minute 1

I can as a single method on it or get customers which candidates out and it has goes over to see the server in order to and select all the data from the customers they will Northwind populated dataset and then finally it has a little bit of a nap in that it goes to sleep five seconds before it returns the data back to the yet consumer the corner of the web servers to let my work service I ve also written a client application son of service and you can see that really all this is it is a form nonperformers are a simple data Grid and the button and the hand that but we have the code to go and are firstly clear out the data Grid and having cleared at the data Grid William Garland in greater new instance of service proxy we call the get customers must am proxy want to get the date of setback we bind that the Grid on screen server to run this finality we are doing a synchronous invitation right now then

Minute 2

When the going click the button here you see that my UI is completely unresponsive can t do anything on and try to drag this was former and after the five second sleep or we should find is that the data comes back to us and we get on the screen to them ago and if we do that again then once again after a five second sleep the day to contractors and get it on the screen so clearly Ryanair were not built a very responsive UI so we can make this call asynchronous in order to did other betting life in the use look at how we can do this with Kodak shut down the application shall see a generator went to the Roxy for as and in addition to giving us the simple proxy method but also gives us asynchronous parents for any methods with Web service to what we can do is hysterical and get customers

Minute 3

Week ago begin to customers I noticed that by default what was once a son to take a call back from an American called back to the Midlands and Surrey are north of that and because Paterson asynchronous state across to that court that well right now I m an Arsenal air is well so if we do this then the service request begins but clearly we need also when it finishes on and on that term service regrets will also have an end to get customers and you can see that this will to return the data setback in Swinney to find a place to call this thing but is also because you begin method doesn t return a data set him on a return to single that I asynchronous felt so that I know we d need and I asynchronous felt a scoreless result equals begin to customers in the interesting thing about hyoscine result is that firstly has a placing state on it so this corresponds directly to the second parameter that we have opted to pass on all right now it has an 18

Minute 4

A tampon and we look at this vasectomy can use this to wait to see and when the quality completes and also has this is completed in a property iron which we can use to check out when the caller that he completed so it is this first as a way of checking our work has been done to do here is I m going to take the eye a single result of movement into a private members are adequate result so here without his result like this and at 8 p m the Web service proxy and the fans remember very well to so here perhaps what we do is so rather than initialising us here will discuss this character he is other than and do it that way to regret that at class construction time to visit it now were doing his when we come into as the

Minute 5

Occurred we are just beginning the get customers on vacation and now he s summer to chapter the end of the customers method completed just as examples and whether we can put this code can t let go and add an event handler for application idle event so that s when his farmer s son instructed let s add to the application idle event of new event handler am let s call it down your application idle is fine as it enters visit Odeon leaders with my variables was another term fussy about having to the bottom so do this discourage it will do a fairly basic check was so low if the result is not null so if we think we ve got something in progress and a result is completed then furtive officials are resulted in a last we ve done this cheque and then let s go and is serviced

Minute 6

And get customers we need to pass at the result of your you have a little goes back the data set and we can go back in and by matter of great residues table 0 that if it can do now is done is redeemed the beginning get request here I never ever advocated either 20 checked as it is result outstanding and if it is is it completed and don t want has completed its got to go and get the data has been brought back as the young asynchronous enter that operation that is the Dutch effort to results going on at the same time in as all kinds of things that will cause problems application earns if we split up across okay and if it drunk or get data systems in the fondest and slightly get date on this note is that the UI is now responsive and were waiting for idle time to kick him out many applications idle and we come back and we have to go and do an update that definitely do it again again

Minute 7

Occasion is responding nicely to work Windows event but they are quite where we arrive only get the data back an example that back on screen as one way of doing things and that is certainly what the dangers were checking the completion fire polling and we just borrow the applications idols it to her to do the polling forms of the sensible time we keep coming back and checking to see whether the result is completed on and we could also actually wait for the result of a completed so if rather than doing their swimmer to say the result has singled an asynchronous weight handle and we can wait for that think to be completed and if he completed the return trip so we can go out and do that so rather than checking with solid detective result is not long otherwise would have put that back in their service amaranth must progress is right we are rather keep checking is

Minute 8

Son is completed we are waiting for the result to tell us that it s completed now if we don t do this will hit a slight snag the cards at the point where we go and click get data or fines are you becomes unresponsive to get because what we ve done is gone and blocked the user interface threat in that call to wait one and so we found a thread to come process with adversities and until that call returns and would never be a spot of bother so it made him so badly were originally so that was a very smart move so there are really two solutions to us what we done their one is that when the use wait one here we could specify I m a timespan that were prepared to wait for so we can wave a certain number of milliseconds if I was just about 50 ms there are so five is now have a system science

Minute 9

Answer and average your uncle get they to go to the application s responses at home but in truth it s having 50s with the second polls times in it because we are doing that weight one on its idol Luke and it could be costing as much as 50 ms every time we do it does not really ideal the only real way of getting around that would be to move this call to wait one took time out back out of it then it would really wait for us but we customers that cultivate one onto a separate thread aren t that separate thread with the Galway one to and when that was done with callback onto this further and make everything tire that is not really much point doing that because be existing call to begin get customers and can take a callback parameter if the past that callback ran out of there and that s exactly what is in the frame at looking for is anyway so let s go

Minute 10

That this code where we ve been poling of waiting and let s will add a callback gratitude to dysfunction here Chronicle begin and get customers to what we want are not loved as it is in essence over our title they see callback so lets that artists are called my completion callback to outdo ago and add their member variable to a class called a visibility of tight AC callback and colic completion callback just stick with my variable naming convention are just made up Prozac that so it really do set that some were so perhaps that the construction of the form must remove the application idle Cote d Ivoire allows a completion callback equals new AC callback and pointless act than a function within class of this is going to be on

Minute 11

It very and only to write that function is voted down here private for it on call completed and this will need to receive the night a sink result so now rather than having to store the results and I m apparently funny to think that animals reconstruct away at that point we don t you dismember feral animal and what they can do here is we can to service stocks and get customers with the result that not it was back dataset and then we could can do a data Grid one data source equals Diaz tables are ready for viewing and back this should work for us first rebuild Arsenal had to run this now and then when it hit the button without

Minute 12

Begin and after five seconds I should come back to us and refresh what we have a screen so I guess that s enough about Foreign Secretary in SRU I still respond to fear and that five seconds into a slightly elongated and done something timeless strangers happened on the screen here so what s going on at once this might not be the expected result I certainly know that the doing something bad here I am in code within this customers asking the callback am using this encore completed the problem here is that very similar to what we were just talking about this encore completed routine is actually going to be called on eighth read that is not the user interface thread and user interface controls such as this day degree I ll not supposed

Minute 13

Touched across the road so they have with the thread affinity there created on a particular thread they must only be cut from that thread on which they were created and here I m touching this growth in the wrong thread and is behaving strangely I am done that s really from his side result of of me touching it from the wrong thread to what I did to that is to fix those words of the Windows forms has a mechanism I have a school control invoke so I can call my invoke method on this form and you see that it wants are a delicate invoke and some arguments to pass across somebody need another function to be executed on the UI thread as a postal executing this one so and perhaps we could do is recur down right function call to fight her sector and data stores actually lets be explicit and called on UI thread and got invoke that with an object rates are the object of

Minute 14

A pass across lets pass across to young the data set in train so that s fine but now what we need is then firstly we need at a method to invoke some scoreless handset data source on UI thread and let s passed this datasets and DNS and that dysfunction change the data source on the on the grid so that will be fine the if you can t just put their son indication we can t pass the function then straighten him that she have to provide an instance of a delicate summer to need a delegate type and let s define a delicate time and it went to be avoided delegate let s call the town set data source delegate and if I staggered out into freaking greatness is one of those now that some have set data source delegate

Minute 15

That already equals new set data source delegate and that is the call will be set data assaults on UI thread function but it is a case in right and then it we capacity rather than the other function to what s happening here is that when we come back on the on the completion threat we are gathering the data set great in the US as a delegate and only would want to do this every time we met one of retirement is one and were invoking that delegate on the user interface is read passenger data set across so this function here will be called on the user interface read with the dataset and will do the data binding different compilation found it looks like we did in the round and we now go and invoke we get the data one way far five seconds or so hopeless around the degradable dislocation in the correct way rather than what we got the

Minute 16

Round and the UI is still responsive at this point is just around the data goes back that s thus just run again first indications is that the transitional of service and sequel server and so on and so forth to get it when I get in the the UI is responsive and is doing the right things were not getting spreading issue any more so nothing really anything were not really doing is we re not out of the fact that this call to get customers might actually fail in my throat that an exception as old as all kinds of places were exceptions but there could get thrown here if you want to catch those exceptions to do it and they will be returned for is effectively bicycle and get customers to what we would need to do is this rapper a tribal ground that I catch perhaps at a single exceptional something other and receded do the right thing here are without exception at notice that still here we are on the the coal black thread when

Minute 17

On the user interface that so whilst we can do something like that of a message box we shouldn t interfere with the UI from here we have to go through invoking order to do there a setting that is where we could exception handling if we didn t hear there will be seen in this search short session here we seen that we can do in the case of web services asynchronously within that we got begin and end pattern on the proxy which is just generated for as we look to have little poll from results with to how we could wait for results and an odyssey we saw the long awaited results would need either to wake the limited period of time or would need a separate threat away from results for as Alnwick Castle if they going to go as far as that is probably easy just at a callback it is that we ll end up doing anyway and into the begin their ethical and we also saw how we could do without UI thread issues wreckage of the user interfaces only invoked a single thread through the control invoke method that we saw there is a floodlit threatens is the more

Minute 18

Information on this stuff and there s the Web services developer Centre on MSDN are not likely to be a smart client develops and on MSDN at this article if you search out your favourite ascendant and is at full back Powell and done asynchronous Web services you find a few articles that that s written there at their great articles on on both clients and servers I have done asynchronous Web services are fine if you want to follow directly on what you see here feel free to mail me my addresses are on the slide and other than that thanks very much listening and will see

Click here to go to original video page

[+/-] Show Full Post...

Video: Working with SOAP headers in ASP.NET Web Services

Presenter:Mike Taulty

This session looks at how we can program against SOAP headers from ASP.NET web services

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

Hello and welcome to the net framework and its session 1 in a series of short set and we find it and it is looking at how we can get stuff done with the net framework minus m Tolkien I work in the developer and platform group in Microsoft in the UK and in particular session and take a look at how you can process so papers out when arriving a speed network services with offering a 1 1 philosophical notes of headers around the extensibility that and they carry out of band information about the data that they are in the envelope and we can have as many headers are delightful and that the building of the self employed and processing in one of the former Nugget sessions we built a quick web service and a client I have that same code here so I have a web service if it is going to the code and abyss web service just has some single method Nicholl get employee and it returns on ploidy and it takes and identify with

Minute 1

Uses to index into the employees table in the north wind database and pull out of employees were just using standard radio gone out to get some data and finally rebuild at the instance of this employee class which is at the top of the file just as the first and last name and title a lot of quiet about it at a Consul application which does an indication and print out the data they get back so that I could look at that code and he realised that his activities as a proxy we call the method and pass the first employee in the database and right at the values now if it wanted to add some soap header process into this thing then can do is go back to Web service analyst in a class and Robertson s account and we will call this thing at that sense of information at times let s call this a timestamp header a gate and we can go and ends at that class and were just read his comments were second

Minute 2

As they take up some of my screen and were delivering in system length services protocols and to derive this timestamp header from classical soap header which lives in the framework contract to build a land and build our timestamp header we can put a method on it perhaps what was it it will store and at a time near witches and we are timestamp and we were so timestamp equals that time but now I don t have a public access from here as well as court timestamp and will have skittery inadequate timestamp and will have and set on and with the settlement if it is built header only transmit the two information in this distant request was sent or received from the World Service is not her use of this we need to go back

Minute 3

I won t service and on the Web service glass itself in a few the code we need to add and to add a variable here is closely tied timestamp header and a medical lip so that s where my timestamp gave a republic variable their hour of tight timestamp header and if I want that stands soap header variable or soap header in terms of XML to go backwards and forwards in my message do I need to come to mind wet method and attribute it with a soap header attribute and carry and once again I need to go and bring in that system Web services protocols thatis much spring and here and Kate have just dropped in to coach the second so I put on here and a soap header at Italy to provide the name of the variable I ve already forgotten what I call that my timestamp should get that right my

Minute 4

Timestamp onto this onto this attribute is that tells to make this thing I can also do things like specifying in which direction this header travels so I could say that for instance that this particular head travels in the direction of not having going in and out comes into the method and it was back out of the method gain so I ve added the singer s builder Steve we got that wrong hand He did so hard to get anything right in the first instance which are sometimes articles value than just my mistake and we got that term built now to figure back to the client at this point and updated its Web reference in case you go an update this thing just go to the Intel as a fixer and in the client code now when we make this call across the waves

Minute 5

Decision to populate them on the proxy the timestamp had a value to this is the so telephone across the wire and let s say that equals new timestamp header and notice of the code we wrote on the server side and play has not been transported across the clients if you look at the proxy service is very important to realise that the proxy of the timestamp header you can see just how the public daytime had none of that code of the road has been transmitted because this is just in based on the whistle document and was the document as anything about coded assessment of eczema to everyone to populate this thing we can say might proxy timestamp had a value timestamp equals daytime their and that will then make sure that this property before it serialise as XML to rebuild at this point as to rebuild

Minute 6

Okay go ahead and run the soap trace tool which we can get from these soap Toolkit still download that from amnesty ends with a far new trace listen on port 8080 me direct or 82 tracing their hand is going to ever closer that involves a tool in this situation so what has changed proxy to set its URL to be the local host 88 he asked the service is called anyone that has an axe and strange name for it does build that hand let s run and the messages are as follows like it did before what really hoping to see in the tracing tool AAs that had has been transported for us so noticed that it has and that we went to grass out with a particular types that had and we came back with a particular timestamp header and naturally that is stored in the soap header section of our envelope as opposed

Minute 7

Do so boggy section of our envelope down people we shall fight it was thought that the timestamps going back from services as a Byzantine studies came in as a throwback to the service over the second and unaltered that he went into the service code here and just before we do the return if we change the time stamp had in Kent and rebuild and run again and we should see that we get a service timestamp of the message comes back this times is that the dress messages we got a problem with tracing relatives have another go at that is run through that again back to the tracing death to the sun and you can see that he had traced a time that is going in a subtly different from the trace time on the way back to acid than some satiety processing this request Gazeley Centre I had in both directions what we didn t do was

Minute 8

Check to see whether the header was actually there on I does blithely went ahead and access this heading year and a check to see whether it was coming in on now you ll notice if you look at the documentation for soap header attribute you will see that there is a member that we can set here called required to specify whether a header is required on a vaccine net framework 1 1 this thing doesn t do anything for you again so that is no good going claimed that an better off the remark that it stands if you needed to check for the presence of the header you can always come in here and say okay if my timestamp and is null then the guy hasn t provided the header and you can throw something signed letters of the arbitrary and I can wear original header and then I m not happy as if we rebuild and go back to the client first perhaps and just take off so that the client doesn t let you send a header that s just common lack of effort I can

Minute 9

Decline is no longer sending a header that is run code and we should see that my exceptional service I get serialised as a soap fault comes back to the client retail is an exceptionally conceived the exception just about where was the head of its most resoundingly so that s kind of nice and service can check the headers that is expecting a client did not provide however there s something more important review in soap header processing and that s really more around than one of the client sends you a header that you don t understand that I gave there when we look at soap headers there is a subversion in mechanism is so such that if I send you an envelope with a set of headers in their some of those headers might be really important to me as a centre and some of them might not be and the ones the really important to me I can as he specified that the next person in the chain personally received as a message

Minute 10

Understand the header gave strike if they look I m sending you are heading here you really have to understand that day if you don t understand the header you do not process the message because thing to go seriously wrong so let s quit here and reverse the scenario at the moment we ve got a client not sending a message that had a rather better service requires that switch this around a little things presently work in the first instance must get back to a working scenarios will just take them out and start sending the the header across there again I am the server side would make things a little simpler again so will take at this check so the service is no longer saying that you have to send a header if you send it that s fine if you don t that s fine to do special things work like that before and that so that s great now the interesting thing is if we now reverse as I say the situation or if the client sends

Minute 11

Service header that the service wasn t expecting it really waited to reproduce this essentially a moment we ve got a client which is sending a header so let s go over to the service and make it such that the service is no longer expecting that had so let s take that off at the service does expect that heparin will and will just don t comment out any touching of the header there is one different rebuild at this point and run then the code still works as a kind of okay no problem without the client is now sending ahead of that service does not understand however what if the client now was to say that the particular header is very important and gay and must be understood to the client is no say I m sending you something important don t just ignore this if you don t understand the

Minute 12

You should set me back a fault let s run other finds it at the league client sent ahead and we ve must understand is that the service is not understand it and therefore we ve got back this exception and saying we didn t understand header however if we take a look at this and other bit more detail let s just start another debugging session and this time at all to do but the service allows the butler service and let source of the bug climbed again to a client sends a message to the service notice what is happening here the service code is running short of that may well essentially my service method here is processing a soap message with a header on it as martyrs must understand and the service does not understand the header but it s running the code anyway now my case the code may not really matter because just doing a read if it isn t an update that probably would have is that if we run from here

Minute 13

Method returns will get the exception but in many cases the damages can have already been done the new service is run and it s executed code to this may well normally be not what we want to happen so what can you do in order to get yourself around this well associates the art that provides another good functionality that you can make use of if we go back to our service and what I d do it is over and the service code run at an array to make an array here unknown headers and will call it on loans and care and onto this witness that he what we ll do is add soap powder on loans and can do what we can do that is the net will give to us any headers that we haven t explicitly mentioned in attribute like this and it will populate the unknown headers collection for us so in

Minute 14

Arrested here what we can do we can save each soap unknown header in the unknown is how much have preferred a 50 hour week and say if they had must be understood ago than in our case here we don t have any headers that we understand just at the moment so we ll set they understand to be faults which would actually be the default setting anyway for around headers that aren t explicitly listed up here already setting it is the explicit and what we say is if we get any headers in here that must be understood that we didn t understand that the central issue distrust of an exception now we can only do that explicitly here so we could throw an exception from here or we could do something like sector are blue flag is that so problems day at this point we have a problem and we can say if no problem

Minute 15

Problem then we go GHQ co here and has it to do it that way because when we returned from this method AST that there is going to look at all these stubborn and headers check must understand against it understand and yesterday they don t lineout they started throwing exception for us so if we look at this again in his rebuild will happen this time prosecuting at that server side code again the certificate there set a breakpoint antibody at data were debugging on the service I got on the client side and when we run across the affair notice what happens it has become known we don t have a problem but we go through unknown headers semi final that we didn t understand so now we have a problem we don t execute service code and if we run will still get the exception saying sorry and we didn t understand that header

Minute 16

Does a nice work dealing with unknown headers and literature without execute code run that meant that you just summarise here what was seen in this short session we ve looked at the soap had a class and how we can derive from that and had instances of that thing to Web service glasses and a figurehead is transported backwards and forwards to and from Web services we see how we can also pick up a raise of unknown headers things that we were quite expecting through use of the soap unknown header class and finally to take a look at what we need to do around her dealing with must understand headers and also setting did understand property to say whether week we got the message of that whether we knew what to do where can you go to get more information on Web services well probably the best place to start would be MSDN developer Santos and that s just MSDN Microsoft com and services all one word there is some

Minute 17

It s never there in the section on the left and cycled understanding Web services are some really brilliant articles equally there to get a good picture Anonymous area and if the something is he specifically in this session only thinking hang on an a lot more information on that there feel free to drop him a line and told him Microsoft com has a seven screen their drop I ll drop in response other than that I look forward to hearing seeing you next time a veteran of the Lisney

Click here to go to original video page

[+/-] Show Full Post...

Video: Working with SOAP extensions in ASP.NET Web Services

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

[+/-] Show Full Post...

Video: Anonymous Methods in C# V2.0

Presenter:Mike Taulty

Anonymous Methods in C# V2.0

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

Hello and welcome to the net nugget session 1 in a series of short sessions were reduced in five to 10 minutes looking at key and interesting technologies in net and visual studio minds might Tolkien I work in the developer and platform group at Microsoft UK and in this particular session I want to take a look at the new featuring in version 2 of seashell known as anonymous methods so struck straight away into visual studio 2005 I m using the beta one refresh version that you can get from MSDN subscriber downloads and take a look at this feature so much a visual studio and the visual studio that has taken the project and it here will have a seashell Windows application and just okay that and the Ltd it is on to the application I m going to drag but not to the form that we get to legislate the designer bring about form and then the

Minute 1

Toolbox and will just go ahead and Dragon bar over there and have but now former visual studio lined up nicely for me to get on five and Ascot look at the code saw for this forms and then what am I want to do a want to handle an event of my button so if I wanted to handle button click they re not really what I would do is I would add a new event handler here so let s chorus on button and select our press tab and that makes a method for me in order to handle that done a event that we can do message f Shiro clipped death to the standard thing for run handling an event in net version 1 1 and if you think about what we re doing here then and essentially this is an event click event we ve got here with creating a new instance of a particular delegate

Minute 2

Which in K series event handler with a signing that delegate instanced appointed on button click method and never got write a method that matches the signature of the particular delegate type of using to every time we want to handle an event like this we have to write a specific method in order to do it and which is a bit annoying to have to do never the lot of methods in your class go with anonymous methods in seashell version to making use of new syntax in order to take this dam construction of the delegate here and you method a way so that he do here is so we can use this new syntax and we would like a delegate and we can remove that and sanitation of the delegate type and we can move codes that are handler straight across into this piece of code here so just to show that progress in works such as butterflies or

Minute 3

Run and then there s our form has Barton and Les delegate being been executed so your works exactly like it would if we written the separate method that would have the right separate matter to him or we can just go ahead and done a thought occurred right in line here and if you were of the curious persuasion or perhaps you just plain suspicious new wondering what has happened then than we did that and we can go on Digital light VIIL Danson at December to look at what Saatchi happened inside that net code has been struck down by the sea shall compile and if we got here and look at our class for one you see that it does have let this serve magic method called p__zero down which takes an object and an event after it either looks like an event handler and if you look in the go to this you ll see that inside this magic method

Minute 4

If the code which loads at the Eclipse strained and calls f show studiously is the very code that we wrote about right in line in application to this code here has clearly been lifted out by the seizure and brother into its own method and then you see as well as other vets have then been generated here so and a particular delegate which presumably points are that method has been created for us and when we actually am it stands it into construct you can see that there s some additional work going on here too and the load of the address of that function and then create an instance of a particular event handler and then Paul put that into that member that we just saw that the generated for it as well as it is either that code that we am the road has been

Minute 5

She gets her why she gets run now this clearly is work that you can do yourself you and have done in the past is self that Nancy shall compiler is doing it for you and it is very syntax rather than the average than the whole thing and create a separate method itself and again you might be thinking well that s all fine but what if I needed to get hold of three arguments to this particular delicate time for this particular event type is that we can do that if you want to get hold of beet the arguments here we can get hold of ghetto and then juridical that sender and event aren t a and that s just fine and we can use it inside here so we can still build this code I ve got the excuse will open over his subsequent slowdown in and try and build again as we can build this goes you can see that we can absolutely am a use of the right arguments the particular event type is no problem doing that there and indeed perhaps we can go right here s something I

Minute 6

Khan has do string format and that s right out to send get title something like that just put something on screen from their own run that coaches so you can see that we are in fact accessing that send a variable agency that it was a button and she sent the event which shouldn t really come as any great shelter was at this point and so again you might be thinking well that all sounds scientifically literate and coding what if we have something like our index equals 22 and play and then here we had let s also put something else and two into the stream might have ex equals argument one hand down here will also include ex to this is really quite stress because this Methodist constructor will have finished

Minute 7

Earthers exes value added it preserves a catchy use in a message box that we can hear everyone less code which ability that it works and does exactly what we are expected to do and ever again see some compiler is it is a nice trick for us and if we look once more with Ireland as an account has been generated for is sitting on bring that up again you ll notice that this time the decision at compiler s son can put together in Utrecht so their son has created a whole mass and what users is classed for is to capture the value of their ex variable that were going to use inside delegate code and this time rather than the function for event handler being on form it moved that generated function to this class itself so when it sets up the sun this handler here what is actually going to do is create a new instance of that manufactured type is going to store the value of ex

Minute 8

Net and is going to generate a method on appetite for this code and rather than on the form itself so again if we am just looking to the constructive role forms the work here you see in particular and it creating an instance of that generated type and it s storing the current value of ex into the ex property on that type and so on and so forth so again it s not doing anything that you can do yourself and the beauty of this Israeli that the decision compiler does it for you so just 1 More Place where this kind is that that s really comes into its own in my project I ve added a simple classical customer and if I wanted to build a generic list of customers that I can go ahead and do that select gun make a new generic list of customers and I can add customers to that list so that is a new customer and my customer here just has a name to a scoreless customer and a

Minute 9

And he met a business that you get from that customers of us say that this question it is a hundred pounds of business and let s add another customer who is customer he and they give the thousand pounds of business great customer of ours analyst has an ethanolic all sorts of and if you look at the overload is the sort then one of them takes a comparison function so what we can do here is using anonymous methods I can provide a delegate here that takes to customers and sorts of insights of returning an entity reflecting which one is the bigger time to what we can do here is reading this return seek to block some amount of business taking racy ones and out of business if other comparison functions we have to return less than greater than all or equal to zero depending on which

Minute 10

These objects is actually bigger than the other and if we do that we should only to assist for each customer of not less than just down Russia s message box here so now we should have done everything we have customer enters them either out in the sort of the other way round which is how this this delegate should be sorting them here in the show flat is constantly customer a such an undisclosed special hands for us thought of the code behind the button that you have occurred in the constructing is we can see that only run this week a customer be an immediate customer Mary just a very nice very transparent way of coding up that logic is very clear how this list is being sorted as you can see the coast of the sort right here and I am really nice with

Minute 11

Transparency so what have we seen here in this short session well we seen that anonymous methods or new feature and see sharp version 2 and really what thereabouts is the compiler to his next work for us so that nothing is happening with anonymous methods that we couldn t do otherwise by just typing in the code but the compiler that he shall listen to compiler makes it a lot nicer than it was a virgin one in that it s shot that syntax is doing a little bit more code generation for us and we took a look at than such certainly doing things like handling events would have the talent and is much coated in version 1 so that I didn t think is less code means less bugs but if you want to get more information on this well there s a whole developer centre of Ennis the end of Microsoft com adds visual studio 2005 you could I take a look at how anonymous methods are documented in the see sharp language specification and probably rather than following a link that we got there on the screen

Minute 12

You could just type in see sharp language specification version 2 into your favourite search engine to ensure that will find it for you and they can t follow on a specific success and then feel free to drop me an e mail man addresses there on the screen and other than that

Click here to go to original video page

[+/-] Show Full Post...

Video: The class Designer in Visual Studio 2005

Presenter:Mike Taulty

The class Designer in Visual Studio 2005

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 welcomed as net framework nugget session 1 in a series of short lessons were learnt by the tenant is looking at how we can do things with the net framework minus m Tolkien are working the developer and platform group in Microsoft in the UK and this particular setup today to look at how we can work with a speed of network services and how we can make use mostly all the attributes code to control the XML that throws back the thought of as Web services control the soap messages of the rats of forwards and also some extent control the web service description language the whistle documents they get generated describe us that this is so expressed straight ahead day so here we are in visual studio net 2003 and I ve got a web service project if it is difficult look at it this web service Roger Cork people service and the ideas of his own quick look at is a very simple web service and you see that I ve got one where method called and get people in

Minute 1

It s a parameter that it is that you make any use of the structure is just as the decoration really and only returned into the classical person lest trashy person is the second to get it is the greatly one of those it has an array of people called people and we populate that array and only return the whole person list from the method everything quick that the person lest then essentially you see the person this is a very simple class and business just has an array called people of person objects as we take a look at the person outfit which is just here is it that person has her first name alas nine and an age in case a very very simple classes so if it is a look at what the soap was to look like for that particular indication of the operation of its look at the test patient that Webster is so the one that rested on it just makes for as they can see only one thing such

Minute 2

It which is quite handy and it is lots of messages that look like to invoke that Web service you can see that the service is run to be obviously an envelope the body and I don t have get people the Internet particular namespace will not have p which is readily such string handle and offers elements there so certain that get people is coming directly from his photographers and if they directly from there that element then p is coming directly from parameter name their and if we look at the way the message that comes back looks like again soap envelope were going to get people response would get people result became an emigrant had this list for people with persons of the undertaking very element centric approach to serialise in the XML and again those things come directly from my territory under whether they get people response to get people result and any other name is coming directly from my present class where XML serialised

Minute 3

It is deciding how to serialise then suddenly we have people and then within there we ve got an array of persons but first they must manage slithers them to come from the initiatives that play around this is to look at XML serialisation to forgot that I won t service the discloses files then when it is just excluded this particular person plus from the project and bring a little one that has included a sit within here with the very same class as person and person list of a thin attribute it differently with attributes from the XML civilisationwhich is just that control how they think that is serialise out onto a wire to is what we ve done is a sad person list should be a retail knuckle people we say that this array should be caught persons with an eye to the whole person and within here what we ve done is deserved on the present as herself first name addition

Minute 4

Element coffers lavish theatrical forename laceration in Agincourt last name and age and should be latter because he is struggled out that a different name to aged ages aged with is an better ego so it s aged the years through its rebuild the service and am just refresh test they so we can see that be the request hasn t changed He adds that the strain of the response has changed that is that we still got get people response as my but we ve got an array which has caught people document and that s what people within their we ve got them a rate for persons that is more correct and then we got person and person undertaking an attribute centric approach to serialise with XML this time around so change the way that the XML inside the distant body looks by applying XML serialisation attributes but what is wanted to change investiture over here or it s

Minute 5

The moment is that in putting content into thatwhich is not necessarily will want to weakened off exactly quickly and are looking at how we can change this and I m how we can change what s going on in the request I leave this and it sand also there s naming it he may not be what we want in that request to let a look at those things of the Whiterock Road and radio to the web service itself is time and bring down onto this wetness of the warranties use magical soap document that method can and then onto document metaphor we can say is we can say what the request element names constantly select call the request name my request for want of an adverse event and let s call the response element name my response very much as Bill don t have a quick look

Minute 6

Turned Tesco s refresh that the browser now that he request is coming in as a body with my request and it now has a body on the way back with my response in which he says isas well so we can change this to be a let s say I m requestyou ran for the requests com I must have responseyour own response stock councillor Robert Ashby goes right that her backer of and refresh the page again ac changesis as well as we got wasis there or if I wanted them but I was a bit perverse and I wanted this to be oneand this ancestor being differenthas likened it that was my my people and because I can describe changes XML serialised

Minute 7

To relieve eczema routinely concernedbecause you are an article that my people come to build that refresh and it is now the response document is claiming to be oneand the entire people are part of that document is is going to be another sweeping controller was wanted to change electricity what would we do and what it wanted change in a nifty as the distant backdrop of the second again and look at this method where this p is the front man which supply attributes to parameters and on and return types so we can say here this is that the XML element called them at all on my parameter annotate comes fromcalled you ran my parameter farm and just those of the race is getting a little Hitler to which is added to an attribute at this parameter is rebuilt at that point on the back protestation

Minute 8

Just lost it is grown drunk that spring then we ll see there now we ve got our body with a request parameter and apparent into myadvances cut straight to taking pretty explicit control all of just about everything within the envelope at this point the only thing we haven t done is taking control or of this element he has at the moment what the saying is either we just got this parameter that comes across the network that was rapid after this extra elements within controlling that name them here and so the response of enjoying it here but what if it is wanted at all what if you just want to the soap body that had the parameter in and that was that another response what you would response it has had to return value and that was that no extra element of law will again you can don t control the sling Sophie has gone their play around with this soap document methods are actually hear them a

Minute 9

Can do is we didn t set the parameters style to be a thing course at parameter style I have options of default which is overlooking her and their a figure with there here that s the still factory fresh in the browser to see what that soap envelopes that look like this then we can now see that for the request to have a bodyguard across the wire directly with my parameter in them are not getting any wrapping of that prematurely more and we can all see that on the body that comes back we get our people elements again without any wrapping on that so is taking control of just about everything at this point that occurs within the body of soap afloat so so so well here that term losses or to soak document messages is also so RPC method and actually give more around producing RPC encoded so now that s very out of favour these days and it might be that you need that because your caller is that expecting it if not the chances are you would go the document that was

Minute 10

As that s just the way the industry is gone currently well at RPC method is available there and also that of here we have front soak document service and RPC services while where you can specify an default across the whole service secretly set the parameters are there if he wanted to Andy can also set the routing style acoustic set routing style to be one of the two values request slip action saw that Sony is used to soak out an HTTP header to route the message to one of these particular methods or use the name of the request government to route to route the message to Swansea s particular methods so you can choose which runs as wrong as said you can also specify parameters style up here and across the service is opposed specifying on a permanent basis and again as a soap RPC service as well so you want to do obviously took it out on appear another use it got if the soap

Minute 11

Metadata route is that included the method onto a web service that schools do something and that s just the wet method on written bill that am take a look at the whistle document for it then worked in the whistle document is that strangely even though this method which is built to take over letters and returns and a return result you would see the day whistle contains a message for do something so out account Pacific and a message and do something so being uncaring is interesting and if we had a look at Dion the actual operation itself do something on this port type you notice it do something so that its input message and returns that passage of those diktats would result a way because we don t return anything from method and that is what happens if we don t say that explicit by using soap document method here are having one way on this is a

Minute 12

My operation and I m not going to return anything back to you as a builder that vertical refresh that little document or we should say is that it is cluttered than that though it kept what you see is anybody there do something so thin there is no to something so out of a collaboration you see that it is something I just has an input message and no output message and this is a useful thing to do if you ve got services only on that it is taking it and not returning anything out whether you roughly have those this is another question if you could have stuff that that s very subtle is one where it on because you were still reflects the decline doesn t have to wait from that it is not like to tell any information greatly so whether that is there is a took other athletes just to finish at the first whiff of missing out a vulture should really fun in ages ago is just a service after his appearance as a skipper or service her name article people service it lets you give us his name space on your and people service

Minute 13

Arm and the description on there as well this is a great service and if we did go builder sends out and look at the wistful document legacy that we might affect the target noticeable stuffiness was the document to be my people service com without documentation about service and it s a great service and evening service director and a cigarette out on a split with Harry especially for setting theenough from the crucial use of that particular attribute it so does the completeness will top that one must actually do we got here and that s the own web service binding attributes of the code of the moment we ve got to get people and we ve got do something that is that we don t do something to something warrant descriptors and is other than shall not make this a one way I will call their son let s have this returning to a chorus of her get bank balance do so at the we ve got some affair leaves of disparate set of methods who we forget

Minute 14

Always got to get bank balance and didn t really Marriot very well on this particular service is reckoned it was out in news three Web service binding attribute to a server of service binding and create two bindings this red service which is essentially going to give me one service with two different port types I remember living with Laporta s kind of like a common interface so what type has a bunch of operations on to have one service with any number of port types which means any number of interfaces if you like into that service so well in azaleas and will have a binding this is only my local is my people interface just want a better word and I will give it ayour own people interface decay and will have another one and this is grossly right bank interface and again your own

Minute 15

Bank interface to some very realistic but so this illustrates that the difference in two as a now do as I can move this particular operation here onto one of those bindings are put this on to my people interface back I m going to put the get bank balance onto my bank interface this to a radical bank interface added that if we build at this point always if the project was still further so much so such as that other group that little other is in essence this has now been partitioned so that the service description take local account is actually so want to talk people service a bad name at this point but that is the service now has two ports it has a Portugal bank interface and has a book or people interface supports the kind of like interfaces so one

Minute 16

We do what we wanted there and then out to the whole whistle document is split for a snack likely to be up there and you can see that turn the bank interface now has a separate little document to figures from face that in their okay then what was says that this guide describes the bank interface and the operation of the bank interface is set to get the bank balance of the messages that are thought to that and if we asked the league but people interface notice of us was all too obvious to forget about us was to hear they has it that this guy describes the people interface and his people interface their forget the corporation s answer for we ve now got I am one main whistle document describes service with two interfaces an average of those interfaces we go a separate chunk of visible

Minute 17

The messages and physical battles were fought so by doing that in binding this is really more of as an advanced topic but by doing that binding about Web services a code with this Western is binding will essentially be able to offer two interfaces from one service a fax report I can answer that the decidedly aware of that you can do that if you get to that that staging a new World Service developer just to summarise what have we seen in the short Sutton one Derek and other Web servers are knitted dress ready XML got serialise without an civilisation selection root XML elements et al attribute until we then looked at how we could flavour the sofa little bit and we look to how we could mostly look at soap document v soap RPC method is not so prevalent he says with a faith is so document acid and we could do things like throwing the request of the responseis an unnamed and Harry to chase a parody style and was one way method and so on

Minute 18

We looked at how we could set them the web service after these of the service itself for some simple things and was full like the name of the service the description of the service and theis used was the ultimate and finally we looked at that binding actually went since binding how we could use that to create multiple ports at the single service giving is effectively a couple into faces off on service where can you go to get more information about services well probably the best most starkly than MSDN developer Centre so that stiffeners the end that Microsoft com web services all one word there s some great stuff at there in the section on the left and cycle understanding Web services are some really good in articles equally there to get a good picture of what s gone on in this area and if the something is seen specifically in this session only thinking home an hour s more information on that there feel free to drop me an airline and told him Microsoft com has a seven screen their drop me a line and I ll got you response

Minute 19

Columnar and look forward to hearing seeing you next time as a

Click here to go to original video page

[+/-] Show Full Post...