Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending XML across internet to stored procedure
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Sending XML across internet to stored procedure
Miscellaneous
Thread ID:
01317731
Message ID:
01317731
Views:
75
I ran across an article that demonstrated how to use the MS DOM object to send XML data across the web. I was able to get it working up to a point.

I wrote a simple VFP program that creates the DOM object, creates an XML cursor and sends it to an ASP page. The web page receives the XML object and sends (at least in theory) it's XML string to a VFP stored proccedure where it can be processed.

I know the XML is getting to the ASP page, but it doesn't appear that the stored procedure is geting the XML.

When I run the program, it displays the XML and an error code of 80040e14, with the message: "Command contains unrecognized phrase/keyword."

Is it possible to send XML to a stored procedure as a parameter like this or am I kidding myself?

Here is the VFP program:
Set Default To
Set Default To C:\EDSPDF

Close Tables All
Close Database

Set Deleted On

Select 0
Use cltemp

=Cursortoxml("cltemp", "xmltext",1,0,0,"")

xmlhttp = CreateObject("Microsoft.XMLHTTP")
xmlhttp.open("POST", "http://www.idsnetwork.com/testxml.asp", .F.)

xmldom = CreateObject("Microsoft.XMLDOM")
xmldom.loadXML(xmltext)
xmlhttp.send(xmldom)

=MessageBox(xmlhttp.responseText,"System Message",0+64)
Here is the ASP page:
< %@ LANGUAGE="VBSCRIPT" % > 

<!-- include file="adovbs.inc" -->

< %
  
set xmldom = Server.CreateObject("Microsoft.XMLDOM")
xmldom.Load(Request)
strText = xmldom.xml
  
Response.Write strText 

Set oConn = Server.CreateObject("ADODB.connection") 

oConn.Open Application("CMSDSN")

cCmd = "sp_WriteXML('" & strText & "')"
	  
With oConn
	.Errors.Clear
	Set rsCase = .Execute( cCmd )
End With		
% >

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>


</body>

</html>
And here is the stored procedure:
Procedure sp_WriteXML

	Parameters iXMLString

	iXMLString = Alltrim(iXMLString)
	
	Select 0
	Use MyXML

	Go Top
	
	Append Blank
	
	Replace XMLmessage With iXMLString

	Use 

EndProc	
Next
Reply
Map
View

Click here to load this message in the networking platform