Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Microsoft.xmlhttp vs. msxml2.serverxmlhttp
Message
From
30/03/2017 08:02:06
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
01649513
Message ID:
01649522
Views:
46
>Hi there,
>
>in an app I used xmlhttp (createobject("Microsoft.xmlhttp")) which is easy to use but is limited in its
>possibilities like setting timeout-values. So I changed it to serverxmlhttp (createobject("msxml2.serverxmlhttp"))
>which worls as well and has a lot more
>properties to use.
>Everythings seems to work as well as before but I would like to know if there are any pitfalls
>I haven't recognized yet and if there is more I should consider?
>
>Thanks in advance
>
>Thomas

Things that, according to Microsoft, you should do:

a) use MSXML2 instead of Microsoft (MSXML2 will give you XML 3 or 6, Microsoft will give you XML 1 or 2...)

b) use 6.0 and use 3.0 as a fallback (MSXML2 3.0 is equal to MSXML2 version independent)

c) use serverXMLHTTP for server to server communication, and for more robust and secure operations.

So, summing up:
LOCAL XMLHTTP AS MSXML2.ServerXMLHTTP60

SET ASSERTS ON

TRY
	m.XMLHTTP = CREATEOBJECT("MSXML2.ServerXMLHTTP.6.0")
CATCH
	TRY
		m.XMLHTTP = CREATEOBJECT("MSXML2.ServerXMLHTTP.3.0")
	CATCH
		m.XMLHTTP = .NULL.
	ENDTRY
ENDTRY

ASSERT !ISNULL(m.XMLHTTP) MESSAGE "A proper XMLHTTP object could not be instantiated"
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform