Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static dynamic getObjectDataRequest(string ControllerName,string ActionName,dynamic returnObj,object Params)
- {
- string URL = getAPIURL();
- string RequestURL = URL + "/" + ControllerName + "/" + ActionName + "?";
- string p = Params.ToString().Replace("{","").Replace("}","").Replace(",", "&");
- RequestURL +=p ;
- RequestURL = RequestURL.Replace(" ", string.Empty);
- HttpWebRequest Request = (HttpWebRequest)WebRequest.Create(RequestURL);
- using (WebResponse Response = Request.GetResponse())
- {
- using (StreamReader Reader = new StreamReader(Response.GetResponseStream()))
- {
- string soapResult = Reader.ReadToEnd();
- JavaScriptSerializer js = new JavaScriptSerializer();
- returnObj = js.Deserialize<dynamic>(soapResult);
- }
- }
- return returnObj;
- }
- var obj = new {
- LoginName=UserName,
- Password= Password,
- ApiLoginName=WebAPIUserName,
- ApiPassword= WebAPIPassword,
- ExpiryDays=ExpiryDays
- };
- UserDS oUser = new UserDS();
- oUser = WebAPIHelper.getObjectDataRequest("User", "LoginUserState",oUser,obj);
- Cannot implicitly convert type 'System.Collections.Generic.Dictionary<string,object>' to 'UserDS'
Add Comment
Please, Sign In to add comment