Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Remoting / March 2004

Tip: Looking for answers? Try searching our database.

Remoting Server: Problem with Soapsuds Created Client

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rob - 27 Mar 2004 14:09 GMT
I have a remote object that supports a simple interface. I left out
the details in the code that follows in order to present the problem.

public namespace MyNamespace
{
   public interface IDbConnect
   {
       DataSet ExecuteQuery(string strTable);
   }
   public class DbConnect: MarshalByRefObject, IDbConnect
   {
       public DbConnect() : this("MyTable")
       {
       }
       public DbConnect(string strTable)
       {
           ...
       }
       public DataSet ExecuteQuery(string strSelectText)
       {
           ...
       }
   }
}

I wrote a simple console application that acts as a server and
activates this remoting object. It uses a configuration file to
configure the server as a server activated object (the mode is
irrelevant).

I wrote a simple windows form application that acts as a client to
this server. It uses a configuration file to configure the client.

When I add a reference to the MyNamespace.DbConnect dynamic link
library to my windows application, it works fine. I can use the class
or the interface, and instantiate the class directly or activate the
object via the Activator.GetObject() method, respectively.

The client and the server work as expected.

So I generate an interface assembly with soapsuds, and replace the
reference to the MyNamespace.DbConnect DLL with the reference to the
soapsuds generated interface assembly in my client application. Then I
modify my code to use the direct class instantiation method to
instantiate the remote object, and nothing happens when I run the
client. I don't get an error or an exception.

It's as if the RemotingConfiguration.Configure() method doesn't work
the same as if I had manually programmed the server and client
applications with the usual statements, as follows.

Server:
   HttpServerChannel channel = new HttpServerChannel(1234);
   ChannelServices.RegisterChannel(channel);
   RemotingConfiguration.RegisterWellKnownServiceType(typeof(MyNamespace.DbConnect),
"DbConnect", "WellKnownObjectMode.Singleton");

Client:
   HttpClientChannel channel = new HttpClientChannel();
   ChannelServices.RegisterChannel(channel);
   dbc = (IDbConnect)Activator.GetObject(typeof(IDbConnect),
@"http://localhost:1234/DbConnect");

So my question is: "Is there a known issue with soapsuds generated
interface assemblies and configuration files?"
Rob - 28 Mar 2004 11:14 GMT
More Info...

I modified the code as follows to test my theory that a problem may
exist with soapsuds generated interface assemblies when used with the
RemotingConfiguration.Configure() method. A code fragment follows:

// Register the remote class as a valid type in the client's
application domain
//RemotingConfiguration.Configure("DbConnectClient.exe.config");
HttpClientChannel channel = new HttpClientChannel();
ChannelServices.RegisterChannel(channel);
RemotingConfiguration.RegisterWellKnownClientType(typeof(DbConnect),
"http://localhost:1234/DbConnect");

// Instantiate the remote class
dbc = new DbConnect();
//dbc = (IDbConnect)Activator.GetObject(typeof(IDbConnect),
@"http://localhost:1234/DbConnect");

This works, but it defeats the purposed of using configuration files.
Allen Anderson - 29 Mar 2004 17:54 GMT
soapsuds can be problematic for many reasons, take a look at this
article I wrote on ways to avoid soapsuds altogether.

http://www.glacialcomponents.com/ArticleDetail.aspx?articleID=RemoteObject

Allen Anderson
http://www.glacialcomponents.com
mailto: allen@put my website url here.com

>I have a remote object that supports a simple interface. I left out
>the details in the code that follows in order to present the problem.
[quoted text clipped - 61 lines]
>So my question is: "Is there a known issue with soapsuds generated
>interface assemblies and configuration files?"

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.