I wish to use a particular API from my ASP Classic code. The API comes in the form of a DLL with .h and lib file. I have managed to use the api from my own Windows C++ application. I now wish to do the same for ASP. There is also a .NET Wrapper for this API which I haven't examined yet.
Furthermore, we will at some stage in the future migrate to ASP .NET or Python Django.
How would you recommend I wrap this API?
Thanks,
Barry
The best way is to wrap the DLL API that you need to use as a COM object.
The original ASP model makes use of COM to interface with native code.
Related
I'm very new to Asp.Net Web Apis(which Microsoft has made a part of MVC templates though we can use Web Api template independent of MVC)....Just a little background.
Coming back to my problem when my Web Service is called by a user then along the line of what my Web Service is serving comes a point where I have to deserialize a Json file to a generic C# collection and cache it in-memory and then the code inside one of the Controller actions(which is obviously a get method) checks for the in-memory cache and if it has that deserialized C# collection it gets it from there else its calls another method inside the controller which caches this generic collection in memory.
My question is ...is this possible to cache the stuff for a Web Api like what I described above...I'm quite familiar with Asp.Net page life cycle,caching and sessions etc. But not with Web Api....And my above explanation is just an abstract idea...not sure how to execute it, will it work? If yes then what namespaces would come in handy like System.Runtime.Caching or System.Web.Caching.
Your answers will be highly appreciated....
In the .NET Framework 3.5 and earlier versions, ASP.NET provided an in-memory cache implementation in the System.Web.Caching namespace. In previous versions of the .NET Framework, caching was available only in the System.Web namespace and therefore required a dependency on ASP.NET classes. In the .NET Framework 4, the System.Runtime.Caching namespace contains APIs that are designed for both Web and non-Web applications. ASP.NET Web API doesn't have dependency in System.Web.dll so I recommend you to using System.Runtime.Caching, you can put your caching logic anywhere even in separate .dll file and use it in your ASP.NET Web API project.
What is the best way to call a WebService via C++ ??
I want to avoid to use a C# Wrapper DLL with a COM Interface, so is there a Native way without using Sockets? In my current project the interface is trivial, but if there would be also a proxy generation it would be definitely the better choice :-)
I've spent a fair amount of time researching this, as I would rather not find out through trial and error.
Can I use the ASP.NET AJAX Control Toolkit in my MVC4 Application? Is there Microsft documentation that gives definitive information?
Yes, I know that MVC4 does not have VIEWSTATE. I am using the Razor view engine.
The documentation for the toolkit states specifically that it is for web forms, not mvc.
http://ajaxcontroltoolkit.codeplex.com/
If there is a specific piece of functionality you required, then you might want to see if there is a plugin available for jquery to replicate it.
http://api.jquery.com
I am very basic in VB6 so sorry if I am asking an obvious question!
We have an old VB6 application and currently we need to do some re-enhancements in it. I want to somehow connect it to a WCF webservice to send and get files (WCF will take care of loading and storing them in DB).
Based on my researches, it is possible based on This article and some others, Now I am wondering if is it required to have .NetFramework installed on systems to do this?
You can use RESTFUL WCF Service and set the UriTemplate attribute for the method(OperationContract).
Full article for creating REST service
The article you have linked suggests that the VB6 code should call a .Net wrapper for the WCF service.
If you do that, then yes, certainly you will require the .Net framework to be installed on the machine that runs the VB6, because that machine will also have to run the .Net wrapper.
Does a SharePoint client API exist for C++, MFC users?
There's a NET one, but I prefer to access without using NET.
There is no C++ API, but you can access all webservices through C++ if you really want to.
I guess Managed C++ would be easier though.