Combat. Net data Access Layer-14

Source: Internet
Author: User
Access | Data code 12: Remoting invoke –2,remoting access using the data access logic

Class Customerdal_orm:mydal

{

Please note: This delegate method is restricted to private access

Private ArrayList getallcustomers_remoting_delegate ()

{

ArrayList al = null;



RemoteCustomer remote = (RemoteCustomer) Activator.GetObject (

typeof (Remotingclass.remotecustomer),

Helper.getapplicationsetting ("Remotingurl"));



if (remote = null)

throw new Exception ("Could not locate server!");

Else

{

Al = remote. Getallcustomers ();

}



Return al;

}

}





















































The above two pieces of code should not be difficult to understand, if combined with the previous DAF, we will

You can draw a schematic of this call:







The above code 11,12 (the 1~6 step in the previous illustration) is only a client-side behavior, and

On the server side, we have to do two things:

(1) Establish a host program (if using HTTP+SOAP to simulate webservies, Because this kind of remoting behavior can be directly Host under ASP.net, so this step can be omitted, mainly used in the specified port registration service (once heard from friends, online also someone wrote Remoting Host Manager, Interested comrades can go to CodeProject to check J);

(2) Establish a service class that inherits from MarshalByRefObject, which is used by the host program in step 1 to register the operation;



Next paragraph: http://www.csdn.net/develop/Read_Article.asp?id=27558


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.