Lets say I have WCF Soap Services and I am using this library for SOAP headers
http://wcfextras.codeplex.com/
For example my interface looks like this
[SoapHeader("HelperHeader", typeof(HelperHeader), Direction = SoapHeaderDirection.In)]
[OperationContract]
string GetData(string id);
////////
public string GetData(string id)
{
HelperHeader clientHeader=SoapHeaderHelper<HelperHeader>.GetInputHeader("HelperHeader");
if (clientHeader != null)
return id
}
In Header class i have user name and password for basicHttpbinding.
Now i want to use this method "GetData
" for REST service . (I also have second webHttbinding) . I want to use this Method "GetData" for REST clients , now i find that i can use attributes WebGet and Webinvoke
[OperationContract]
[WebGet(UriTemplate = "testjson/{id}", ResponseFormat = WebMessageFormat.Json)]
string GetData(string id);
My quietion is how i can use One Method "GetData" for both REST and SOAP services and with user name and password .?