473,396 Members | 1,866 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,396 software developers and data experts.

Sharing web-service class between two local assemblies

I have application1 that connects to webService1. I have a second
application that references the same webservice (webService1). I need
to pass an instance of a class returned from webService1 from
application1 to application2. I have a reference (assembly.load) of
application2 in application1, but when it won't let me cast it -
saying they're different types. What are my options?

Thanks in advance,
Joshua Moore

Feb 23 '07 #1
5 2148
"Josh" <gl*****@gmail.comwrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
>I have application1 that connects to webService1. I have a second
application that references the same webservice (webService1). I need
to pass an instance of a class returned from webService1 from
application1 to application2. I have a reference (assembly.load) of
application2 in application1, but when it won't let me cast it -
saying they're different types. What are my options?
They are different types. They are unrelated to each other. That's how it's
supposed to be.

webService1 did not return an instance of a class. It returned some XML
which was later deserialized into a class instance.

John
Feb 23 '07 #2
Try this.

Create a library which contains your class definition. The class must be
serializable. All three projects should reference this library. The Web
Service should send back an instance of your class definition. This class
should then be transportable between application1 and application2. This
should work, since all three applications are using the same definition of
the class.

Haven't had time to test this out specifically, but I think this should
work. Let me know if I'm wrong about this.

Hope this helps.

- Joseph Geretz -

"Josh" <gl*****@gmail.comwrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
>I have application1 that connects to webService1. I have a second
application that references the same webservice (webService1). I need
to pass an instance of a class returned from webService1 from
application1 to application2. I have a reference (assembly.load) of
application2 in application1, but when it won't let me cast it -
saying they're different types. What are my options?

Thanks in advance,
Joshua Moore

Feb 23 '07 #3
"Joseph Geretz" <jg*****@nospam.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Try this.

Create a library which contains your class definition. The class must be
serializable. All three projects should reference this library. The Web
Service should send back an instance of your class definition. This class
should then be transportable between application1 and application2. This
should work, since all three applications are using the same definition of
the class.

Haven't had time to test this out specifically, but I think this should
work. Let me know if I'm wrong about this.
Joseph, this doesn't work at all.

The Web Services platform erects a "chinese wall" between the client and the
server. The client is NOT using the classes exposed by the server. A .NET
client will be using proxy classes created by .NET. These proxy classes will
be unrelated to the original classes exposed by the server.

This becomes obvious when the exposed classes contain methods which are not
[WebMethod]s. Those methods are not part of the interface that the client
sees, even if they are public. Neither will the client see any constructors
other than a default constructor, nor will it see indexers, events, etc.
These things are not part of the Web Services Platform.

John
Feb 24 '07 #4
"Joseph Geretz" <jg*****@nospam.comwrote in message
news:O1*************@TK2MSFTNGP06.phx.gbl...
>Joseph, this doesn't work at all.

Actually John, it does work with just a little bit of additional effort.
The attached project demonstrates the technique.
>The Web Services platform erects a "chinese wall" between the client and
the
server. The client is NOT using the classes exposed by the server. A .NET
client will be using proxy classes created by .NET. These proxy classes
will
be unrelated to the original classes exposed by the server.
As I'll say for the third and final time, this doesn't work. Your edits will
be destroyed as soon as Update Web Reference is performed.

I'm going to shut up now, and let somebody else make these points for me (I
hope). We seem to have gotten to the point where you're ignoring what I say
because it's me saying it.
John
Feb 25 '07 #5
As I'll say for the third and final time, this doesn't work. Your edits
will be destroyed as soon as Update Web Reference is performed.
Duh. But if you're willing to put the same edits in place (come on John,
you're the guy who dislikes all this 'magically generated' wire-up
infrastructure to begin with - the 'training wheels' as you so eloquently
describe it) this can be a workable solution. Especially, once you get your
Web Service interface locked down, and are no longer updating Web References
with any degree of frequency.
I'm going to shut up now, and let somebody else make these points for me
(I hope). We seem to have gotten to the point where you're ignoring what I
say because it's me saying it.
The bottom line is, if you're willing to put some edits in place, this can
be a workable solution. Especially, once you get your Web Service interface
locked down, and are no longer updating Web References with any degree of
frequency. Obviously, there's a choice to make here. If you want to go with
the training wheels (your terminology) without getting involved in the proxy
yourself, then this is a non-starter. But if you're ready to tak the
training wheels off and get invoved in the code yourself, then this can be a
workable solution.

Your fundamental resistance to this approach doesn't seem quite consistent
with your previously stated distaste for 'magically generated' wired-up
infrastructure - the 'training wheels' as you've referred to this in the
past. Given this basic inconsistency in your own position, one might be
forgiven for oppining that perhaps the exact opposite is true. That we've
gotten to the point where you are ignoring the basic facts, simply because
it's me who is presenting them. But I see that your mind is made up; I'll
stop confusing you with the facts now, so that you can continue to cling to
your assertions.

- Joseph Geretz -

"John Saunders" <john.saunders at trizetto.comwrote in message
news:eF**************@TK2MSFTNGP06.phx.gbl...
"Joseph Geretz" <jg*****@nospam.comwrote in message
news:O1*************@TK2MSFTNGP06.phx.gbl...
>>Joseph, this doesn't work at all.

Actually John, it does work with just a little bit of additional effort.
The attached project demonstrates the technique.
>>The Web Services platform erects a "chinese wall" between the client and
the
server. The client is NOT using the classes exposed by the server. A
.NET
client will be using proxy classes created by .NET. These proxy classes
will
be unrelated to the original classes exposed by the server.

As I'll say for the third and final time, this doesn't work. Your edits
will be destroyed as soon as Update Web Reference is performed.

I'm going to shut up now, and let somebody else make these points for me
(I hope). We seem to have gotten to the point where you're ignoring what I
say because it's me saying it.
John



Feb 25 '07 #6

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

Similar topics

0
by: Magic1812 | last post by:
Magic Software invites you to join us this coming Tuesday (January 13th, 2004) at 12:00 EDT / 17:00 GMT for a FREE live Webinar: Title: Accelerated Application Integration and Information...
0
by: Magic1812 | last post by:
Magic Software invites you to join us this coming Tuesday (January 13th, 2004) at 12:00 EDT / 17:00 GMT for a FREE live Webinar: Title: Accelerated Application Integration and Information...
1
by: Bill Belliveau | last post by:
Hello all, I’m looking for some general information about sharing the session but haven’t found any resources that confirm my conceptions. All the discusisons about sharing the session...
5
by: BPearson | last post by:
Hello I would like to have several sites share a single web.config file. To accomplish this, I would point the root of these sites to the same folder. Is there any reason why I might not want to...
4
by: Daniel | last post by:
Hi I am having a problem sharing session between SSL and non-SSL asp.net pages I have F5 BigIP with sticky sessions working fine, but the problem is tha sticky session applies at the port level...
3
by: Shikari Shambu | last post by:
Hi All, I have a situation where multiple applications are sharing some pages/ controls. So, I have a separate common project that has the common pages/ controls. My question is how do I...
0
by: Henrik Gøttig | last post by:
Hi group I am investingating how I can turn on proxy type sharing from the IDE. I am aware that I can do that from the sharetypes switch on the command-line to wsdl.exe If I have a ASP.NET...
7
by: Nils Hedström | last post by:
I have a web farm that uses a state server for session management. A user logs on to a website (www1.mysite.com). When the same user visits www2.mysite.com I want the user to be logged in. Right...
2
by: Steven Nagy | last post by:
Hey all, Is it possible that I can somehow transfer an authenticated user (stored in session) between 2 web applications with some measure of security? Essentially if a user has logged into...
8
by: antonyliu2002 | last post by:
We are extending a web application written in classic ASP long time ago. We will add more components to this web application in ASP.NET 2.0. To use the web application, our web users will have...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.