Multiple wbsevices in on asmx file
HI,
Does any one know whow to access multiple webservices from the asmx file. I am just trying to test I don't need to access them from code. I just want to access them from the browser right now? - when I runt the project only one web service shows up.
Do I need to have 2 asmx files???
Re: Multiple wbsevices in on asmx file
Quote:
Originally posted by dgruzew
HI,
Does any one know whow to access multiple webservices from the asmx file. I am just trying to test I don't need to access them from code. I just want to access them from the browser right now? - when I runt the project only one web service shows up.
Do I need to have 2 asmx files???
When you say multiple webservices, do you actually mean multiple methods(or functions) within a webservice ???
You can have as many methods in a service as you want. They just need to be setup properly.
Simple example....copy the following code into one file with the extension ASMX and run it.
Code:
<%@ WebService language="C#" class="Test" %>
using System;
using System.Web.Services;
using System.Xml.Serialization;
public class Test {
[WebMethod]
public int Add(int a, int b) {
return a + b;
}
[WebMethod]
public int Subtract(int a, int b) {
return a - b;
}
[WebMethod]
public int Divide(int a, int b) {
return a/b;
}
[WebMethod]
public int Multiply(int a, int b) {
return a * b;
}
}
John