Accessing XML Web Services?

Hi!

It would seem that JodoHost does not support accessing XML Web Services. On our previous hosting company I used the statement Set oXmlsrc=CreateObject("MSXML2.FreeThreadedDOMDocument.4.0")

What I am getting here is Microsoft VBScript runtime error '800a01ad'

ActiveX component can't create object: 'MSXML2.FreeThreadedDOMDocument.4.0'

And tech support says it is a security issue.

There are thousands of sites that use this type of mechanism to access remote data from remote sites.

This needs to be fixed.
 
Why do you need Free Threaded model objects?
This code is far from standard from what I know. I have a couple of sites utilizing XML services heavily, and none of them need this. Rental threaded versions are available and work fine here.
 
Hi Subspace:

If I remove the FreeThreaded I get the following error:

msxml3.dll error '80004005'

The XSL stylesheet document must be free threaded in order to be used with the XSLTemplate object

Any ideas how I can get around this?

Additionally, it looks like they do not support version 4 yet.
 
Are you mixing Free Threaded and Rental model objects?
Are you putting a loaded template in an application state variable or something like that?
What are you trying to do exactly? :)
 
Hi Subspace!

Here is most of the code, except for some elements I removed for clarity.

I am not mixing the rental model. This is my original code that worked fine on the previous hosting company.

I tried removing FreeThreaded after reading your suggestion and got the previously mentioned error regarding the XSLTemplate

Any ideas would be greatly appreciated.


Dim oXmlsrc, oRootNode, oXslsrc, newXML, re, oXslTmpl, oXslProc
' If you're using an XSLTemplate and XSLProcessor object,
' you have to use the FreeThreaded versions of DOMDocument

Set oXmlsrc=CreateObject("FreeThreadedMSXML2.DOMDocument.4.0")
Call oXmlsrc.setProperty("ServerHTTPRequest", True)
oXmlsrc.async=False

Set oXslsrc=CreateObject("FreeThreadedMSXML2.DOMDocument.4.0")
Call oXslsrc.setProperty("ServerHTTPRequest", True)
oXslsrc.async=False

Set oXslTmpl = Server.CreateObject("MSXML2.XSLTemplate.4.0")

' If I haven't posted the form first, then load my unaltered XML.
' If I'm posting info to resort or edit, then build my XML from that.

'On Error Resume Next 'debugging code

If Request.Form("acctname") = "" Then
Call oXmlsrc.load(sVerifyUrl)
'Response.Write "<!-- " & oXmlSrc.xml & " -->" 'debugging code
newXML=oXmlsrc.xml
Set re=new regexp
re.pattern=" xmlns.+?>"
newXML=re.replace(newXML,">")
Call oXmlsrc.loadxml(newXML)
else

'Build a DOM that looks exactly like the one coming from the web service
'That way XSL can't tell the difference.

'The XML DOM is empty at this stage so we need to load it with the root node
Call oXmlSrc.loadXML("<accountdata/>")

'Set a variable to point to the root node
Set oRootNode = oXmlsrc.documentElement

'Get the values submitted

sName = Request.Form("acctname")

'Create a new <acct_num> element
Set oAcct = oXmlSrc.createElement("acct_num")

'Set the text of the <acct_num> element to the account number value submitted
oAcct.Text = sAcct

'Append the new <acct_num> element as a child of the root node <accountdata>
Call oRootNode.appendChild(oAcct)

'xml is now <accountdata><acct_num>?</acct_num></accountdata>


' TODO: If want, you can remove this line entirely to prevent any
' possible accidentaly release of data into an HTML comment on
' the production page. It's for testing purposes.
'Response.Write "<!-- " & oXmlSrc.xml & " -->"

end if

Call oXslsrc.load("https://www.secured.domain.com/verifyacct.xsl")
Set oXslTmpl.stylesheet = oXslsrc
Set oXslProc = oXslTmpl.createProcessor()
oXslProc.input = oXmlsrc
 
Set oXslsrc=CreateObject("MSXML2.FreeThreadedDOMDocument")

Works here, it least it changes the error message to "The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document.", but that's no surprise since no stylesheet is actually loaded in this code.

Indeed MS XML 4.0 doesn't seem to be installed.
 
Hi Subspace!

I get the same error now. But type in the path to my xsl file it shows as well formed. I think I am using a feature in it that is not supported prior to 4.0.

Does JodoHost have a server that 4.0 loaded on it?

Thank you.
 
Back
Top