Error: Client found response content type of 'text/html',but expected 'text/xml

User Rating: / 0
PoorBest 

XML Error / Response is not well-formed XML

VMConnector module is a set of Virtuemart web services functions. It uses SOAP protocol (nuSoap) and XML for the data format.

If for any reasons the VMConnector web services functions gets HTML within its response, you will get an XML error as the client is expecting XML and not HTML.

HTML answers can be generated for many different reasons:

  • Most of time, for customization needs, language or other files are changed and blank lines are left at the end of PHP files after the PHP termination tag "?>"
    This error is invisible as in the majority of cases the Joomla configuration / server tab, has the "system default" set for Error reporting which is in fact set to OFF in the PHP.ini.
    In order to see the error appearing, set the error settings to MAXIMUM and you should then see it more clearly.

    To solve this problem, check with you php editor the php file concerned (the error above should report the php file name) and make sure that all blank lines after the last "?>" tag has been removed using the bacspace. Then save your file and retry.

  • Within Joomla / Virtuemart wysiwyg editor (JCE), updating VM product or category description, do not paste from MS Word or other programs generating special tags or XML tags. Products and categories descriptios needs to be clean text or HTML.
    You can use editors like JCE which allows to paste from MS WORD, and cleans the text or HTML code from special TAGS.

  • If your client program calling VMConnector uses HTTP 1.1 header, this may provoke this error. You have to use HTTP 1.0 header settings.

  • PHP warnings and  notifications due to Joomla or Virtuemart hacks.

  • Custom Joomla or Virtuemart modules you have installed which do not respect Joomla or Virtuemart framework.

  • Wrong database encoding or charset.
  • This error occurs when your website with Virtuemart is hosted on a server running PHP4 and you installed a VMConnector module built for PHP5 or the opposite.
    Please download and install the VMConnector PHP version matching your server PHP version.

    • VMConnector for PHP4 on servers with PHP4 versions
    • VMConnector for PHP5 on servers with PHP5 versions

  • Your Joomla Server Configuration Error display should be set to "System default" or "none" to avoid PHP warning or notifications.

    • Within your Joomla Admin Global Configuration, select the "Server" tab and the "Error Reporting" combo box
    • It should be set either to "System Default" or "none"
    • If  your PHP  system  default  parameter  "display_errors =  On", it is better to select "none" as notifies and warning are going to return html instead of expected XML.

  • It happens that your ISP provider by changing configuration or by enforcing security on his servers against hackers creates web server disruption in their answer to the client and of course the XML answer is incomplete and creates this error message "Response is not well-formed XML".
    The only solution is to contact him to resolve the problem.

  • An other reason for this error, is sometime due to the WYSISWYG editor you use. If it's not fully compatible with UTF-8 encoding, XML transfered will not be correctly formed.

To solve most of these problems, we do offer our Joomla professional hosting as we cannot solve other ISPs configuration problems!

Join our mailing list!

Sign up to our mailing list and stay up to date!



YouTube Channel

youtube

Check out the official JoomConnector YouTube channel for product demos, tutorials and screencasts!