473,543 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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, interoperabilit y 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 2337
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, interoperabilit y 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 (interoperabili ty).
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******** ******@TK2MSFTN GP09.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, interoperabilit y 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 (interoperabili ty).
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******** ******@TK2MSFTN GP09.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.ToStr ing 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, interoperabilit y 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
3272
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 into a problem after configuring J2EE Form Authentication. I have a security constraint restricting access to the application so that when I attempt to access the app I am redirected to the login...
6
7909
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. When using VPN they need to set proxy server in Internet Explorer connection settings (proxy:8080). However, as soon as this setting is enabled, the remoting program running on their pc stops...
3
2199
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 to go through a proxy in order to access the Internet. In addition, the proxy require us to authenticated before allow us to go through it. I have coded something like below (without changing...
5
3475
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 different webservices. I don't use the webservices by adding a WebReference, since it does not allow me to keep state (cookiecontainer) or to specify functions on the classes (like if i want to...
3
7757
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 important that I present as much information that will be useful in diagnosing the problem. I have an application which calls a method of a web service that we host remotely. I have deployed...
9
3442
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 details using an automatic proxy discovery script. Unfortunately, the .NET Framework does not support automatic proxy discovery scripts. See:...
2
11405
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 explain my case and see if a kind soul could help me out: I've a win32 service in C# on a client machine A, which accesses a WS (C#) on a server machine B (hosted on an IIS) Case 1: If I try to...
2
3469
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 and through a proxy server after using the HttpWebRequest object. Under normal circumstances I am able to use the webservice without any problems. But after using an HttpWebRequest object to...
2
8144
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 a new proxy server on our internal network with 407 Proxy Authentication Required. The same request through the old proxy succeeds. The same request to an HTTP address through the new proxy...
4
4449
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 different PCs with internet access via a proxy, I get this exception: System.Net.WebException: The request failed with HTTP status 407: Proxy Authentication Required. at...
0
7408
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7349
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7735
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5885
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3391
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3391
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1817
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
968
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
636
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.