You are on page 1of 2

SMVEC page no.

:

WEB SERVICE



PROGRAM CODING:

using System;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the
following line.
// [System.Web.Script.Services.ScriptService]
publicclassService : System.Web.Services.WebService
{
public Service () {

//Uncomment the following line if using designed components
//InitializeComponent();
}

[WebMethod]
publicstring HelloWorld() {
return"Hello World";
}

[WebMethod]
publicString ReverseString ( String InString )
{
// Check null String
if ( InString == null ) returnnull ;

Int32 intSize = InString.Length ;
char[] arrayInString = InString.ToCharArray() ;
char[] arrayOutString = newchar[intSize] ;

for (Int32 i = 0 ; i < intSize ; ++i)
arrayOutString[i] = arrayInString[intSize-i-1] ;

returnnewString(arrayOutString) ;
}
}



SMVEC page no.:


OUTPUT:

You might also like