Off course it is possible!
do not forget to change the WebServiceBinding [WebServiceBinding(ConformsTo = WsiProfiles.None)]
try this:
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.None)]
[System.ComponentModel.ToolboxItem(false)]
public class Service : System.Web.Services.WebService
{
[WebMethod(MessageName = "GetTime")]
public string GetTime()
{
return DateTime.Now.ToShortTimeString();
}
[WebMethod(MessageName = "GetTimeWithName")]
public string GetTime(string userName)
{
return "Hello " + userName + " it is " + DateTime.Now.ToShortTimeString();
}
[WebMethod(MessageName = "GetTimeWithNameAndRepetitions")]
public string GetTime(string userName, int repetitions)
{
string response = string.Empty;
for(int i=0; i<repetitions; i++)
response += "Hello " + userName + " it is " + DateTime.Now.ToShortTimeString() + "\n";
return response;
}
}