using System;
using System.Xml.Linq;
namespace ZSL.IBanking
{
public class IBankingMWService : IIBankingMWService
{
//This method is exposed to the client based on request data it will give result
public string ExecuteProcessRequest(string reqData)
{
try
{
return CreateReturnResult(1, "Success");
}
catch (Exception ex)
{
return CreateReturnResult(1, ex.Message);
}
}
//Create result as XML format
private string CreateReturnResult(int errorNo, string errorMsg)
{
return (new XElement("Result",
new XElement("ErrorNo", errorNo.ToString()),
new XElement("Message", errorMsg))).ToString();
}
}
}
using System.ServiceModel;
using System.ServiceModel.Web;
namespace ZSL.IBanking
{
[ServiceContract(Namespace = "")]
public interface IIBankingMWService
{
[OperationContract]
[XmlSerializerFormat]
[WebInvoke(Method = "POST", UriTemplate = "/Execute/XML", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Bare)]
string ExecuteProcessRequest(string xml);
}
}
Output :

Ranjeet PatraPosted Apr 26, 2017, 8:48 AM