public string In() { //Use the value from a input header Header soapHeader = SoapHeaderHelper <Header> .GetInputHeader("MyHeader"); if (soapHeader != null) { return(soapHeader.Value); } return(null); }
public void InOut() { //Use input header Header soapHeader = SoapHeaderHelper <Header> .GetInputHeader("MyHeader"); if (soapHeader != null) { //and set the value back in the output header soapHeader.Value += " InOut"; SoapHeaderHelper <Header> .SetOutputHeader("MyHeader", soapHeader); } }
public bool DoWork() { AuthHeader authentication = SoapHeaderHelper <AuthHeader> .GetInputHeader("AuthHeader"); if (@"userName".Equals(authentication.Username) && @"pwd".Equals(authentication.Password)) { //Do your thing return(true); } else { //if authentication fails return(false); } }
public System.Data.DataSet Read(string targetCategory, string viewName, NBK.Common.Foundations.Utilities.FilterCriteria[] filterCriteria, NBK.Common.Foundations.Utilities.SortCriteria[] sortCriteria, int startIndex, int numberOfRecords, ref int totalNumberOfRecords) { try { Header = SoapHeaderHelper <WebServiceHeader> .GetInputHeader("Header"); const string location = "NBK.EAI.Services.Web.NBKCentral.Read"; using (LogEnterExit lee = new LogEnterExit(location)) { string _instanceName = ""; if (string.IsNullOrEmpty(viewName)) { _instanceName = "READ_" + targetCategory + "_VW_" + "Default"; } else { _instanceName = "READ_" + targetCategory + "_VW_" + viewName; } //Do data validation before delegating to Request Router CheckArgument(targetCategory != null && targetCategory != "", "Target Category cannot be null or empty"); //Delegate the call to the Request Router class DataSet result = RequestRouter.Read(GetCallContext(), targetCategory, viewName, filterCriteria, sortCriteria, startIndex, numberOfRecords, ref totalNumberOfRecords); return(result); } } catch (Exception ex) { BaseException.Publish(ex); //LogCallContext(); throw ExceptionUtils.GetSOAPException(ex); } }
/// <summary> /// Ověření tokenu /// </summary> /// <returns></returns> private bool VerifyToken() { this._appId = String.Empty; // Získání tokenu z hlavičky AuthToken authToken = SoapHeaderHelper <AuthToken> .GetInputHeader("AuthToken"); string token = (authToken == null ? String.Empty : authToken.Value); if (String.IsNullOrWhiteSpace(token)) { SoapHeaderHelper <ActionResult> .SetOutputHeader("ActionResult", new ActionResult() { StatusId = ActionStatus.InvalidToken.ToShort(), StatusDesc = "Invalid token" }); return(false);; } // Ověření platnosti tokenu Token tkn = new Token(Bc.SecretKey, "AuthToken", token); TokenStatus stat = tkn.Verify(); this._appId = tkn.Id; if (stat != TokenStatus.Valid) { SoapHeaderHelper <ActionResult> .SetOutputHeader("ActionResult", new ActionResult() { StatusId = ActionStatus.InvalidToken.ToShort(), StatusDesc = "Invalid token" }); return(false);; } return(true); }