473,503 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ambiguous Web Service References

Background:
I am building a Windows enterprise application that has separate assemblies
for UI, business logic/rules, and data access (i.e. typical N-tier
architecture). Many of the assemblies reference a "name and address web
service," which gives me validation lists for name honorifics (e.g. Dr, Mr,
Miss, Mrs), name suffixes (e.g. Sr, Jr, III), and City/State/ZIP combos. The
same name and address web service also can save and retrieve addresses.
Obviously, it's a pretty generic little web service that gets used in
multiple places in the app (return addresses for mailings; contact info for
A/R accounts; and more). Multiple assemblies have need to use the web service.

The Problem:
If each assembly has a reference to the same web service and names the proxy
the same thing (i.e. NameAndAddressWebService), then I start getting
ambiguous reference errors popping up everywhere. If I name all the web
references differently, then I'm okay. But I have to be careful that all my
references truly have different names, even those "built into" other
assemblies developed by other programmers. Some options:
1) Why can't web references be marked "Friend" so their visibility is
restricted to the assembly that they're declared in? The VS2005-generated
code always generates "Public" proxy objects. (I can go into the Reference.vb
and change everything from Public to Friend, but that seems like a really
dangerous thing to do; "Update Web Reference" wipes out all these manual
override changes.)
2) I can create a wrapper assembly that essentially just has the web
reference proxy objects in it (i.e. NameAndAddressWSProxy.dll). I can then
reference this assembly from all my other assemblies and everything works.
But wrapping a web service seems hokey.
3) I could scrap the whole name and address web service and just turn it
into a standard Windows assembly (Windows Class Library). At this point, I'm
just not seeing the advantage of having this functionality in a web service
(heresy, I know!).

I've been looking for some best practices, or at least "here's-what-we-did",
articles, but I haven't found anything yet. Recommendations?

May 17 '07 #1
3 3118
=?Utf-8?B?Q3JhaWc=?= <Cr***@discussions.microsoft.comwrote in
news:05**********************************@microsof t.com:
The Problem:
If each assembly has a reference to the same web service and names the
proxy the same thing (i.e. NameAndAddressWebService), then I start
getting ambiguous reference errors popping up everywhere.
Use the fully qualified name:

i.e.: Namespace.Class.Object
If I name
all the web references differently, then I'm okay. But I have to be
careful that all my references truly have different names, even those
"built into" other assemblies developed by other programmers. Some
options: 1) Why can't web references be marked "Friend" so their
visibility is restricted to the assembly that they're declared in? The
VS2005-generated code always generates "Public" proxy objects. (I can
go into the Reference.vb and change everything from Public to Friend,
but that seems like a really dangerous thing to do; "Update Web
Reference" wipes out all these manual override changes.)
2) I can create a wrapper assembly that essentially just has the web
reference proxy objects in it (i.e. NameAndAddressWSProxy.dll). I can
then reference this assembly from all my other assemblies and
everything works. But wrapping a web service seems hokey.
3) I could scrap the whole name and address web service and just turn
it into a standard Windows assembly (Windows Class Library). At this
point, I'm just not seeing the advantage of having this functionality
in a web service (heresy, I know!).

I've been looking for some best practices, or at least
"here's-what-we-did", articles, but I haven't found anything yet.
Recommendations?

May 17 '07 #2
Spam Catcher -

My multiple UI assemblies all have the same namespace:
<root_namespace>.Action.Clerk.UserInterface

My business logic/rules assemblies all have the same namespace:
<root_namespace>.Action.Clerk.BusinessObjects

And my data access assemblies all have the same namespace:
<root_namespace>.Action.Clerk.DataObjects

So using the fully qualified name still doesn't resolve the ambiguities.
Again, I go back to the fact that web references can't be isolated to the
assembly that they're declared in; the proxy objects are in fact declared as
Public, which exposes them throughout any solution that the assemblies are
used in. This seems like a pretty big shortcoming to me.

"Spam Catcher" wrote:
Use the fully qualified name: i.e.: Namespace.Class.Object

May 17 '07 #3
=?Utf-8?B?Q3JhaWc=?= <Cr***@discussions.microsoft.comwrote in
news:62**********************************@microsof t.com:
Spam Catcher -

My multiple UI assemblies all have the same namespace:
<root_namespace>.Action.Clerk.UserInterface
You shouldn't be naming your assemblies with all the same name.

Is there a reason why they're all the same?
May 17 '07 #4

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

Similar topics

0
1344
by: Saix News | last post by:
hi, i have an application that references a web service. the web service a particular user will need though may be local to their network or a totally different one available on the internet...
2
6720
by: MarioPereira | last post by:
I have created a website using .NET Framework 2.0 with some web services that share the same object model (defined in the App_Code). When adding web references to these web services from a web...
2
1218
by: Fred Chateau | last post by:
I have a UI application that references business objects in Visual Studio on two identical servers (ws1 & ws2). The business objects are the same so the methods from each Web Service proxy are the...
4
10318
by: iKiLL | last post by:
Hi all, I am using C# on VS2005. I have a solution with 2 projects, a Webservice and a Client application. Both of these to projects can build compile and run.
0
2339
by: =?Utf-8?B?QW5keSBZdQ==?= | last post by:
Hi, I'm trying to return exceptions from a WCF Service using FaultExceptions. I got the service compiled and running. But I get an error while adding a service reference to it. The error reads: "...
3
2074
by: ChristianProgrammer | last post by:
Its been a month and a half now. I have tried to get my WSSF web service to reference a class library that IS a Socket Client. The Socket Client in question runs fine when called by a testing exe....
2
3220
by: Marc S | last post by:
I have a WCF service deployed on IIS. When I browse to the service through IE everything is peachy. When I try to add a reference to the service in Visual Studio 2008 "Add Service Reference" I get...
2
5545
by: =?Utf-8?B?SmltIE93ZW4=?= | last post by:
Hi John, Hopefully this post will find its way back to you - or perhaps be answered by someone else. As I mentioned in my last post on the earlier portion of this thread, changing the...
3
1197
by: =?Utf-8?B?UXVpbWJseQ==?= | last post by:
My colleague and I are working from the same code base, including the solution file and all projects. We're building a WinForms app, using WCF service methods to access the back-end. When I...
0
7322
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
6982
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
5572
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
5000
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
4667
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
3161
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...
0
1501
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 ...
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
374
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.