views:

808

answers:

2

Hello everyone,

I have some legacy classic ASP code (not ASP.Net, but ASP), and I want to call a WCF service which I developed by using VSTS 2008 + C# + .Net 3.5 and using basic Http Binding.

Any reference samples? I heard the only way is -- we have to manually generate the tricky SOAP message, and parse SOAP response, is that true? :-)

thanks in advance, George

+1  A: 

Here's one providing an end-to-end example with sample code: http://code.msdn.microsoft.com/CallWCFfromASP

Marc

marc_s
+1  A: 

Another technique is to use C# to create a small COM component that calls the web service. Classic ASP would call the COM component and not know that it's dealing with web services at all.

John Saunders
Good idea, John, do you have any tutorial to make a reference?
George2
Unfortunately, I do not. Search for COM Interop on MSDN, and you'll find it easily enough. The technique also helps get rid of Classic ASP, little at a time, by breaking pieces off into COM objects (written in .NET).
John Saunders
Sorry John, 1. it should be my problem which does not make myself understood. I need to integrate legacy code (classic ASP), why do you say "get rid of Classic ASP"? Correct me if I am wrong to understand your points. 2. What is the pros and cons compared of using the method mentioned by Marc?
George2
I do not mean get rid of Classic ASP in the short term. In the long term, it gets more and more expensive to maintain. I only mentioned that a similar technique can be used to break out pieces of the Classic ASP code and make them work in .NET (still called by Classic ASP). Eventually, there's little left other than ASP calling COM objects. At that point, it's pretty easy to make that page an .ASPX page. 2) I think mine is easier to maintain - C# instead of VBScript, better tools, etc.
John Saunders
Thanks John, a little confused. Do you mean wrap classic ASP code into COM or wrap the code which calls WCF into COM to let classic ASP call? :-)
George2
Thanks John, I have a related question here, appreciate if you could give me some advice and help there. http://stackoverflow.com/questions/1183943/how-to-call-com-object-from-classic-asp
George2