Search

Adding multiple service references from same application should not require multiple namespaces by jamespaulp

Closed
as Won't Fix Help for as Won't Fix

0
Sign in to vote
0
Sign in to vote
Sign in
to vote
Type: Suggestion
ID: 426791
Opened: 3/25/2009 10:38:10 AM
Access Restriction: Public
0
Workaround(s)
I am writing a Silverlight 2.0 application. I needed add a bunch of ASMX web service references to the application. Visual Studio requires me to specify a different namespace for each of those asmx reference which doesn't make sense. They are all coming from the same server/application. Also, they have their own namespaces which makes the final namespace too long and unmanageable.
Details (expand)
Product Language
English

Version

Visual Studio 2008 SP1
Operating System
Windows XP Professional
Operating System Language
English
Problem Statement
Adding a service reference to Silverlight 2.0/WPF application requires a unique namespace per service.
Proposed Solution
1. Remove the requirement for a namespace.
2. Use namespace from the service.
3. Ability to specify the same namespace for more than one service.
TAP Code (if applicable)
 
      You can indicate your satisfaction with how Microsoft handled this issue by completing this quick 3 question survey. [Details]

 

File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 3/26/2009 at 2:26 AM
Thanks for your feedback. We are escalating your feedback to the product unit who works on that specific feature area. The product team will review your feedback and make a decision on whether they will fix it or not for the next release.
Posted by Microsoft on 5/21/2009 at 3:09 PM
The limitation ensures that type names from separate services will not collide. To get around the limitation, you may use the slsvcutil.exe tool included in the Silverlight 3 SDK to generate service proxies.

(Please note that if you actually want to share types between services, the best way to do this when ASMX services are involved is to add a single reference to multiple services. This can be done by referencing multiple services in the Reference.svcmap file for Update Service Reference or by specifying multiple services on a single slsvcutil.exe command line.)

I will refer this Connect issue to the team that owns the Add Service Reference feature to address the possibility of this limitation of unique namespaces being lifted in the future, or the possibility of some workaround without having to resort to slsvcutil.exe. However, based on what I know so far, unfortunately the chances of either of these things happening are not great, and so your best bet is slsvcutil.
Posted by Microsoft on 5/21/2009 at 3:10 PM
To add to my previous reply: specifically, take a look at the /namespace switch of slsvcutil.exe.
Posted by Microsoft on 5/22/2009 at 2:42 PM
Additional information from the Add Service Reference team:

"You can explicitly specify namespace mappings in the ClientOptions section of the .svcmap file; the snippet below would map all types (data contracts + service contracts) to namespace "X":

<ClientOptions>
....
    <NamespaceMappings>
     <NamespaceMapping TargetNamespace="http://foo" ClrNamespace="X" />
    </NamespaceMappings>

Unfortunately, we are automatically internally adding a "*" to the mappings when generating the code, so you have to do this for every namespace for your service contracts & data contracts. It also doesn't work when you use the XmlSerializer..."

This is not a common feature request, it may be quite involved to fix, and there are multiple workarounds - so, it is unfortunately likely that other features will be prioritized higher than this request in the foreseeable future. I am thus resolving as Won't-Fix. If you beleive this is the wrong decision for the product as a whole, please reactivate this Connect issue with your reasons. If this is causing significant business impact in your particular application, please contact Microsoft Product Support and refer to this Connect issue.