views:

374

answers:

1

Hello,

I was wondering if it's possible to reuse objects in web references in an ASP.NET Server control? (basically keeping the same web reference name)

I have a few web services (.asmx) that I want to group with the same web reference name, however when I consume them using the same name they append a 1 at the end and with all object names.

Right Click - Add Web Reference Enter URL of asmx Type "MyServices" in for Web Reference Name

Repeat, Add Web Reference Type "MyServices" in for Web Reference Name And it adds it as "MyServices1" rather than grouping and reusing the same objects.

This only appears to do this on ASP.NET Server Controls - any other project that I have ever created, standard c# console application, asp.net web application all group the objects and web reference names together.

Am I missing a patch, upgrade, or is this just not possible with a Server Control?

Just for a little background, I'm creating a control that I can drop into projects based on a single dll.

I'm able to group the services in a test project if it's a web application, however they do not group in the Server Control project.

Any help would be greatly appreciated!

Thanks!

Jamey

An example is located here:

http://imgur.com/6tqvQ.jpg

A: 

There's only meant to be one WSDL per web reference, which means only one .ASMX per web reference.

In order to share types between proxies to multiple .ASMX files, you need to use the command-line tool WSDL.EXE:

WSDL /shareTypes http://localhost/service1.asmx?wsdl http://localhost/service2.asmx?wsdl ...

This will produce a single code file, and will produce one type per combination of XML namespace, name and wire signature.

John Saunders
I'm able to consume multiple services and give them the same Web Reference Name on just about every project except a ASP.NET Server Control project. I'm trying to consume them as the same web reference name so that I can reference them all as say - com.example.services, rather different web service names. Each consumed web service should come in with it's own discomap and wsdl under that web reference name - but I can't seem to get this to work correctly under ASP.NET Serivce Controls. I've added a screenshot above of what I'm trying to do. I hope it makes more sense. Thanks for you help!
It does sound more like a bug than anything else.
John Saunders