|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using System.Text;
using System.Threading;
namespace DanielSyncIsNotAMythInSilverlight.Web
{
[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class DanielService : IDanielService
{
// To use HTTP GET, add [WebGet] attribute. (Default ResponseFormat is WebMessageFormat.Json)
// To create an operation that returns XML,
// add [WebGet(ResponseFormat=WebMessageFormat.Xml)],
// and include the following line in the operation body:
// WebOperationContext.Current.OutgoingResponse.ContentType = "text/xml";
[OperationContract]
public string DoWork(string name)
{
Thread.Sleep(3000);
// Add your operation implementation here
return string.Concat(name, " rulez da world");
}
[OperationContract]
public string DoWorkWithTwoParams(string name, string name2)
{
Thread.Sleep(3000);
// Add your operation implementation here
return string.Concat(name, " and ", name2, " rulez da world");
}
// Add more operations here and mark them with [OperationContract]
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I spent most of time on Silverlight, Xna (where i am MVP) and ADO.Net Data Services.