Remoting problem when hosting in public IIS


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Remoting problem when hosting in public IIS

  1. #1
    Join Date
    Mar 2007
    Posts
    2

    Unhappy Remoting problem when hosting in public IIS

    Hello,
    I am struggling with .net remoting for two weeks.i need some one's help very badly please.Ill describe my problem.
    I am in developing a chat server in remoting.I devloped it with basic funtionalities.i hosted server as windows service and in IIS.both worked perfectly in my LAN.Now with that confidence i tried to host my server in a public server. Now my app is not working as am expected.

    I will paste the code here am using in Application_start method in global.cs in hosted web application.


    HttpChannel chnl;
    SoapServerFormatterSinkProvider ServProv=new SoapServerFormatterSinkProvider();

    ServProv.TypeFilterLevel=System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
    SoapClientFormatterSinkProvider ClientProv=new SoapClientFormatterSinkProvider();

    IDictionary props=new Hashtable();
    props["port"]=1234;
    props["name"]="abc";
    props["typeFilterLevel"] = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
    chnl=new HttpChannel(props,ClientProv,ServProv);
    ChannelServices.RegisterChannel(chnl);

    RemotingConfiguration.RegisterWellKnownServiceType(typeof(Remoting.Remotableobject),"Remot ableobject.soap",WellKnownObjectMode.Singleton);

    //Code in my windows app to connect to server

    string server=@"http://www.sumesh.somee.com:1234/Remotableobject.soap";
    IDictionary props=new Hashtable();
    SoapServerFormatterSinkProvider serv=new SoapServerFormatterSinkProvider();
    SoapClientFormatterSinkProvider cl=new SoapClientFormatterSinkProvider();
    serv.TypeFilterLevel=System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
    props["typeFilterLevel"] = TypeFilterLevel.Full;
    props["name"]="abc";
    props["port"]=0;
    chnl=new HttpChannel(props,cl,serv);
    ChannelServices.RegisterChannel(chnl);

    rem= (Remoting.Remotableobject) Activator.GetObject(typeof(Remoting.Remotableobject),server);

    MessageBox.Show(rem.checkConnectivity());//returns ip address of server
    rem.eventRxText+=new ReceieveText(callback.rem_eventRxText);
    rem.eventGtUsers+=new getusers(callback.rem_eventGtUsers);
    rem.TestEvent+=new Testdel(callback.rem_TestEvent);



    If i run my client app ill get a connection time out exceptionwhen at this code statement
    MessageBox.Show(rem.checkConnectivity());
    Now if i replace
    string server=@"http://www.sumesh.somee.com:1234/Remotableobject.soap";with
    string server=@"http://www.sumesh.somee.com/Remotableobject.soap";
    I will get the ip address from
    MessageBox.Show(rem.checkConnectivity());
    but at next statement, that is
    rem.eventRxText+=new ReceieveText(callback.rem_eventRxText); i get exception
    Type System.DelegateSerializationHolder and the types derived from it (such as System.DelegateSerializationHolder) are not permitted to be deserialized at this security level.

    now again if comment the line props["port"]=1234; on server and run the client with the url
    string server=@"http://www.sumesh.somee.com/Remotableobject.soap";
    ill get NO error on these four statements
    MessageBox.Show(rem.checkConnectivity());
    rem.eventRxText+=new ReceieveText(callback.rem_eventRxText);
    rem.eventGtUsers+=new getusers(callback.rem_eventGtUsers);
    rem.TestEvent+=new Testdel(callback.rem_TestEvent);

    but when i call a method in remote object, say
    rem.login(username,pass) which contains firing of an event, that is like this

    //this is in remoteobject
    public bool login(string uname,string pwd)
    {
    currentusers.Add(uname);
    TestEvent();
    return true;
    }

    An exception is thrown here on statement
    TestEvent();
    that is:object reference not set to an instance of an object

    The thing is that the same remoteobject without any change in code will work perfectly if i host my server in my local IIS with setting port number on server and using this url on client
    "http://localhost:1234/Remotableobject.soap"

    but sometimes here also i get the error
    object reference not set to an instance of an object while firnig event in remote object.


    can anybody help me on this please??

  2. #2
    Join Date
    Mar 2007
    Posts
    2

    working randomnly..

    hi
    i tried the same application without any change from my home..for my surprise its working randomnly.the event is firing without fail.sometimes it is showing the same error as i satated above..what could be the problem..do i need to change server?or something is blocking it to work from my office?

Similar Threads

  1. Replies: 0
    Last Post: 09-21-2006, 09:19 AM
  2. Java RMI Client AccessControlException
    By ally153 in forum Java
    Replies: 1
    Last Post: 03-27-2006, 09:00 AM
  3. Change NT service config (disabled -> enabled)
    By pavel in forum VB Classic
    Replies: 0
    Last Post: 10-17-2001, 09:06 PM
  4. Problems with NetAddUser
    By Jeff Morgan in forum VB Classic
    Replies: 0
    Last Post: 02-11-2001, 01:54 PM
  5. GetGlyphOutline
    By abeji in forum VB Classic
    Replies: 20
    Last Post: 10-13-2000, 01:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center