valon76
asked on
Classic ASP (VBScript) Get Method Not working in web service
Hi,
I am trying to consume a .NET web service in classic asp using the GET method. Here is the web service details:
http://ethor-com.sitepreview.ca/theGeoService.asmx
You can test the return values by:
http://ethor-com.sitepreview.ca/theGeoService.asmx/GetGeoCode?postalCode=92683&key=4f5328db-51e5-408e-ace6-3480f6b64a18
Here is the Classic ASP code that I am using that I have modified from a web snippet:
<%@ Language=VBScript %>
<% Option Explicit
Dim objRequest, objXMLDoc, objXmlNode
Dim strZip, strKey
strZip = "92683"
strKey = "4f5328db-51e5-408e-ace6-3 480f6b64a1 8"
Set objRequest = Server.createobject("MSXML 2.XMLHTTP" )
objRequest.open "GET", "http://ethor-com.sitepreview.ca/theGeoService.asmx/GetGeoCode?postalCode=" & strZip & "&key=" & strKey, False
objRequest.setRequestHeade r "Content-Type", "text/xml"
objRequest.send
Set objXMLDoc = Server.createobject("MSXML 2.DOMDocum ent")
objXmlDoc.async = false
'Response.Write(objRequest .ResponseX ml)
Set objXmlNode = objXmlDoc.SelectSingleNode ("string")
Response.Write( objXmlNode )
%>
I am getting the following error:
-------------------------- ------
Error Type:
Response object, ASP 0185 (0x80020003)
A default property was not found for the object.
/consumeWS2/test.asp
-------------------------- ------
Can anyone provide any assistance with this?
Thanks,
Mike
I am trying to consume a .NET web service in classic asp using the GET method. Here is the web service details:
http://ethor-com.sitepreview.ca/theGeoService.asmx
You can test the return values by:
http://ethor-com.sitepreview.ca/theGeoService.asmx/GetGeoCode?postalCode=92683&key=4f5328db-51e5-408e-ace6-3480f6b64a18
Here is the Classic ASP code that I am using that I have modified from a web snippet:
<%@ Language=VBScript %>
<% Option Explicit
Dim objRequest, objXMLDoc, objXmlNode
Dim strZip, strKey
strZip = "92683"
strKey = "4f5328db-51e5-408e-ace6-3
Set objRequest = Server.createobject("MSXML
objRequest.open "GET", "http://ethor-com.sitepreview.ca/theGeoService.asmx/GetGeoCode?postalCode=" & strZip & "&key=" & strKey, False
objRequest.setRequestHeade
objRequest.send
Set objXMLDoc = Server.createobject("MSXML
objXmlDoc.async = false
'Response.Write(objRequest
Set objXmlNode = objXmlDoc.SelectSingleNode
Response.Write( objXmlNode )
%>
I am getting the following error:
--------------------------
Error Type:
Response object, ASP 0185 (0x80020003)
A default property was not found for the object.
/consumeWS2/test.asp
--------------------------
Can anyone provide any assistance with this?
Thanks,
Mike
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I have revamped your code, use this and tell me if this helps
<%@ Language=VBScript %>
<% Option Explicit
Dim objRequest, objXMLDoc, objXmlNode
Dim strZip, strKey
strZip = "92683"
strKey = "4f5328db-51e5-408e-ace6-3 480f6b64a1 8"
Set objRequest = Server.createobject("MSXML 2.XMLHTTP" )
objRequest.open "GET", "http://ethor-com.sitepreview.ca/theGeoService.asmx/GetGeoCode?postalCode=" & strZip & "&key=" & strKey, False
objRequest.setRequestHeade r "Content-Type", "text/xml"
objRequest.send
Set objXMLDoc = Server.createobject("MSXML 2.DOMDocum ent")
objXmlDoc.async = false
'Response.Write(objRequest .ResponseX ml)
objXmlNode = objXmlDoc.SelectSingleNode ("string")
Response.Write( objXmlNode )
%>
Cheers
^_^
BUGS
<%@ Language=VBScript %>
<% Option Explicit
Dim objRequest, objXMLDoc, objXmlNode
Dim strZip, strKey
strZip = "92683"
strKey = "4f5328db-51e5-408e-ace6-3
Set objRequest = Server.createobject("MSXML
objRequest.open "GET", "http://ethor-com.sitepreview.ca/theGeoService.asmx/GetGeoCode?postalCode=" & strZip & "&key=" & strKey, False
objRequest.setRequestHeade
objRequest.send
Set objXMLDoc = Server.createobject("MSXML
objXmlDoc.async = false
'Response.Write(objRequest
objXmlNode = objXmlDoc.SelectSingleNode
Response.Write( objXmlNode )
%>
Cheers
^_^
BUGS
ASKER
Hi Bugs,
Thanks for your quick responses.
The revamped code that you posted gives the same error.
The consumeWebService() function works on my machine, but on my production server it doesnt ( there seems to be some issue with the MSSOAP.SoapClient and they havent been able to sort it out& it is giving the following error: WSDLReader:Analyzing the WSDL file failed HRESULT=0x80070057 - WSDLReader:No service entry found HRESULT=0x80070057 ) this is why I am trying to do it using the GET method.
Any other ideas?
Thanks for your quick responses.
The revamped code that you posted gives the same error.
The consumeWebService() function works on my machine, but on my production server it doesnt ( there seems to be some issue with the MSSOAP.SoapClient and they havent been able to sort it out& it is giving the following error: WSDLReader:Analyzing the WSDL file failed HRESULT=0x80070057 - WSDLReader:No service entry found HRESULT=0x80070057 ) this is why I am trying to do it using the GET method.
Any other ideas?
ASKER
I was able to get it to work using the following:
Function consumeWebService()
Dim soapClient
Set soapClient = Server.CreateObject("MSSOA P.SoapClie nt30")
soapClient.ClientProperty( "ServerHTT PRequest") = True
soapClient.mssoapinit "http://test.com/eLearningService.asmx?wsdl"
consumeWebService = soapClient.GetSize("BUGS")
End Function
I was referencing the wrong version.
Function consumeWebService()
Dim soapClient
Set soapClient = Server.CreateObject("MSSOA
soapClient.ClientProperty(
soapClient.mssoapinit "http://test.com/eLearningService.asmx?wsdl"
consumeWebService = soapClient.GetSize("BUGS")
End Function
I was referencing the wrong version.
@valon76
Sorry was away for a while so couldn't reply back to you. Did it solve or still facing issues...
Sorry was away for a while so couldn't reply back to you. Did it solve or still facing issues...
Change the below line from your code
Set objXmlNode = objXmlDoc.SelectSingleNode
To
objXmlNode = objXmlDoc.SelectSingleNode
and then goahead with response.write
Trying to response.write an object will throw an error.