Web Connection
Invalid XML Returned from Server
Gravatar is a globally recognized avatar based on your email address. Invalid XML Returned from Server
  Roy Miller
  All
  Jun 2, 2015 @ 03:05pm
Rick,

I've got a "Desktop application" that is using West Wind Web Connection 4.66 to extract data using wwHTTPSQL and hits a website that was developed with wconnect 4.66 and all is working well with that .... for years .....

So, I'm updating the website with your version 5.xx series.

When I issue an execute I am getting an error message. ( See Image)

couple of facts for background.

1. The website that this was using was built in version 4.66.
2. The new website is using version West Wind Web Connection 5.0
3. The desktop software is still using version 4.66


The following is what is returned.

HTTP/1.1 200 OK
Content-Type: text/xml
Expires: 0
Pragma: no-cache
Cache-Control: no-store, no-cache
Content-length: 766

<?xml version="1.0"?>
<wwhttpsql>
<Schema name="Schema" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="c_Temp" content="eltOnly" model="closed" order="many">
<element type="row" />
</ElementType>
<ElementType name="row" content="eltOnly" model="closed" order="many">
<element type="versionno"/>
</ElementType>
<ElementType name="versionno" content="textOnly" model="closed" dt:type="string">
<AttributeType name="type"/>
<attribute type="type" default="string"/>
<AttributeType name="size"/>
<attribute type="size" default="7"/>
</ElementType>
</Schema>
<c_Temp xmlns="x-schema:#Schema">
<row>
<versionno>9.00.06</versionno>
</row>
</c_Temp>

</wwhttpsql>

What do you recommend? Do I need to update the desktop application to utilize the 5.xx series of wconnect?

Thanks

Gravatar is a globally recognized avatar based on your email address. Re: Invalid XML Returned from Server
  Rick Strahl
  Roy Miller
  Jun 3, 2015 @ 01:45pm
Hi Roy,

Not sure but first thing I would do is match the versions of client and server. I don't think this should matter, but it's possible there are parser differences.

+++ Rick ---



Rick,

I've got a "Desktop application" that is using West Wind Web Connection 4.66 to extract data using wwHTTPSQL and hits a website that was developed with wconnect 4.66 and all is working well with that .... for years .....

So, I'm updating the website with your version 5.xx series.

When I issue an execute I am getting an error message. ( See Image)

couple of facts for background.

1. The website that this was using was built in version 4.66.
2. The new website is using version West Wind Web Connection 5.0
3. The desktop software is still using version 4.66


The following is what is returned.

HTTP/1.1 200 OK
Content-Type: text/xml
Expires: 0
Pragma: no-cache
Cache-Control: no-store, no-cache
Content-length: 766

<?xml version="1.0"?>
<wwhttpsql>
<Schema name="Schema" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="c_Temp" content="eltOnly" model="closed" order="many">
<element type="row" />
</ElementType>
<ElementType name="row" content="eltOnly" model="closed" order="many">
<element type="versionno"/>
</ElementType>
<ElementType name="versionno" content="textOnly" model="closed" dt:type="string">
<AttributeType name="type"/>
<attribute type="type" default="string"/>
<AttributeType name="size"/>
<attribute type="size" default="7"/>
</ElementType>
</Schema>
<c_Temp xmlns="x-schema:#Schema">
<row>
<versionno>9.00.06</versionno>
</row>
</c_Temp>

</wwhttpsql>

What do you recommend? Do I need to update the desktop application to utilize the 5.xx series of wconnect?

Thanks



Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Gravatar is a globally recognized avatar based on your email address. Re: Invalid XML Returned from Server
  Roy Miller
  Rick Strahl
  Jun 5, 2015 @ 11:54am
Rick,

I've got the version matched up and still having the same problem.

Here's the code on the server:

FUNCTION wwHTTPSQLData()

IF ! (UPPER('wwHTTPSQLServer') $ UPPER(SET("Procedure")))
SET PROCEDURE TO wwHTTPSQLServer ADDITIVE
endif
*** Create Data Object and call Server Side Execute method (wrapper for Process Method)
loData = CREATE("wwHTTPSQLServer")
loData.cAllowedCommands = "select,execute,insert,update,method,delete"
loData.cConnectString = "" && Allow Read data from XML input

loData.cRequestXML = Request.FormXML()
loData.S_Execute()

*** Return the XML response
loHeader = CREATEOBJECT("wwHTTPHeader")
loHeader.SetProtocol()
loHeader.SetContentType("text/xml")
loHeader.AddForceReload()
loHeader.AddHeader("Content-length",TRANSFORM(LEN(loData.cResponseXML)))
Response.Write( loHeader.GetOutput() )

Response.Write( loData.cResponseXML )

* -- let's shut down tables no need in holding them open
CLOSE tables ALL


ENDFUNC

ENDDEFINE

Here's the code from the client

SET PROCEDURE TO
SET PATH TO
SET CLASSLIB TO

SET PATH TO d:\vfp90\webapps\mcgweb\classes\
SET PROCEDURE TO d:\vfp90\webapps\mcgweb\classes\wwHTTP ADDITIVE

DO wwHTTPSQL && Load Libs

oHSQL = CREATEOBJECT("wwHTTPSQL")
oHSQL.cServerUrl = "http://localhost/mcgweb/wwHTTPSQLData.mcg"

oHSQL.nConnectTimeout = 10

oHSQL.cSQLCursor = "TDevelopers"

*** Plain SQL statements
lnCount = oHSQL.Execute("select * from ./dbfs/info")

IF oHSQL.lError
WAIT WINDOW oHSQL.cErrorMsg
ELSE
BROWSE
ENDIF


What do you recommend?


Hi Roy,

Not sure but first thing I would do is match the versions of client and server. I don't think this should matter, but it's possible there are parser differences.

+++ Rick ---



Rick,

I've got a "Desktop application" that is using West Wind Web Connection 4.66 to extract data using wwHTTPSQL and hits a website that was developed with wconnect 4.66 and all is working well with that .... for years .....

So, I'm updating the website with your version 5.xx series.

When I issue an execute I am getting an error message. ( See Image)

couple of facts for background.

1. The website that this was using was built in version 4.66.
2. The new website is using version West Wind Web Connection 5.0
3. The desktop software is still using version 4.66


The following is what is returned.

HTTP/1.1 200 OK
Content-Type: text/xml
Expires: 0
Pragma: no-cache
Cache-Control: no-store, no-cache
Content-length: 766

<?xml version="1.0"?>
<wwhttpsql>
<Schema name="Schema" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="c_Temp" content="eltOnly" model="closed" order="many">
<element type="row" />
</ElementType>
<ElementType name="row" content="eltOnly" model="closed" order="many">
<element type="versionno"/>
</ElementType>
<ElementType name="versionno" content="textOnly" model="closed" dt:type="string">
<AttributeType name="type"/>
<attribute type="type" default="string"/>
<AttributeType name="size"/>
<attribute type="size" default="7"/>
</ElementType>
</Schema>
<c_Temp xmlns="x-schema:#Schema">
<row>
<versionno>9.00.06</versionno>
</row>
</c_Temp>

</wwhttpsql>

What do you recommend? Do I need to update the desktop application to utilize the 5.xx series of wconnect?

Thanks



Gravatar is a globally recognized avatar based on your email address. Re: Invalid XML Returned from Server
  Rick Strahl
  Roy Miller
  Jun 5, 2015 @ 12:59pm
Roy,

Not sure. I see nothing wrong with the XML returned from the server. Yet the reader is complaining about an invalid XML document.

Can you try running the demo that comes with Web Connection and comparing with what's different? The only thing I can think of is a possible data encoding issue, but I don't see anything in the data even if that was an issue it shouldn't trigger any UTF-8 encoding issues.

Other than that I don't know short of looking at the actual implementation code and tracing through.

+++ Rick ---



Rick,

I've got the version matched up and still having the same problem.

Here's the code on the server:

FUNCTION wwHTTPSQLData()

IF ! (UPPER('wwHTTPSQLServer') $ UPPER(SET("Procedure")))
SET PROCEDURE TO wwHTTPSQLServer ADDITIVE
endif
*** Create Data Object and call Server Side Execute method (wrapper for Process Method)
loData = CREATE("wwHTTPSQLServer")
loData.cAllowedCommands = "select,execute,insert,update,method,delete"
loData.cConnectString = "" && Allow Read data from XML input

loData.cRequestXML = Request.FormXML()
loData.S_Execute()

*** Return the XML response
loHeader = CREATEOBJECT("wwHTTPHeader")
loHeader.SetProtocol()
loHeader.SetContentType("text/xml")
loHeader.AddForceReload()
loHeader.AddHeader("Content-length",TRANSFORM(LEN(loData.cResponseXML)))
Response.Write( loHeader.GetOutput() )

Response.Write( loData.cResponseXML )

* -- let's shut down tables no need in holding them open
CLOSE tables ALL


ENDFUNC

ENDDEFINE

Here's the code from the client

SET PROCEDURE TO
SET PATH TO
SET CLASSLIB TO

SET PATH TO d:\vfp90\webapps\mcgweb\classes\
SET PROCEDURE TO d:\vfp90\webapps\mcgweb\classes\wwHTTP ADDITIVE

DO wwHTTPSQL && Load Libs

oHSQL = CREATEOBJECT("wwHTTPSQL")
oHSQL.cServerUrl = "http://localhost/mcgweb/wwHTTPSQLData.mcg"

oHSQL.nConnectTimeout = 10

oHSQL.cSQLCursor = "TDevelopers"

*** Plain SQL statements
lnCount = oHSQL.Execute("select * from ./dbfs/info")

IF oHSQL.lError
WAIT WINDOW oHSQL.cErrorMsg
ELSE
BROWSE
ENDIF


What do you recommend?


Hi Roy,

Not sure but first thing I would do is match the versions of client and server. I don't think this should matter, but it's possible there are parser differences.

+++ Rick ---



Rick,

I've got a "Desktop application" that is using West Wind Web Connection 4.66 to extract data using wwHTTPSQL and hits a website that was developed with wconnect 4.66 and all is working well with that .... for years .....

So, I'm updating the website with your version 5.xx series.

When I issue an execute I am getting an error message. ( See Image)

couple of facts for background.

1. The website that this was using was built in version 4.66.
2. The new website is using version West Wind Web Connection 5.0
3. The desktop software is still using version 4.66


The following is what is returned.

HTTP/1.1 200 OK
Content-Type: text/xml
Expires: 0
Pragma: no-cache
Cache-Control: no-store, no-cache
Content-length: 766

<?xml version="1.0"?>
<wwhttpsql>
<Schema name="Schema" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="c_Temp" content="eltOnly" model="closed" order="many">
<element type="row" />
</ElementType>
<ElementType name="row" content="eltOnly" model="closed" order="many">
<element type="versionno"/>
</ElementType>
<ElementType name="versionno" content="textOnly" model="closed" dt:type="string">
<AttributeType name="type"/>
<attribute type="type" default="string"/>
<AttributeType name="size"/>
<attribute type="size" default="7"/>
</ElementType>
</Schema>
<c_Temp xmlns="x-schema:#Schema">
<row>
<versionno>9.00.06</versionno>
</row>
</c_Temp>

</wwhttpsql>

What do you recommend? Do I need to update the desktop application to utilize the 5.xx series of wconnect?

Thanks






Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Gravatar is a globally recognized avatar based on your email address. Re: Invalid XML Returned from Server
  Rick Strahl
  Roy Miller
  Jun 5, 2015 @ 01:01pm
You know - you should trace through the code and see if you are actually receiving an XML HTTP response in the client. If you trace through the code that makes the HTTP call, look at what actually comes back from the server.

If that is the correct XMl and it doesn't work the only thing I can think of is that there's a problem with the MSXML parser somehow not being able to read the data which would be odd. Again, if that's the case try the Web Connection demo and see if that works just to be sure that there isn't a more specific machine level problem.

+++ Rick ---



Rick,

I've got the version matched up and still having the same problem.

Here's the code on the server:

FUNCTION wwHTTPSQLData()

IF ! (UPPER('wwHTTPSQLServer') $ UPPER(SET("Procedure")))
SET PROCEDURE TO wwHTTPSQLServer ADDITIVE
endif
*** Create Data Object and call Server Side Execute method (wrapper for Process Method)
loData = CREATE("wwHTTPSQLServer")
loData.cAllowedCommands = "select,execute,insert,update,method,delete"
loData.cConnectString = "" && Allow Read data from XML input

loData.cRequestXML = Request.FormXML()
loData.S_Execute()

*** Return the XML response
loHeader = CREATEOBJECT("wwHTTPHeader")
loHeader.SetProtocol()
loHeader.SetContentType("text/xml")
loHeader.AddForceReload()
loHeader.AddHeader("Content-length",TRANSFORM(LEN(loData.cResponseXML)))
Response.Write( loHeader.GetOutput() )

Response.Write( loData.cResponseXML )

* -- let's shut down tables no need in holding them open
CLOSE tables ALL


ENDFUNC

ENDDEFINE

Here's the code from the client

SET PROCEDURE TO
SET PATH TO
SET CLASSLIB TO

SET PATH TO d:\vfp90\webapps\mcgweb\classes\
SET PROCEDURE TO d:\vfp90\webapps\mcgweb\classes\wwHTTP ADDITIVE

DO wwHTTPSQL && Load Libs

oHSQL = CREATEOBJECT("wwHTTPSQL")
oHSQL.cServerUrl = "http://localhost/mcgweb/wwHTTPSQLData.mcg"

oHSQL.nConnectTimeout = 10

oHSQL.cSQLCursor = "TDevelopers"

*** Plain SQL statements
lnCount = oHSQL.Execute("select * from ./dbfs/info")

IF oHSQL.lError
WAIT WINDOW oHSQL.cErrorMsg
ELSE
BROWSE
ENDIF


What do you recommend?


Hi Roy,

Not sure but first thing I would do is match the versions of client and server. I don't think this should matter, but it's possible there are parser differences.

+++ Rick ---



Rick,

I've got a "Desktop application" that is using West Wind Web Connection 4.66 to extract data using wwHTTPSQL and hits a website that was developed with wconnect 4.66 and all is working well with that .... for years .....

So, I'm updating the website with your version 5.xx series.

When I issue an execute I am getting an error message. ( See Image)

couple of facts for background.

1. The website that this was using was built in version 4.66.
2. The new website is using version West Wind Web Connection 5.0
3. The desktop software is still using version 4.66


The following is what is returned.

HTTP/1.1 200 OK
Content-Type: text/xml
Expires: 0
Pragma: no-cache
Cache-Control: no-store, no-cache
Content-length: 766

<?xml version="1.0"?>
<wwhttpsql>
<Schema name="Schema" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="c_Temp" content="eltOnly" model="closed" order="many">
<element type="row" />
</ElementType>
<ElementType name="row" content="eltOnly" model="closed" order="many">
<element type="versionno"/>
</ElementType>
<ElementType name="versionno" content="textOnly" model="closed" dt:type="string">
<AttributeType name="type"/>
<attribute type="type" default="string"/>
<AttributeType name="size"/>
<attribute type="size" default="7"/>
</ElementType>
</Schema>
<c_Temp xmlns="x-schema:#Schema">
<row>
<versionno>9.00.06</versionno>
</row>
</c_Temp>

</wwhttpsql>

What do you recommend? Do I need to update the desktop application to utilize the 5.xx series of wconnect?

Thanks






Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Gravatar is a globally recognized avatar based on your email address. Re: Invalid XML Returned from Server
  Roy Miller
  Rick Strahl
  Jun 5, 2015 @ 02:59pm
Rick,

The demo appears to work ... I've run the application and extracted the results the following is the returned results.

HTTP/1.1 200 OK
Content-Type: text/xml
Expires: 0
Pragma: no-cache
Cache-Control: no-store, no-cache
Content-length: 993

<?xml version = "1.0" encoding="UTF-8" standalone="yes"?>
<VFPData>
<xsd:schema id="VFPData" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="VFPData" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="tdevelopers" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="versionno">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="7"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:choice>
<xsd:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="lax"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<tdevelopers>
<versionno>9.00.06</versionno>
</tdevelopers>
</VFPData>

The wwxml class method loadxml looks like this

LPARAMETER lcXML, llAsync, llPreserveWhiteSpace
LOCAL loXML

THIS.lError = .f.
THIS.cErrorMsg = ""

this.oXml = null

IF VARTYPE(lcXML) = "O"
*** Use existing ref if passed in
loXML = lcXML
ELSE
lcXML=IIF(EMPTY(lcXML),"",lcXML)

IF VARTYPE(THIS.oXML) # "O"
*** Create if it doesn't exist already
loXML = CREATE(XML_XMLDOM_PROGID)
loXML.Async = llAsync
ELSE
*** If we have one already - reuse it!
loXML = THIS.oXML
loXML.Async = llAsync
ENDIF
loXML.LoadXML(lcXML)
ENDIF

*** Check for parsing error
IF TYPE("loxml.parseerror.reason")="C" AND ;
!EMPTY(loXML.ParseError.reason)
THIS.cErrorMsg = loXML.ParseError.reason + CRLF + ;
"Line: " + TRANSFORM(loXML.ParseError.LINE) + CRLF +;
loXML.ParseError.SrcText
THIS.lError = .T.
RETURN .NULL.
ENDIF

loXML.PreserveWhiteSpace = .T.

this.oXML = loXML

RETURN loXML

As I attempt to step through, specifically loXML.LoadXML(lcXML), this is where it appears to load the error message. However, I'm unable to trace through the code ... with a set step on just prior to the call, the process runs, but I don't get to see any code and then that when the error message is loaded.

What do you suggest?

Thanks


Roy,

Not sure. I see nothing wrong with the XML returned from the server. Yet the reader is complaining about an invalid XML document.

Can you try running the demo that comes with Web Connection and comparing with what's different? The only thing I can think of is a possible data encoding issue, but I don't see anything in the data even if that was an issue it shouldn't trigger any UTF-8 encoding issues.

Other than that I don't know short of looking at the actual implementation code and tracing through.

+++ Rick ---



Rick,

I've got the version matched up and still having the same problem.

Here's the code on the server:

FUNCTION wwHTTPSQLData()

IF ! (UPPER('wwHTTPSQLServer') $ UPPER(SET("Procedure")))
SET PROCEDURE TO wwHTTPSQLServer ADDITIVE
endif
*** Create Data Object and call Server Side Execute method (wrapper for Process Method)
loData = CREATE("wwHTTPSQLServer")
loData.cAllowedCommands = "select,execute,insert,update,method,delete"
loData.cConnectString = "" && Allow Read data from XML input

loData.cRequestXML = Request.FormXML()
loData.S_Execute()

*** Return the XML response
loHeader = CREATEOBJECT("wwHTTPHeader")
loHeader.SetProtocol()
loHeader.SetContentType("text/xml")
loHeader.AddForceReload()
loHeader.AddHeader("Content-length",TRANSFORM(LEN(loData.cResponseXML)))
Response.Write( loHeader.GetOutput() )

Response.Write( loData.cResponseXML )

* -- let's shut down tables no need in holding them open
CLOSE tables ALL


ENDFUNC

ENDDEFINE

Here's the code from the client

SET PROCEDURE TO
SET PATH TO
SET CLASSLIB TO

SET PATH TO d:\vfp90\webapps\mcgweb\classes\
SET PROCEDURE TO d:\vfp90\webapps\mcgweb\classes\wwHTTP ADDITIVE

DO wwHTTPSQL && Load Libs

oHSQL = CREATEOBJECT("wwHTTPSQL")
oHSQL.cServerUrl = "http://localhost/mcgweb/wwHTTPSQLData.mcg"

oHSQL.nConnectTimeout = 10

oHSQL.cSQLCursor = "TDevelopers"

*** Plain SQL statements
lnCount = oHSQL.Execute("select * from ./dbfs/info")

IF oHSQL.lError
WAIT WINDOW oHSQL.cErrorMsg
ELSE
BROWSE
ENDIF


What do you recommend?


Hi Roy,

Not sure but first thing I would do is match the versions of client and server. I don't think this should matter, but it's possible there are parser differences.

+++ Rick ---



Rick,

I've got a "Desktop application" that is using West Wind Web Connection 4.66 to extract data using wwHTTPSQL and hits a website that was developed with wconnect 4.66 and all is working well with that .... for years .....

So, I'm updating the website with your version 5.xx series.

When I issue an execute I am getting an error message. ( See Image)

couple of facts for background.

1. The website that this was using was built in version 4.66.
2. The new website is using version West Wind Web Connection 5.0
3. The desktop software is still using version 4.66


The following is what is returned.

HTTP/1.1 200 OK
Content-Type: text/xml
Expires: 0
Pragma: no-cache
Cache-Control: no-store, no-cache
Content-length: 766

<?xml version="1.0"?>
<wwhttpsql>
<Schema name="Schema" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="c_Temp" content="eltOnly" model="closed" order="many">
<element type="row" />
</ElementType>
<ElementType name="row" content="eltOnly" model="closed" order="many">
<element type="versionno"/>
</ElementType>
<ElementType name="versionno" content="textOnly" model="closed" dt:type="string">
<AttributeType name="type"/>
<attribute type="type" default="string"/>
<AttributeType name="size"/>
<attribute type="size" default="7"/>
</ElementType>
</Schema>
<c_Temp xmlns="x-schema:#Schema">
<row>
<versionno>9.00.06</versionno>
</row>
</c_Temp>

</wwhttpsql>

What do you recommend? Do I need to update the desktop application to utilize the 5.xx series of wconnect?

Thanks






Gravatar is a globally recognized avatar based on your email address. Re: Invalid XML Returned from Server
  Rick Strahl
  Roy Miller
  Jun 5, 2015 @ 04:25pm

You have to run the PRG. You should also delete all FXP files in the project, then debug.

+++ Rick ---



Rick,

The demo appears to work ... I've run the application and extracted the results the following is the returned results.

HTTP/1.1 200 OK
Content-Type: text/xml
Expires: 0
Pragma: no-cache
Cache-Control: no-store, no-cache
Content-length: 993

<?xml version = "1.0" encoding="UTF-8" standalone="yes"?>
<VFPData>
<xsd:schema id="VFPData" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="VFPData" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="tdevelopers" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="versionno">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="7"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:choice>
<xsd:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="lax"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<tdevelopers>
<versionno>9.00.06</versionno>
</tdevelopers>
</VFPData>

The wwxml class method loadxml looks like this

LPARAMETER lcXML, llAsync, llPreserveWhiteSpace
LOCAL loXML

THIS.lError = .f.
THIS.cErrorMsg = ""

this.oXml = null

IF VARTYPE(lcXML) = "O"
*** Use existing ref if passed in
loXML = lcXML
ELSE
lcXML=IIF(EMPTY(lcXML),"",lcXML)

IF VARTYPE(THIS.oXML) # "O"
*** Create if it doesn't exist already
loXML = CREATE(XML_XMLDOM_PROGID)
loXML.Async = llAsync
ELSE
*** If we have one already - reuse it!
loXML = THIS.oXML
loXML.Async = llAsync
ENDIF
loXML.LoadXML(lcXML)
ENDIF

*** Check for parsing error
IF TYPE("loxml.parseerror.reason")="C" AND ;
!EMPTY(loXML.ParseError.reason)
THIS.cErrorMsg = loXML.ParseError.reason + CRLF + ;
"Line: " + TRANSFORM(loXML.ParseError.LINE) + CRLF +;
loXML.ParseError.SrcText
THIS.lError = .T.
RETURN .NULL.
ENDIF

loXML.PreserveWhiteSpace = .T.

this.oXML = loXML

RETURN loXML

As I attempt to step through, specifically loXML.LoadXML(lcXML), this is where it appears to load the error message. However, I'm unable to trace through the code ... with a set step on just prior to the call, the process runs, but I don't get to see any code and then that when the error message is loaded.

What do you suggest?

Thanks


Roy,

Not sure. I see nothing wrong with the XML returned from the server. Yet the reader is complaining about an invalid XML document.

Can you try running the demo that comes with Web Connection and comparing with what's different? The only thing I can think of is a possible data encoding issue, but I don't see anything in the data even if that was an issue it shouldn't trigger any UTF-8 encoding issues.

Other than that I don't know short of looking at the actual implementation code and tracing through.

+++ Rick ---



Rick,

I've got the version matched up and still having the same problem.

Here's the code on the server:

FUNCTION wwHTTPSQLData()

IF ! (UPPER('wwHTTPSQLServer') $ UPPER(SET("Procedure")))
SET PROCEDURE TO wwHTTPSQLServer ADDITIVE
endif
*** Create Data Object and call Server Side Execute method (wrapper for Process Method)
loData = CREATE("wwHTTPSQLServer")
loData.cAllowedCommands = "select,execute,insert,update,method,delete"
loData.cConnectString = "" && Allow Read data from XML input

loData.cRequestXML = Request.FormXML()
loData.S_Execute()

*** Return the XML response
loHeader = CREATEOBJECT("wwHTTPHeader")
loHeader.SetProtocol()
loHeader.SetContentType("text/xml")
loHeader.AddForceReload()
loHeader.AddHeader("Content-length",TRANSFORM(LEN(loData.cResponseXML)))
Response.Write( loHeader.GetOutput() )

Response.Write( loData.cResponseXML )

* -- let's shut down tables no need in holding them open
CLOSE tables ALL


ENDFUNC

ENDDEFINE

Here's the code from the client

SET PROCEDURE TO
SET PATH TO
SET CLASSLIB TO

SET PATH TO d:\vfp90\webapps\mcgweb\classes\
SET PROCEDURE TO d:\vfp90\webapps\mcgweb\classes\wwHTTP ADDITIVE

DO wwHTTPSQL && Load Libs

oHSQL = CREATEOBJECT("wwHTTPSQL")
oHSQL.cServerUrl = "http://localhost/mcgweb/wwHTTPSQLData.mcg"

oHSQL.nConnectTimeout = 10

oHSQL.cSQLCursor = "TDevelopers"

*** Plain SQL statements
lnCount = oHSQL.Execute("select * from ./dbfs/info")

IF oHSQL.lError
WAIT WINDOW oHSQL.cErrorMsg
ELSE
BROWSE
ENDIF


What do you recommend?


Hi Roy,

Not sure but first thing I would do is match the versions of client and server. I don't think this should matter, but it's possible there are parser differences.

+++ Rick ---



Rick,

I've got a "Desktop application" that is using West Wind Web Connection 4.66 to extract data using wwHTTPSQL and hits a website that was developed with wconnect 4.66 and all is working well with that .... for years .....

So, I'm updating the website with your version 5.xx series.

When I issue an execute I am getting an error message. ( See Image)

couple of facts for background.

1. The website that this was using was built in version 4.66.
2. The new website is using version West Wind Web Connection 5.0
3. The desktop software is still using version 4.66


The following is what is returned.

HTTP/1.1 200 OK
Content-Type: text/xml
Expires: 0
Pragma: no-cache
Cache-Control: no-store, no-cache
Content-length: 766

<?xml version="1.0"?>
<wwhttpsql>
<Schema name="Schema" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="c_Temp" content="eltOnly" model="closed" order="many">
<element type="row" />
</ElementType>
<ElementType name="row" content="eltOnly" model="closed" order="many">
<element type="versionno"/>
</ElementType>
<ElementType name="versionno" content="textOnly" model="closed" dt:type="string">
<AttributeType name="type"/>
<attribute type="type" default="string"/>
<AttributeType name="size"/>
<attribute type="size" default="7"/>
</ElementType>
</Schema>
<c_Temp xmlns="x-schema:#Schema">
<row>
<versionno>9.00.06</versionno>
</row>
</c_Temp>

</wwhttpsql>

What do you recommend? Do I need to update the desktop application to utilize the 5.xx series of wconnect?

Thanks








Rick Strahl
West Wind Technologies

Making waves on the Web
from Hood River

© 1996-2024