473,473 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using library classes instead of proxy classes

I have a .NET class library called NorthwindLib and a class called Customer.
I have a web server that exposes a web method GetCustomer() and returns a
NorthwindLib.Customer object.

I want to consume this web service in another .NET application that
references NorthwindLib. When the web reference is created I want the
GetCustomer method to return an instance of NorthwindLib.Customer NOT a
generated ServiceProxy.Customer.

What is the easiest way to accomplish this?

From what I have found I could create a SchemaImporter object that maps the
types in the WSDL to a known type in my class library. However, this
solution appears to require a DLL to be built and installed/configured on
each developer machine. I would really like something that is a
project-level solution that doesn't require additional special machine
configuration. Is this possible?

Does WCF address this scenario more gracefully than ASP.NET 2.0 Web Services?
Feb 23 '07 #1
4 2017
Joe,

Whether it is Service.Customer or Library(dll).Customer it's jus a customer
object.
I assum you need Customer object at the Service end, just for the sake of
typecasting the object returned from library.
If you see WSDL it should be your
Customer Object with all public properties and methods serialized. I don't
find any problem with this.

Do you want to address the scenario where the Serivce.Customer and
Library(dll).Customer object has different defintion and you want to address
them.

Could you please elaborate me more on your requirement ?
--
Thanks & Regards,
Mark Nelson
"Joe" wrote:
I have a .NET class library called NorthwindLib and a class called Customer.
I have a web server that exposes a web method GetCustomer() and returns a
NorthwindLib.Customer object.

I want to consume this web service in another .NET application that
references NorthwindLib. When the web reference is created I want the
GetCustomer method to return an instance of NorthwindLib.Customer NOT a
generated ServiceProxy.Customer.

What is the easiest way to accomplish this?

From what I have found I could create a SchemaImporter object that maps the
types in the WSDL to a known type in my class library. However, this
solution appears to require a DLL to be built and installed/configured on
each developer machine. I would really like something that is a
project-level solution that doesn't require additional special machine
configuration. Is this possible?

Does WCF address this scenario more gracefully than ASP.NET 2.0 Web Services?
Feb 23 '07 #2
Hi Joe,

Have a look at the sample project which I posted to Josh's topic 'Sharing
web-service class between two local assemblies'. Basically, you can simply
edit the generated proxy to use your desired class definition, rather than
its own class definition whch is created by default.

Hope this helps,

- Joseph Geretz -

"Joe" <Jo*@discussions.microsoft.comwrote in message
news:2F**********************************@microsof t.com...
>I have a .NET class library called NorthwindLib and a class called
Customer.
I have a web server that exposes a web method GetCustomer() and returns a
NorthwindLib.Customer object.

I want to consume this web service in another .NET application that
references NorthwindLib. When the web reference is created I want the
GetCustomer method to return an instance of NorthwindLib.Customer NOT a
generated ServiceProxy.Customer.

What is the easiest way to accomplish this?

From what I have found I could create a SchemaImporter object that maps
the
types in the WSDL to a known type in my class library. However, this
solution appears to require a DLL to be built and installed/configured on
each developer machine. I would really like something that is a
project-level solution that doesn't require additional special machine
configuration. Is this possible?

Does WCF address this scenario more gracefully than ASP.NET 2.0 Web
Services?

Feb 25 '07 #3
"Joseph Geretz" <jg*****@nospam.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hi Joe,

Have a look at the sample project which I posted to Josh's topic 'Sharing
web-service class between two local assemblies'. Basically, you can simply
edit the generated proxy to use your desired class definition, rather than
its own class definition whch is created by default.
Jopseph, that's a very bad idea. The proxy class is generated code. As soon
as Update Web Reference is used, any edits are destroyed.
John
Feb 25 '07 #4
Jopseph, that's a very bad idea. The proxy class is generated code. As
soon as Update Web Reference is used, any edits are destroyed.
Of course, this is the obvious caveat. Whatever generated the proxy in the
first place is going to re-generate it when the reference is refreshed.
Whether or not this is a 'bad idea' would depend on the context in which
it's being used. There are other ways to approach this issue. However
(contrary to your assertion) this possibility exits. I'd allow developers
with more knowledge regarding their perticular scenario to decide for
themselves whether or not it is a 'bad idea' for their specific situation.

Your 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 so eloquently describe 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.

- Joseph Geretz -

"John Saunders" <john.saunders at trizetto.comwrote in message
news:e4**************@TK2MSFTNGP02.phx.gbl...
"Joseph Geretz" <jg*****@nospam.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>Hi Joe,

Have a look at the sample project which I posted to Josh's topic 'Sharing
web-service class between two local assemblies'. Basically, you can
simply edit the generated proxy to use your desired class definition,
rather than its own class definition whch is created by default.

Jopseph, that's a very bad idea. The proxy class is generated code. As
soon as Update Web Reference is used, any edits are destroyed.
John


Feb 25 '07 #5

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

Similar topics

4
by: bmiras | last post by:
I've got a problem using urllib2 to get a web page. I'm going through a proxy using user/password authentification and i'm trying to get a page asking for a HTTP authentification. And I'm using...
2
by: raymond | last post by:
Hi, Is it possible to create a proxy client class or a web service method by VS.NET without using wsdl? My stupid client is using a xml schema (.xsd) to describe all their web service methods...
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 different webservices. I don't use the webservices...
4
by: WATYF1 | last post by:
Hello. I'm writing a VB.NET app to check email message counts for both POP3 and IMAP4. I'm using TCPClient to connect, and a NetworkStream to send simple commands. It's a very simple bit of code,...
8
by: Mas L via DotNetMonster.com | last post by:
Hi, I have a c++ source code which I can compile to be a DLL (in VS.NET 2003). And I need to use it in a C# program. After I compiled/build the C++ code to a DLL, I add it as a Reference in my...
1
by: Ankur Goenka | last post by:
Hi, I am trying to include two proxy classes (from two different web services say Namespace.Service1 and Namespace.Service2) in a project (C# Class lib). These webservice internally use (as...
2
by: stormogulen | last post by:
Hi! I'm having some problems figuring out how to organize the different tiers of an application using a webservice. The bottom layer is the DAL, and some of the objects in the DAL, I would...
6
by: Bob Weiner | last post by:
I have a few dll's that return their own version of Account objects. In the asp code I am writing now I would like to define an interface, called IAccount, and convert each of these objects (...
2
by: Peter | last post by:
Firstly let me be very clear about this, I do not want to create a web service proxy nor do I want to do anything with web services. Basically, I have a shrink wrapped desktop application which...
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
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...
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...
1
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
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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...

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.