1

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.

Julie
  • 353
  • 1
  • 8
  • 17
  • Start by searching [[tag:c#]][[tag:asp-classic]](http://stackoverflow.com/questions/tagged/asp-classic+c%23) – John Saunders Aug 27 '12 at 03:13
  • Hi, John. I've done that (and many variations beyond that), but there is only one post that mentions APIs, and it's about adding a .net COM object. I've actually looked at a few hundred StackOverflow pages in the last several hours on these issues. – Julie Aug 27 '12 at 04:44
  • It looks like the C# app is a WCF service? If it is then yes you can call it from classic asp. We do it but using vb as the service layer. I'll dig through my code and see if I can put something together for you. It's basically just a soap request passing the interface, url and the parameters. – Robert Aug 27 '12 at 13:24

1 Answers1

1

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.

Community
  • 1
  • 1
StuartLC
  • 104,537
  • 17
  • 209
  • 285
  • I'd love to switch this app over, but it's extremely complex, customized and expensive. At least in its current form, we can get support from it if necessary. If we switched it over, we'd have to support it ourselves. A better bet would be to get an entirely new booking system (this one is 9 years old), but that isn't in the cards for two years down the road. I'll give this a shot. – Julie Aug 27 '12 at 17:11