欢迎光临
我们一直在努力

建站超值云服务器,限时71元/月

remoteobjectx

this is a .net service – transactional and poolable object register into the com+ catalog and config as a remoting object. there are attributes for assembly and class necessary for this object configuration in the com+ catalog. the other change, the remote class is derived from the servicedcomponent. this is a standard stuff for the .net service configuration.

using rkiss.remoteobject;    // abstract definitions

[assembly: applicationname("remoteobjectx")]
[assembly: applicationid("026b9e80-6b07-45f0-8ebf-bd35b5d3bb77")]
[assembly: description("remoting com+ test")]
[assembly: applicationactivation(activationoption.library)]        // accepted by beta2
[assembly: applicationaccesscontrol(value = false, authentication = authenticationoption.none)]

namespace rkiss.remoteobjectx
{
   [guid("b19a2ad2-31f2-4c6e-b5a6-24495670be02")]
   [description("remoting object")]
   [objectpooling(enabled=true,minpoolsize=3,maxpoolsize=64)]
   [transaction(transactionoption.required)]
   [constructionenabled(default="server=atz-roman;uid=sa;pwd=;database=logger")]
   [eventtrackingenabled]
   public class rmobjectx : servicedcomponent, irmobject
   {
    …
   }
}

note that object has to run in the com+ library only, thats the limitation of the beta2 and it will be fix it in the rtm version.

remoteobjectws

this is a web service object generated by wizard and modify for the remoting purpose. the following code snippet shows its boilerplate:

using rkiss.remoteobject;    // abstract definitions

namespace remoteobjectws
{
   public class rmobjectws : marshalbyrefobject, irmobject
   {
      public rmobjectws()
      {
        …
      }

      #region component designer generated code
        …
      #endregion

      [webmethod]
      public string echo(string msg)
      {
        …
      }
      // stateless callbacks
      [webmethod]
      public string givemecallback(int timeinsec, string ticketid, object objwire)
      {
        …
      }
   }
}

note that this project has to be unzip and move it into the localhost\remoteobjectws directory in prior of opening the solution.

hostserver
this is a server program to host a remote object. its a very simply console program to perform a configuration of the remote object(s). there are two kinds of options for this configuration as i mentioned earlier. the option 1 is commented.

namespace rkiss.serveractivation
{
   public class server
   {
     public static int main(string [] args)
     {
        try
        {
           /* option 1
           tcpchannel chan = new tcpchannel(12345);
           channelservices.registerchannel(chan);
                    
           remotingconfiguration.registerwellknownservicetype(
                        type.gettype("rkiss.remoteobjecta.rmobjecta, remoteobjecta"),
                        @"remotetest/objecta",
                        wellknownobjectmode.singlecall);
                    
           remotingconfiguration.registerwellknownservicetype(
                        type.gettype("rkiss.remoteobjectx.rmobjectx, remoteobjectx"),
                        @"remotetest/objectx",
                        wellknownobjectmode.singleton);
                
           */
           // option 2
           remotingconfiguration.configure(@"..\..\hostserver.exe.config");
           }
           catch(exception ex)
           {
             system.console.writeline(ex.message);
           }
            
        system.console.writeline("hit <enter> to exit…");
        system.console.readline();
        return 0;
     }
   }
}

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 »
分享到: 更多 (0)

相关推荐

  • 暂无文章