How can I use bootstrap-table to get data from webapi (need [Authorize]) - bootstrap-table

How can I use bootstrap-table to get data from webapi (need [Authorize])
Error:

Related

cannot get Object(or JObject) in asp.net web api with get method and appliction/json

I cannot get Object in asp.net web api method via get method.
if I use post ,it's working
if I use get ,it's 'null'
my settings:set 'application/json' when I request.
this is my code screenshots images

How OData works in AspNet MVC without change any code

To enable OData after installing the Microsoft ASP.NET Web API 2.2 package, the only thing to do is add the attribute EnableQuery and return IQueryable.
If the attribute EnableQuery is only metadata, what change in the framework?
I mean, when an request arrive the framework matches the url with the Route Table and then create the controller to manage the request. What does change with OData?
EnableQueryAttribute derives from ActionFilterAttribute, which means it can affect the result of an action via its OnActionExecuted method (called internally by Web API). Take a look at the source code to see what EnableQuery is really doing.

How to Ignore WCF servie XML response ordering while Deserialization XML to Service Object

I am getting WCF service response as XML.But while I am trying to
De-serialization that XML to Object,I am getting NULL for some properties.But
I have values for those properties in XML.When I see the Proxy class they
mentioned Ordering like
[System.Xml.Serialization.XmlElementAttribute("ALARMDATA",
Order = 42)] for all properties.Because of this order I am getting null values.
I tried to change the order of those properties in proxy class then it is
working fine.But this not good approach. Here I don't have control over
service and Proxy class changes
Please help me on this.

Flex Magento connection using SOAP

I am trying to connect Flex with Magento using SOAP API. but i am stuck with an error:
faultCode:EncodingError.
faultString: Array of input arguments did not contain a required parameter at position 1.
I am requesting login function of magento like this:
xmlRequest = <'login'><'username'>username'<'/username'><'apiKey'>apiKey<'/apiKey'><'/login'>";
What is the correct way to call login function of magento using soap from FLex?
How can i get rid of the above error?

How Do I Get RouteData Values from a Web Service in .Net 4.0

I am trying to extract an id number from a URL using a web service so that it can be used as a parameter for a where clause in a select statement that produces data from a database based on the id number of a record. That data will then be passed back to the page to populate an element in a jQuery modal popup widow.
Everything works fine with a static id number (ex: string postid = "120"), but I don't know how to get the id number from the URL. I'm using Routing in .Net 4 and the method for accessing Routing in pages does not work in a web service. In pages I just do stuff like var id = RouteData.Values["id"]; and that gets the id, but when i did it in a web service I got an error:
CS0120: An object reference is required for the non-static field,
method, or property 'System.Web.Routing.RouteData.Values.get'
Summary:
I have web service accessed form a details page where I want to get RouteData for the page making the request. I want to do this just as easily as I can on a page using RouteData.Values which is just as easy as the now the obsolete Request.Querystring.
Now I am more confused because although I could easily add a new route for the web service I don't know I would call that using jQuery Ajax because of the webservice.asmx/webmethod syntax.
Right now I have URL: "../webservices/googlemaps.asmx/GetGoogleMap" in my jQuery Ajax, but that is not a real URL. It only exists in jQuery somewhere and the way to call the service using just JavaScript is no a real URL either, its webservice.webmethod() which in this case would be googlemaps.GetGoogleMap().
I will try registering a route for webservices/googlemaps.asmx/GetGoogleMap/postid, but I doubt it will work because GetGoogleMap is not a directory or a querystring.
Get current http request and use RequestContext property to get request context - it has current routing data. For example,
var id = HttpContext.Current.Request.RequestContext.RouteData.Values["id"];
In case of WCF based web service, make sure that service is participating in ASP.NET pipeline (see ASP.NET Compatibility)
EDIT: Sorry for misleading answer - the above will not work unless web service url is registered in routing engine. However, it may not solve your issue of retrieving the id - what kind of service implementation are you using? Are you making a GET request or POST request? Typically, web service handler (asmx) or WCF pipeline should convert GET/POST parameters to method parameters. Post your web service code and how you invoke it.

Resources