C# API routines integrated into ASP Classic application? - c#

We have a classic ASP application that isn't going away. We have a new marketing system that we need to access via their API (WDSL). All of their examples are in C#, which I'm trying to learn enough about today to pull this off.
I downloaded Visual Web Developer 2010 Express and have made some progress. Then I realized that I don't know if it's possible to call a C# .net routine from a classic ASP app. I'm a generalist. I know some classic ASP vbscript, some javascript, some AJAX, stuff like that. If it hasn't been necessary at my current job, then I don't know it.
Is it possible to call c# .net files from a classic ASP application? I'd love to know just this, because I'd hate to get it worked out where I can talk to the API, and then find out I can't use what I've written. Everything I've found on StackOverflow has been .net VBScript files off .asp apps. (Heh. And still have to figure out how to deploy what I've done. lol.)
If it's not possible to run C# from .asp pages, then I need to rewrite in VBScript, and I don't know how to convert C# to VBScript. If I can't run c# off .asp, any conversion utilities out there for short routines C#->VBScript? How difficult/stupid is conversion?
(The API url is in the form of https://secure.ourspiffynewmarketingapp.com/API/1.2/Service.svc?wsdl - don't know if that matters, but figured I'd say so, since I've run across some https issues on my searches.)
I've been on StackOverflow off and on for 11 hours, and I still don't know the answers to these questions.
I don't need to get the whole thing figured out tonight, but I do need to confirm that I can access the API, and since all of the examples are in C#, which I've never even LOOKED at before today, I can't even confirm that.

I couldn't find exactly how I implemented it but did find this article that is pretty much the same thing.
classic-asp-soap-request

Re : Is it possible to call c# .net files from a classic ASP application?
In order to access 'dll' (assembly code) you need to map your top level (exposed components) as COM callable wrappers, and register these as COM components. You can then use them in your ASP Classic just as any other COM component Server.CreateObject('MyProgIdGoesHere')
Have a look here if you need to call SOAP web services from ASP Classic, using the Microsoft.XMLHTTP component (from memory there might have been a server version of this as well). You will need to build up the SOAP request and parse the response yourself, however :(
Edit If you are feeling brave, you might also look at starting the conversion process from ASP Classic across to .NET.

Related

c# .Net Visual Studio show execution path that lead to page display

I have inherited a mostly c# MVC application that has been around for years and is quite the collection of mySQL, stored procs, Web Forms, MVC, WebAPI, JS, jQuery, Angular, and I think there is some React in there as well. I am looking for a tool where I can start the application, get to a particular page, then look at what classes and methods were called to get there.
I know the application needs refactored and, frankly, completely rewritten, and that is happening. We just also need to support this tool as another team develops the next version.
Thanks,
Sammer
You can use my Runtime Flow tool to quickly find C# classes and methods responsible to display a particular page.

Implementing a Web Service Server in Windows CE 2013

I have a smart device (Windows CE 2013) that just got the requirement to be controlled from a number of different devices, to do this, we decided to serve a web page from the device that allows it to be controlled.
I've also read that compact framework doesn't support ASP.NET so I'm intending to serve a static webpage that contains a javascript application that calls web services hosted on the device.
I also found this link explaining how to serve a SOAP Service in C++, but it seems old, and I'd prefer to do this in C# as it's my preffered language and I already have some code on it
I'm not quite happy with this solution, am I missing something? Can't I really do this in C#?
You could try this library for .NET https://github.com/ServiceStack/ServiceStack .
It is a free in case if you are using branch v3 form a github.
There's nothing built-in in the CF that provides web server capability. Windows CE has always shipped with an HTTPD server, but, honestly, it sucks and can't be integrated with managed code anyway.
We solved this problem long ago by creating our own IIS-like web server implementation (available commercially). You could do something similar as well - it's just a lot of Socket work. That trivializes the complexity of concurrent request handling and providing an IIS-like object model, but you get the idea. Basically you have to write the whole thing.
The main answer to this is to use Mongoose (or the MIT-licenced equivalent Civetweb). They are C webservers designed for just your task - an embedded web server.
They are really easy to implement, 1 C source file added to your project, give it an array of options, and you're done. See the examples. It has plenty of features and is fast, and small (40kb compiled!). They say it takes 5 minutes to get going with it, and they're right - I tend to use it to add webserver functionality for normal applications now.

How can we integrate our C# code in Drupal CMS

We have C# code, which is backend for us. Now we need it to be used in our website which is developed in Drupal.
As far as I know, there is no easy way to do it. You basically have 2 options:
Rewrite the code in php. It may be not possible to do it however, it depends on what the code does.
Expose c# code as an external webservice (e.g. with WCF) and then consume the webservice. Drupal is able to do it - more info.
A sloppy solution would also be to display your C# page in the Drupal page with an iframe. I do also agree with empi's answer to rewrite the code in php or a web service depending on your requirement.
You can build DLL project (class library) in C# and use the DLL as reference back in the drupal project.
Not sure about this, and never done before.
You better research more.
But, the best way to use the .NET code in another application is to build the required code into DLL project and use in whichever language you want to use.

Silverlight - Send/Receive Data at runtime with JAVA

Yesterday I asked about what technology should I use to create dynamic web content here:
PHP, AJAX and Java
The suggested methods were JSP, JQuery, etc. But I thought maybe because I'm a .Net developer and I don't have any experience in web development but I have experience in WPF and C#, maybe I should go with Silverlight but the main problem here would be how can I communicate with the core part of my system which is implemented in Java?
So the main question would be: What is the best [and easiest to learn] method to send a piece of data to the Java part, get the result and use it in silverlight? A tutorial or simple example would be nice.
Thanks a lot in advance.
You should use Java Web Services as stated. Use WCF to invoke the Java WS by adding a Service Reference in Visual Studio by its url, then use the proxy classes generated automatically (located in Reference.cs) to invoke the WS. This is easy but remember SilverLight WS invocations are always asynchronous, so you must cath the OnCompleted event to get the results of the invocation. WS are slow but if the machines are in the same LAN, invocation could take a few milliseconds.
I think pipes are not your solution as SilverLight executes in a Sandbox and have many restrictions on what you can do.
This will depend on many factors, however a relatively easy approach would be to use Java Web Services. On the .NET side, WSDL will be picked up and transformed into proxy class by WSDL.exe from the Windows SDK. If, however, these two systems are on the same server (and intend on staying this way), you may decide to use pipes.

Web developer moving to Winforms

I have been doing ASP.NET / C# development for several years now. I have recently been offered a project that will need to be a winforms application (I am assuming .net 2.0).
Specs:
Winforms applicaton
Application will
have "testing for understanding
questions"
Must support flash and camtasia
files (these are "lessons")
I have done winforms development before, although nothing that is this involved. As there is a potential need for this application to be generic enough to apply to multiple different "disciplines", I would like to make the application generic enough to be easily configurable. The caveat here is that the application will need to be run from a CD-ROM and that I cannot rely explicitly on an internet connection. I was thinking of using something like SQL-Lite to support the configuration of the application. There will not be the need for updating the application as it will not be updated (at least I don't think, I guess there is the possibility of the application calling a webservice and configuring its-self based upon returned values).
With the requirements of supporting Flash and Camtasia, along with making this application generic enough to support different "disciplines", and my self being an ASP.NET developer, does anyone have an recommendations or tips/ tricks to look out for? Has anyone done something like this before?
Thanks in advance.
I'd start by writing a user control that can be used to either display a video file (presumably the output from Camtasia) or a Shockwave app. Once you have that user control, I'd then move on to look at the overall app.
If you're using Winforms, and the software is supposed to run from the CD (instead of merely be installed from CD) you'll need to have the DotNet framework already on the computer I think - but then I'm not an expert in deployment.
I find the application model in Winforms to be a lot easier than WebForms, but then I was "raised" in thick clients, so I suppose I would.
I would also, whilst agreeing to WinForms if needs really must, encourage the client to give consideration to using WPF instead - which opens up the idea that you could also provide access over the web using a simlar interface using Silverlight...
Just a few thoughts anyway - good luck with it...

Categories