Simple question - remoting

Simple question - remoting

Old forum URL: forums.lhotka.net/forums/t/3005.aspx


boo posted on Thursday, June 07, 2007

I've seen this before but don't remember the fix.  Trying to do a demo on built in remoting; connects to my test server (a console app - using TCP) but times out (get remote connection forceably closed) when I finally give up and shut down the console app.  I wish I could remember what I did for this, its something simple and obvious I know.  Thanks much!

Here are the config files:

Client:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="CslaDataPortalProxy"
             value="Csla.DataPortalClient.RemotingProxy, Csla, Version=2.1.4.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30"/>
        <add key="CslaDataPortalUrl"
             value="tcp://localhost:32496/RemotingPortal.rem"/>
    </appSettings>
</configuration>

Server App:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.runtime.remoting>
    <application>
      <service>
            <wellknown
                mode ="SingleCall"
                objectUri="RemotingPortal.rem"
                type="Csla.Server.Hosts.RemotingPortal, Csla, Version=2.1.4.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30"
                />
      </service>
      <channels>
        <channel ref="tcp" port="32496" />
      </channels>
    </application>
  </system.runtime.remoting>
</configuration>

boo replied on Friday, June 08, 2007

I tried using a different object URI but I don't think that was it...it's suppose to be RemotingPortal right?  I also tried a differnt port but no luck.  Does anyone have any other ideas?

RockfordLhotka replied on Saturday, June 09, 2007

It has been a long time since I messed with this, but aren't you supposed to provide a name on the server that acts like a virtual root name for the client? So the client would call

tcp://localhost:1234/vrname/Remoting/RemotingPortal.rem

boo replied on Saturday, June 09, 2007

It's not necessary I don't think; I did a very basic app (non-csla) that remotes fine; actually after looking in CLSA itslef I found that RemotingPortalProxy creates a HTTP channel, not a TCP; so I created a proxy and server for custom use.

All works good up until the point the the portal proxy calls DP_F - at that point I get:
Additional information: Because of security restrictions, the type Csla.Server.DataPortalContext cannot be accessed

If I change the TCP channel constructor to pass false to not ensure security the application freezes when trying to access the object on the server for the first time.

I'm stumped but I really want to get this working.  Any ideas, help, suggestions, are greatly appreciated.  In fact its kind of cool that I had to come up with a TCP solution because it will show my co-works how easy CSLA DP remoting is to extend; now if I could only get it to work!

RockfordLhotka replied on Saturday, June 09, 2007

You probably need the extra bit in the config on the server to allow passing complex types

 

                                                <channels>

                                                                <channel ref="http">

                                                                                <serverProviders>

                                                                                                <provider ref="wsdl"/>

                                                                                                <formatter ref="soap" typeFilterLevel="Full"/>

                                                                                                <formatter ref="binary" typeFilterLevel="Full"/>

                                                                                </serverProviders>

                                                                </channel>

                                                </channels>

 

Rocky

 

 

From: boo [mailto:cslanet@lhotka.net]
Sent: Saturday, June 09, 2007 3:59 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] Simple question - remoting

 

It's not necessary I don't think; I did a very basic app (non-csla) that remotes fine; actually after looking in CLSA itslef I found that RemotingPortalProxy creates a HTTP channel, not a TCP; so I created a proxy and server for custom use.

All works good up until the point the the portal proxy calls DP_F - at that point I get:
Additional information: Because of security restrictions, the type Csla.Server.DataPortalContext cannot be accessed

If I change the TCP channel constructor to pass false to not ensure security the application freezes when trying to access the object on the server for the first time.

I'm stumped but I really want to get this working.  Any ideas, help, suggestions, are greatly appreciated.



boo replied on Saturday, June 09, 2007

That did get me a little further; I didn't know those were for TCP too - no I got:

Principal must be of type BusinessPrincipal, not Nothing

I saw that on the post before - but the fix (adding setting to app.config) didn't work...I'll get back to digging; any other help is appreciated.

Copyright (c) Marimer LLC