Note that there are some explanatory texts on larger screens.

plurals
  1. POPass Objects between Client and Server C# WCF
    primarykey
    data
    text
    <p>I am implementing a distributed processing system for medical data. I have multiple clients and servers. Clients have data and they send requests to server for processing.</p> <p>I have to transfer two values to server and get one list back. The server implementation is defined as:</p> <pre><code>[ServiceContract] public interface ServerInterface { [OperationContract] List&lt;Triangle&gt; ServerFunction(Grid g, double isolevel); } public class ServerImpl : ServerInterface { public List&lt;Triangle&gt; ServerFunction(Grid g, double isolevel) {/*Implementation*/} } </code></pre> <p>the grid class is defined as:</p> <pre><code>[Serializable] public class Grid { public Point3D[] p = new Point3D[8]; public Int32[] val = new Int32[8]; } </code></pre> <p>And the Triangle class as</p> <pre><code> [Serializable] public class Triangle { public Point3D[] p = new Point3D[3]; } </code></pre> <p>I created client and server side implementation and isolevel value passes fine but grid doesnot get passed properly.</p> <p>The server creates WCF service using this code:</p> <pre><code> Uri baseAddress = new Uri("http://localhost:6525/ServerObject"); using (ServiceHost host = new ServiceHost(typeof(ServerImpl), baseAddress)) { ServiceMetadataBehavior smb = new ServiceMetadataBehavior(); smb.HttpGetEnabled = true; smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15; host.Description.Behaviors.Add(smb); host.Open(); Console.ReadKey(); } </code></pre> <p>the portion of code calling the server for results is :</p> <pre><code>var myBinding = new BasicHttpBinding(); var myEndPoint = new EndpointAddress("http://localhost:6525/ServerObject"); var myChannelFactory=new ChannelFactory&lt;ServerInterface&gt;(myBinding,myEndPoint); ServerInterface si=null; si = myChannelFactory.CreateChannel(); List&lt;Triangle&gt; triList=si.ServerFunction(Grid g,double isoValue); </code></pre> <p>It never returns the list of triangles(always returns null).</p> <p>This code was tested before converting to Distributed and was working properly.</p> <p>I am using WCF and I tried converting the Grid and triangles to string values and passing them, it works but is very slow. The algorithm itself takes good amount of time so extra processing time is not desirable. Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload