Solved

Accessing a method inside an ASP.net application - from classic ASP page.

Posted on 2011-09-16
7
450 Views
Last Modified: 2013-12-09
We have a new asp.net application.

I need to call - one of the methods -  inside one of the aspx pages  - in the above asp.net application -  from an existing classic asp page.

I found couple of ways to acomplish this. But I noticed all those approaches  involve a high degree of complexity for example approches using com or com+. I am wondering if there is any other simpler way by which I can accomplish the same.

I am not sure if I can accomplish this by means of a sql stored procedure and accessing it directy from the classic asp page itself. If so, I no longer need the call to asp.net page.

Thanks,

RP
0
Comment
Question by:SasDev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
7 Comments
 
LVL 1

Author Comment

by:SasDev
ID: 36551245
Additional information: The asp.net application is for retrieving a file from a sql Filestream. If I can accomlish the same functionality from classic asp page itself directly - then the problem is solved. But I am not sure if that works.
0
 
LVL 7

Accepted Solution

by:
Kishan Zunjare earned 500 total points
ID: 36553760
I would suggest you to create separate library (.DLL)   and then you can access that code in both ASP and ASP.NET Pages...

Or You can also create simple web service and access in both ASP and ASP.NET. this will be correct approach.

Let me know.
0
 
LVL 1

Author Comment

by:SasDev
ID: 36574383
Thanks for your sugestion. I would like to choose the web service path.

I created a test web service with a test web method like below. I created the webservice as part of the asp.net application.

Public Class FileSteamGatewayFacade
    Inherits WebService
    <WebMethod(Description:="Simple method")> _
    Public Function GetName(ByVal sName As String) As String
        Return "The name is: " & sName
    End Function

In the classic asp page, I have the following code.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title></title>
</head>
<body>
<%

'Option Explicit
Response.Write "Test ASP Page"

Dim objRequest, objXMLDoc, objXmlNode
Dim strRet, strError, strName

strName = "Julian"

Set objRequest = Server.CreateObject("MSXML2.XMLHTTP")

With objRequest
.open "GET", "http://localhost/FileStreamDemo/test/FileSteamGatewayFacade.asmx/GetName?sName=" & _
strName, False
.setRequestHeader "Content-Type", "text/xml"
.setRequestHeader "SOAPAction", "http://localhost/FileStreamDemo/test/FileSteamGatewayFacade.asmx/GetName?sName=" & _
strName
.send
End With

Set objXMLDoc = Server.CreateObject("MSXML2.DOMDocument")
objXMLDoc.async = false

Response.Write(objRequest.statusText)

'If myXML.loadXML(SoapRequest.responseXML.Xml) Then
'Set objXMLNode = myXML.selectSingleNode("GetNameResponse")

'if Not objXMLNode Is Nothing then
'strRet = objXMLNode.NodeTypedValue
'Response.Write("Response:" &sRet)
'End If
'Else
'strError = myXML.parseError.reason
'Response.Write("Error" & strError)
'EndIf

 %>

</body>
</html>

The first line response.write it working. The call to the webservice is not working. It ends up with an internal error 500.

Please let me know your suggestions.

Thanks

RP
0
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
LVL 1

Author Comment

by:SasDev
ID: 36575750
I am able to resolve it by using an alternative approach using SOAP/WSDL.

Thanks

RP
0
 
LVL 1

Author Comment

by:SasDev
ID: 36589537
I've requested that this question be closed as follows:

Accepted answer: 0 points for SasDev's comment http:/Q_27312629.html#36575750

for the following reason:

Resolved.
0
 
LVL 1

Author Comment

by:SasDev
ID: 36589538
I would like to add points to Kishan who provided suggestions for resolving this.
0
 
LVL 1

Author Closing Comment

by:SasDev
ID: 36589540
Resolved.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Securing WEBAPI on Azure 2 54
write html in textarea and record it into a database table 3 37
Shared Service Environment 2 52
CSS styling problem 3 21
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This video teaches users how to migrate an existing Wordpress website to a new domain.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question