473,405 Members | 2,415 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,405 software developers and data experts.

Multiple web service classes in a single URL

This seems like it's probably a pretty basic question but is there a way to
publish multiple classes from a single web service URL?

Using VS.NET, I create a project, FOO and add a web service, BAR, to it with
one function, baz(). Then, I create a second project to consume the service.
I add a web reference to http://webserver/FOO/BAR.asmx and call that,
BAR_Service. In the code, if I do something like:

dim ws as new BAR_Service.BAR
ws.baz()

My questions are:
Is there a way to add a second class to the web service that could be
referenced as, say, BAR_Service.BAR2? If not, why is the one and only class
that can be referenced by the web service not implicit in the reference to
the service?

Thanks for any help,

</hjp>
Jan 18 '06 #1
2 3191
Yes you can add a second web service using the Add new item dialog in
VS. Say you a new web service named BOO with one function boo. After
doing so, update the web reference in your client project, your
BAR_Service will contain the following:

BAR_Service.BAR ws1 = new BAR_Service.BAR ()
ws1.baz();
BAR_Service.BOO ws2 = new BAR_Service.BOO ();
ws2.boo ();

Hope this helps...

- NuTcAsE

Jan 18 '06 #2
That's what I thought should happen, as well. Alas... Each newly added web
service adds a new .asmx file. That .asmx file corresponds to an URL. Hence,
you have to add two references to the consuming app, one to
http://server/BAR.asmx (called BAR_Service) and a second one to
http://server/BOO.asmx (called BOO_Service) and then reference them:

BAR_Service.BAR ws1 = new BAR_Service.BAR()

and

BOO_Service.BOO ws2 = new BOO_Service.BOO()

I can find no way to add a single URL to the consuming app (called Service)
such that Service.BAR and Service.BOO are accessible.

"NuTcAsE" wrote:
Yes you can add a second web service using the Add new item dialog in
VS. Say you a new web service named BOO with one function boo. After
doing so, update the web reference in your client project, your
BAR_Service will contain the following:

BAR_Service.BAR ws1 = new BAR_Service.BAR ()
ws1.baz();
BAR_Service.BOO ws2 = new BAR_Service.BOO ();
ws2.boo ();

Hope this helps...

- NuTcAsE

Jan 18 '06 #3

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

Similar topics

2
by: Graham Banks | last post by:
Does using multiple inheritance introduce any more performance overhead than single inheritance?
22
by: Matthew Louden | last post by:
I want to know why C# doesnt support multiple inheritance? But why we can inherit multiple interfaces instead? I know this is the rule, but I dont understand why. Can anyone give me some concrete...
4
by: Jeff | last post by:
We have multiple ASP.Net web apps in development. As a standard we are looking to go with SQL Server to hold state information. Can we have the multiple apps all point to a single State DB? Or...
3
by: Elroyskimms | last post by:
I know that multiple class inheritance is not possible in VB.Net I also know that I can: inherit class a and in class a: inherit class b and in class b:
3
by: Matt D | last post by:
I've got two web services that use the same data types and that clients will have to consume. I read the msdn article on sharing types...
4
by: Matt Kruse | last post by:
While developing an internal IE6-only webapp, a discussion started about the 'best' way to apply classes to data tables across multiple pages. The two arguments were: 1. Apply a single class to...
11
by: Joseph Geretz | last post by:
I've been looking at two approaches for the maintenance of Session state for a Web Service application. One approach uses the old familiar Session object which I've used in the past for Web...
6
by: Joseph Geretz | last post by:
I have the following class which I am serializing and passing back and forth between my Web Service application and the client. public class Token : SoapHeader { public string SID; public...
1
by: =?Utf-8?B?UEI=?= | last post by:
Hi I was investigating whether we could have a single entry-point (.asmx) to multiple Web Service classes instead of just one. Something like: <%@ WebService Language="C#" Class="Class1"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.