473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

problem with classes: client v. web service

3
My application sometimes wants to process objects it gets from a web service, but sometimes wants to process purely local objects. In either case, the objects implement the same protocol. For example, both locally created and ws created objects have a "title" property that I want to read.

I would like to have a shared definition of this common protocol, and I would like to call the same method names on both kinds of objects. Let's say the objects are called "chunks". If I try to make a Chunk class, abstract class, or interface, or derivations from those, and share a definition (Add Reference) and code to it in both the web service and the local code, I get problems. No matter how I approach it, I seem to end up with "can't implement the interface" type errors on one end or the other.

What's the right way to define this common behavior on each side of my system?
May 11 '10 #1
3 1437
cstacy
3
Thanks, but your tutorial doesn't seem to have anything to do with what I asked.
May 12 '10 #3
cstacy
3
Let me ask this a different way.

What is the best practice for using the same object definitions on the client and service side? My objects happen to be trivial to serialize, but are composite objects (eg. Foo.title, Foo.text, Foo.issueNumber; members are just strings and ints and such).

The way I am doing it now is that I have a third project that has class definitions in it; both client and server side have references to it. I use WSDL.EXE to generate a proxy class. Then I hand-modify the proxy class to eliminate its class definition of the proxy Foo, and add a "Using" statement to reference the third project instead. When I add the proxy file to the client project, the proxy generates the correct (original) data class common to client and server.

I guess what I want is some advice about the elegance of modifying auto-generated WSDL files, or a way to tell WSDL that it can use certain class definitions (rather than making up proxy classes), or perhaps I am going about this all wrong.
May 13 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: vinoth | last post by:
Hi, I have created WindowsService Project.In that Project OnStart Method i have written the following Code. In this code the Server is waiting for the connection from client. When the Client...
3
by: trialproduct2004 | last post by:
hi all i have one problem in windows service. i have code as following:- DirectoryInfo di = new DirectoryInfo(szfolder); if(di.Exists==true) eventLog1.WriteEntry("exist"); else
6
by: Siddharth | last post by:
Hi all, I have been trying to access a web service over HHTPS but have not been successful. The client has provided us with a pfx file that is password protected. I successfully exported the...
1
by: louis_la_brocante | last post by:
Dear all, I am having trouble generating a client proxy for a webservice whose methods return a "complex" type. The type is complex in that it is a class whose members are a mix of primitive...
0
by: bostjanj | last post by:
Hi, I have a problem adding web service to project. I get the following error: There was an error downloading '/service.asmx'. The request failed with the error message: Object moved to...
0
by: jacorona | last post by:
Hello all, I have found a problem accesing a web service hosted in IIS 5.0 in a W2K box. The web service site is configured to accept both integrated windows authentication and client certificates....
4
by: =?Utf-8?B?VGFrdW1p?= | last post by:
I have a ASP.NET web page that calls a web service on a server with IIS installed on it. When it calls the web service, it gives a HTTP status 401 error stating that it is unauthorized to call the...
2
by: wph101larrya | last post by:
I have a developed service and client application running on a Vista machine in IIS7 in the Visual Studio 2008 beta 2 with .NET 3.5 framework. I am trying to deploy the service app to a test...
0
by: Piotrekk | last post by:
Hi I have a problem with my client activated objects. The service has very short lease time. Client calls function add(2,3) which saves total sum of 6. Then client performs Thread.Sleep(6) which...
0
by: Piotrekk | last post by:
Hi I have a problem with my client activated objects. The service has very short lease time. Client calls function GetProdct(2,3) which saves total product of 6. Then client performs...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.