XmlHTTPRequest Object
I'm really struggling with a piece of xml code.What I want to do is talk to
a http server via xml
from my vb app.
But for some reason, the send method of the XMLHTTPREQUEST Object is not
working in my code.
I keep on getting err num 438 "Object doesn't support this property or method"
Why is this? I'm including the code snippet that I'm struggling with.Hope
somebody has an idea.
PS. I reference the Microsoft XML v2.0 & v3.0 from my app, so the send method
is available in the
code in design time, just not in run-time.
Please help.Here's my code
Dim bBoolean As Boolean
Dim xXml As XMLHTTPRequest
Dim xmlFile As DOMDocument
Set xXml = New XMLHTTPRequest
Set xmlFile = New DOMDocument
xmlFile.async = False
bBoolean = xmlFile.Load("c:\req.xml") ' the xml file i'm loading into the
DomDocument
If (bBoolean) Then
' local website, address correct,tested from browser
xXml.open "POST", "http://suprima.cashpower.co.za"
xXml.send (xmlFile) 'this won't work, why??
'xXml.responseXML - want to see the response
End If
[1230 byte] By [
andre] at [2007-11-9 15:26:44]

# 1 Re: XmlHTTPRequest Object
Take the brackets off of "xXml.send (xmlFile) ". It should be "xXml.send
xmlFile"
"andre" <andre@devcotech.co.za> wrote:
>
>I'm really struggling with a piece of xml code.What I want to do is talk
to
>a http server via xml
>
>from my vb app.
>
>But for some reason, the send method of the XMLHTTPREQUEST Object is not
>working in my code.
>
>I keep on getting err num 438 "Object doesn't support this property or method"
>
>Why is this? I'm including the code snippet that I'm struggling with.Hope
>somebody has an idea.
>
>PS. I reference the Microsoft XML v2.0 & v3.0 from my app, so the send method
>is available in the
>
>code in design time, just not in run-time.
>
>Please help.Here's my code
>
>Dim bBoolean As Boolean
>Dim xXml As XMLHTTPRequest
>Dim xmlFile As DOMDocument
>
>Set xXml = New XMLHTTPRequest
>Set xmlFile = New DOMDocument
>
>xmlFile.async = False
>bBoolean = xmlFile.Load("c:\req.xml") ' the xml file i'm loading into the
>DomDocument
>
>If (bBoolean) Then
> ' local website, address correct,tested from browser
> xXml.open "POST", "http://suprima.cashpower.co.za"
> xXml.send (xmlFile) 'this won't work, why??
>
>
> 'xXml.responseXML - want to see the response
>End If
MarkN at 2007-11-11 23:29:58 >

# 2 Re: XmlHTTPRequest Object
The send method requires a variant containing the text body to send to the
web server. You can use the .xml property of the DOM document to POST the
entire XML tree to the Web Server. I have done this before to connect a client
VB program to a servlet.
Here is the corrected code snippet:
Set xXml = New XMLHTTPRequest
Set xmlFile = New DOMDocument
xmlFile.async = False
bBoolean = xmlFile.Load("c:\req.xml")
If (bBoolean) Then
' local website, address correct,tested from browser
xXml.open "POST", "http://suprima.cashpower.co.za"
xXml.send (xmlFile.xml) 'this does work
sResponseXML = xXml.responseXML
End If
"andre" <andre@devcotech.co.za> wrote:
>
>I'm really struggling with a piece of xml code.What I want to do is talk
to
>a http server via xml
>
>from my vb app.
>
>But for some reason, the send method of the XMLHTTPREQUEST Object is not
>working in my code.
>
>I keep on getting err num 438 "Object doesn't support this property or method"
>
>Why is this? I'm including the code snippet that I'm struggling with.Hope
>somebody has an idea.
>
>PS. I reference the Microsoft XML v2.0 & v3.0 from my app, so the send method
>is available in the
>
>code in design time, just not in run-time.
>
>Please help.Here's my code
>
>Dim bBoolean As Boolean
>Dim xXml As XMLHTTPRequest
>Dim xmlFile As DOMDocument
>
>Set xXml = New XMLHTTPRequest
>Set xmlFile = New DOMDocument
>
>xmlFile.async = False
>bBoolean = xmlFile.Load("c:\req.xml") ' the xml file i'm loading into the
>DomDocument
>
>If (bBoolean) Then
> ' local website, address correct,tested from browser
> xXml.open "POST", "http://suprima.cashpower.co.za"
> xXml.send (xmlFile) 'this won't work, why??
>
>
> 'xXml.responseXML - want to see the response
>End If
Greg at 2007-11-11 23:30:52 >

