XML Response Format

wwHTTPSQL always returns data in XML format. There are a number of different responses available:

Cursor Result
Cursors can be returned in two ways depending on the nTransportMode property:

0 - XML
Cursor results are returned as standard wwXML return values which include embedded schemas. This interface is the most complete and provides the cleanest generic XML interface. However it's also slower than mode 2.

1 - VFP 7 CursorToXML format
This XML format is significantly faster on both the client import and server export and conforms closely to the Microsoft XSD schema specification used with .NET DataSets.

2 - EncodeDbf encoded Cursor
Returns the cursor as a binary string. Only cursor results are returned this way, while all other results continue to be returned in XML format. nTransportMode=2 can be significantly faster both on client and server side decoding especially for large sets of data. Use this mode only if you send a fair amount of data and you understand some of it's limitations.

The following shows an XML cursor response (nTransportMode 1):

<?xml version="1.0"?>
<wwhttpsql>
<Schema name="TSQLQuery" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes">
   <ElementType name="TSQLQuery" content="eltOnly" model="closed" order="many">
		<element type="row" />
	</ElementType>
	<ElementType name="row" content="eltOnly" model="closed" order="many">
		<element type="pk"/>
		<element type="custpk"/>
		<element type="company"/>
		<element type="name"/>
		<element type="address"/>
		<element type="city"/>
		<element type="state"/>
		<element type="zip"/>
		<element type="country"/>
	</ElementType>
	<ElementType name="pk" content="textOnly" model="closed" dt:type="i4">
		<AttributeType name="type"/>
		<attribute type="type" default="i4"/>
		<AttributeType name="size"/>
		<attribute type="size" default="4"/>
	</ElementType>
	<ElementType name="custpk" content="textOnly" model="closed" dt:type="i4">
		<AttributeType name="type"/>
		<attribute type="type" default="i4"/>
		<AttributeType name="size"/>
		<attribute type="size" default="4"/>
	</ElementType>
	<ElementType name="company" content="textOnly" model="closed" dt:type="string">
		<AttributeType name="type"/>
		<attribute type="type" default="string"/>
		<AttributeType name="size"/>
		<attribute type="size" default="80"/>
	</ElementType>
	<ElementType name="name" content="textOnly" model="closed" dt:type="string">
		<AttributeType name="type"/>
		<attribute type="type" default="string"/>
		<AttributeType name="size"/>
		<attribute type="size" default="80"/>
	</ElementType>
	<ElementType name="address" content="textOnly" model="closed" dt:type="string">
		<AttributeType name="type"/>
		<attribute type="type" default="string"/>
		<AttributeType name="size"/>
		<attribute type="size" default="2147483647"/>
	</ElementType>
	<ElementType name="city" content="textOnly" model="closed" dt:type="string">
		<AttributeType name="type"/>
		<attribute type="type" default="string"/>
		<AttributeType name="size"/>
		<attribute type="size" default="40"/>
	</ElementType>
	<ElementType name="state" content="textOnly" model="closed" dt:type="string">
		<AttributeType name="type"/>
		<attribute type="type" default="string"/>
		<AttributeType name="size"/>
		<attribute type="size" default="10"/>
	</ElementType>
	<ElementType name="zip" content="textOnly" model="closed" dt:type="string">
		<AttributeType name="type"/>
		<attribute type="type" default="string"/>
		<AttributeType name="size"/>
		<attribute type="size" default="10"/>
	</ElementType>
	<ElementType name="country" content="textOnly" model="closed" dt:type="string">
		<AttributeType name="type"/>
		<attribute type="type" default="string"/>
		<AttributeType name="size"/>
		<attribute type="size" default="25"/>
	</ElementType>
</Schema>
<TSQLQuery xmlns="x-schema:#TSQLQuery">
	<row>
		<pk>115</pk>
		<custpk>132660</custpk>
		<company>ShelbyNet.com</company>
		<name>John Harvey</name>
		<address>5780 Crievewood</address>
		<city>Memphis</city>
		<state>TN</state>
		<zip>38135</zip>
		<country>United States</country>
	</row>
	<row>
		<pk>154</pk>
		<custpk>110703</custpk>
		<company>SnappySoft</company>
		<name>Rosty Vygovsky</name>
		<address>39 Dolores Drive</address>
		<city>Valley Stream</city>
		<state>NY</state>
		<zip>11581</zip>
		<country>United States</country>
	</row>
</wwhttpsql>


No result set response

<?xml version="1.0"?>
<wwhttpdata>
	<result>OK</result>
</wwhttpdata>

Result Value returned from a Stored procedure or Method call on the server class

<?xml version="1.0"?>
<wwhttpsql>
<returnvalue>
	<pnid>261</pnid>
</returnvalue>
</wwhttpsql>

Return values can be combined with a cursor result as well:

<?xml version="1.0"?>
<wwhttpsql>
<Schema>
... Schema here
</Schema>
<TSQLCursor>
...XML data for cursor here just as plain cursor result.
</TSQLCursor>
<returnvalue>
	<pnid>261</pnid>
</returnvalue>
</wwhttpsql>


Error Response

<?xml version="1.0"?>
<wwhttpdata>
	<error>
		<errormessage>Line 1: Incorrect syntax near '.'. [1526:170]</errormessage>
		<errornumber>(not implemented but can be returned for custom requests)</errornumber>
	</error>
</wwhttpdata>


  Last Updated: 2/7/2002 | © West Wind Technologies, 2008