Flex - httpservice error while getting xml

Posted on 2009-02-18
Last Modified: 2013-11-10
I'm using php to return xml. When I use this php to fetch data from localhost from flex, I get below error:] Unable to load datasource, [FaultEvent fault=[RPC Fault faultString="Error #1085" faultCode="Client.CouldNotDecode" faultDetail="null"] messageId="C3830F4F-D4D1-4499-91A5-8B84FE3D771E" type="fault" bubbles=false cancelable=true eventPhase=2

Suggest me if I'm doing anything wrong here.

below is the code for fetch.php:
<?php header('Content-type: text/xml'); ?>

<?xml version="1.0" encoding="utf-8"?>


	<item a="1" b="2" />

	<item a="3" b="4" />


Open in new window

Question by:SimonHowald
    LVL 49

    Accepted Solution

    What does fetch.php give you when you call it manually?
    When you have asp_short_tags on, you might actually get a php error. You should then change your php to:
      header('Content-type: text/xml');
      echo '<'.'?xml version="1.0" encoding="utf-8"?'.'>';
            <item a="1" b="2" />
            <item a="3" b="4" />

    Another problem might be that your php file itself is not valid utf-8. But that is rarely the case.

    LVL 9

    Expert Comment

    It seems like there is an incorrect call being made to the file in Flex. Can you post the code you are using to call the file.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
    Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now