Wednesday, December 5, 2012

Xử lý ngoại lệ trong dịch vụ web



Service with name “Accounting” have some API as:



  1. Create_Account(string id, string pin,string fullname,datetime createdate)

  2. View_Detail(string id)

  3. Delete_Account(string id) only call by authenticated user with admin permission


----------------------------------------------------------------------------------------------------------------------------

  1. Create webservice

    1. Define all necessary API for it

    2. Using SoapHeader to config using condition of these above API

    3. Using SoapException to raise and handle error on server also at the client

    4. Create webservice client

      1. ASP.Net website as client






i.      AddWebReferrences

ii.      Create object proxy

iii.      Call service API with SoapHeader

iv.      Handle exceptions

  1. Window form as client same as above


http://youtu.be/BEwhsBMHDaM

Xử lý ngoại lệ trong dịch vụ web

No comments:

Post a Comment

Translate