472,325 Members | 1,374 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

proxy proxy problem

Hi,

I have a webservice method that returns an instance of a custom class I
created (e.g., bank account).
The class definition in the webservice contains properties, overrides
Object.ToString method and etc.
However, the proxy created for the webservice contains a definition for this
class without the code I wrote. Instead it contains only public fields. I
understand the reason, interoperability with none .net clients, but is there
someway in .net clients to have the same code as in the webservice itself?

Thanks in advance, Ohad

--
Ohad Young
Medical Informatics Research Center
Ben Gurion University
Information System Eng
Office Phone: 972-8-6477160
Cellular Phone: 972-54-518301
E-Mail: oh****@bgumail.bgu.ac.il
Nov 21 '05 #1
3 2270
Technically, you can have the same code implement the objects that
represent your web service messages on the server and client. You'll
want to study your architecture closely and make sure that's a good idea.

Use the proxy generation tool (wsdl or vs.net) to create the client
proxy. Then, open the generated file and modify the parameter and return
types to use the same classes that you used to implement the web
service. Note that you will have to do this everytime the web service
interface definition changes - you won't be able to simply rerun the
tool to update the proxy.

Also, you should understand that unlike binary serialization, the entire
state of the object is not being serialized in xml serialization - only
the public properties/fields that are read/write. That alone may negate
the reasons you want to share class code on the client and server.

Drew

Ohad Young wrote:
Hi,

I have a webservice method that returns an instance of a custom class I
created (e.g., bank account).
The class definition in the webservice contains properties, overrides
Object.ToString method and etc.
However, the proxy created for the webservice contains a definition for this
class without the code I wrote. Instead it contains only public fields. I
understand the reason, interoperability with none .net clients, but is there
someway in .net clients to have the same code as in the webservice itself?

Thanks in advance, Ohad

Nov 21 '05 #2
Hi Drew,

Thanks for the reply, actually this is what I did so far.
You'll want to study your architecture closely and make sure that's a good idea.
I wanted to use data-binding in the GUI (to a ComboBox Class instance). The
data-binding requires the instance to have two public properties, public
fields are not sufficient. Another option was to have a custom ToString()
method.
However, both of the options are problematic due to the proxy generation
result, it doesn't include the public properties nor the custom ToString()
method for understandable reasons (interoperability).
It is tedious to update the proxy every time the webservice changes.
What do you think of using a client class that will receive in the
constructor an instance of the returned webservice class instance?
That way we decouple the dependency between the GUI and the server.

Ohad

"Drew Robbins" <"drew at drewby.com"> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl... Technically, you can have the same code implement the objects that
represent your web service messages on the server and client. You'll
want to study your architecture closely and make sure that's a good idea.

Use the proxy generation tool (wsdl or vs.net) to create the client
proxy. Then, open the generated file and modify the parameter and return
types to use the same classes that you used to implement the web
service. Note that you will have to do this everytime the web service
interface definition changes - you won't be able to simply rerun the
tool to update the proxy.

Also, you should understand that unlike binary serialization, the entire
state of the object is not being serialized in xml serialization - only
the public properties/fields that are read/write. That alone may negate
the reasons you want to share class code on the client and server.

Drew

Ohad Young wrote:
Hi,

I have a webservice method that returns an instance of a custom class I
created (e.g., bank account).
The class definition in the webservice contains properties, overrides
Object.ToString method and etc.
However, the proxy created for the webservice contains a definition for this class without the code I wrote. Instead it contains only public fields. I understand the reason, interoperability with none .net clients, but is there someway in .net clients to have the same code as in the webservice itself?
Thanks in advance, Ohad

Nov 21 '05 #3
I think that your idea of using the webservice data in a constructor of
your client object is a better approach than tightly coupling the
webservice client/server code.

Its similar to the Memento pattern
(http://www.dofactory.com/patterns/PatternMemento.aspx) which is a great
way to store/retrieve the serialized state of an object without
defeating the benefits of encapsulation.

Ohad Young wrote:
Hi Drew,

Thanks for the reply, actually this is what I did so far.

You'll want to study your architecture closely and make sure that's a good


idea.
I wanted to use data-binding in the GUI (to a ComboBox Class instance). The
data-binding requires the instance to have two public properties, public
fields are not sufficient. Another option was to have a custom ToString()
method.
However, both of the options are problematic due to the proxy generation
result, it doesn't include the public properties nor the custom ToString()
method for understandable reasons (interoperability).
It is tedious to update the proxy every time the webservice changes.
What do you think of using a client class that will receive in the
constructor an instance of the returned webservice class instance?
That way we decouple the dependency between the GUI and the server.

Ohad

"Drew Robbins" <"drew at drewby.com"> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl...
Technically, you can have the same code implement the objects that
represent your web service messages on the server and client. You'll
want to study your architecture closely and make sure that's a good idea.

Use the proxy generation tool (wsdl or vs.net) to create the client
proxy. Then, open the generated file and modify the parameter and return
types to use the same classes that you used to implement the web
service. Note that you will have to do this everytime the web service
interface definition changes - you won't be able to simply rerun the
tool to update the proxy.

Also, you should understand that unlike binary serialization, the entire
state of the object is not being serialized in xml serialization - only
the public properties/fields that are read/write. That alone may negate
the reasons you want to share class code on the client and server.

Drew

Ohad Young wrote:
Hi,

I have a webservice method that returns an instance of a custom class I
created (e.g., bank account).
The class definition in the webservice contains properties, overrides
Object.ToString method and etc.
However, the proxy created for the webservice contains a definition for
this
class without the code I wrote. Instead it contains only public fields.
I
understand the reason, interoperability with none .net clients, but is
there
someway in .net clients to have the same code as in the webservice
itself?
Thanks in advance, Ohad


Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kevin Sagon | last post by:
I am running a J2EE Web App under Tomcat 4.1 with Apache 2.0 proxying requests. Everything is configured and working appropriately however I ran...
6
by: harry | last post by:
Hi, I have a program that runs on multiple client pc's. Occasionally one or more of those pc's use VPN to connect to another corporate network....
3
by: Soul | last post by:
Hi, I am learning to code a WinForm application which will need to access a Web Service outside the University network. Our University require us...
5
by: Benne Smith | last post by:
Hi, I have three enviroments; a development, a testing and a production enviroment. I'm making a big application (.exe), which uses alot of...
3
by: Wild Wind | last post by:
Hello all, I apologise in advance for the long windedness of this post, but I feel that if I am going to get any solution to this problem, it is...
9
by: Codex Twin | last post by:
I am re-sending this in the hope that it might illicit a response. I have a corporate client who forces their workstations to get the proxy server...
2
by: rcp | last post by:
Hi all, I've read all posts from all existing threads and none of them worked to solve my problem, although its exactly the same. I'll try to...
2
by: =?Utf-8?B?TGFycnlLdXBlcm1hbg==?= | last post by:
Our WebDev team seems to have found a problem that exposes a bug in .NET 2.0. This problem can be shown when trying to access a WebService using SSL...
2
by: =?Utf-8?B?TGVuc3Rlcg==?= | last post by:
A C# (.NET 2) application which uses the System.Net.HttpWebRequest object to request a resource over HTTPS is failing following the installation of...
4
by: Jon | last post by:
I wrote a VS 2005 C# express programme that accesses a web service. It works fine when there's a direct connection to the internet, but on two...
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...

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.