Web Services 8

405 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
405
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Web Services 8

  1. 1. VIII Call a remoting method. Call a remoting method asynchronously. Use events with remote objects. 1. 2. 3. A ) B ) Use a delegate to invoke a remoting method. 1. Check the state of completion and respond. 2. C ) Wire a Client to listen for remote events. 1. Method Invocations and Event Management with .NET Remoting
  2. 2. Complex to program. Easy-to-create and deploy. Ease-of-Programming Very extensible by allowing us to customize the different components of the .NET remoting framework. Provides extensibility by allowing us to intercept the SOAP messages during the serialization and de- serialization stages. Extensibility Can also take advantage of IIS for fault isolation. If IIS is not used, application needs to provide plumbing for ensuring the reliability of the application. Highly reliable , since it’s always hosted on IIS. Reliability Homogenous environment. Heterogeneous environments. Interoperability Using binary communication, .NET Remoting can provide support for rich type system Supports the data types defined in the XSD type system. Type System Stateful(Singleton), Stateless(SingleCall) Stateless Environment State Management TCP, HTTP, SMTP & etc HTTP Protocol .NET Remoting ASP.NET Web Services
  3. 3. A simple 3-tier architecture
  4. 4. An n-tier architecture using ASP.NET
  5. 5. An n-tier architecture using Enterprise Services (COM+)
  6. 6. <ul><li>The server must be contacted each time ; when a remote method is called . </li></ul>2) The developer cannot know at the time of invocation whether or not the method will complete successfully. 3) Remoting methods involve network traffic. Calling Remote Methods
  7. 7. Stateless Invocation Using One-Way Calls <ul><li>Namespace : </li></ul><ul><li>System.Runtime.Remoting.Messaging </li></ul><ul><li>Attribute : </li></ul><ul><li>One-Way </li></ul>The OneWay attribute can be used to provide fire and forget functionality.
  8. 8. Remote Methods -- Synchronous Potential Problems with Synchronous methods 1) Might end in an ERROR. 2) Might complete successfully , but take a long time to complete. 3) Waiting for each call to complete individually is potentially wasteful.
  9. 9. Delegates Objects which points towards a function which matches its signature. Its reference type used to encapsulate a method with a specific signature. Similar to function pointers in C++.
  10. 11. <ul><li>By creating a delegate with a matching signature, any method can be invoked by calling the delegate’s BeginInvoke method. </li></ul><ul><li>To use a delegate object to invoke a method, the delegate’s signature must match the signature of any method it will be used to invoke. </li></ul><ul><li>A delegate can be used to invoke different methods, but each method must have a matching return type and a matching parameter list. </li></ul>More About Delegates
  11. 12. Asynchronous An invocation that does not block processing from occurring (an asynchronous call does not block execution of the program while processing occurs). Synchronous A way to call a method that happens sequentially, in the order in which the method was called. If your program calls method A and then calls method B, method B is not called until method A returns. Callback An object that is sent to a method that will notify the caller when processing has completed. One-way Mechanism that allows client-side processing to continue irrespective of anything that happens on the server. Remote method A method that processes on a machine different from the one that called it. Fire and forget Initiating a call to a method and not retrieving any results back from it, even if the method throws an exception.
  12. 13. Asynchronous Invocation IAsyncResult object IsCompleted property

×