Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7558949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:30:26+00:00 2026-05-30T12:30:26+00:00

I have a flex 4.6 application calling a web service that access a MS

  • 0

I have a flex 4.6 application calling a web service that access a MS SQl server.
I’m using (or trying to use) a web service I created. the web service seems to be working the XML being return looks OK but I’m getting the below error.

"XML parser failure: element is malformed. null"

I Google this error and did some research and what I gather, it is cause by how the XML is format coming from the web service.

I have written the web service in c# and I tested it, The service is retuning the following XML structure:

<root>
<pub>
<PublicationId>BIA-B0112</PublicationId>
<TargetPPODate>2012-02-28</TargetPPODate>
<TargetPPIDate>2012-03-13</TargetPPIDate>
<TargetRIPDate>2012-03-16</TargetRIPDate>
</pub>
</root> 

the format don’t look wrong to me, here my C# code that returns this.

// Connect to the database and run the query
SqlConnection conn = new SqlConnection(bldr.ToString());
SqlCommand cmd = new SqlCommand("AWFE.dbo.Connect_PubInfo");
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.Clear();
cmd.Parameters.Add(new SqlParameter("@Pubid", BookName));
conn.Open();
cmd.Connection = conn;

SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
ds.DataSetName = "root";
da.SelectCommand = cmd;
da.Fill(ds, "pub");

// Return the data as XML
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(ds.GetXml());
return xmlDoc;

and here is the action script I’m using:

   <?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                       xmlns:s="library://ns.adobe.com/flex/spark"
                       xmlns:mx="library://ns.adobe.com/flex/mx"
                       xmlns:service1="services.service1.*"
                       width="529" height="322">

    <fx:Script>
        <![CDATA[
            import com.adobe.serializers.utility.TypeUtility;

            import mx.controls.Alert;
            import mx.events.FlexEvent;


            protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
            {
                PubInfoResult.token = service1.PubInfo("FRP-Q0112");
            }

        ]]>
    </fx:Script>

    <fx:Declarations>
        <s:CallResponder id="PubInfoResult"/>
        <service1:Service1 id="service1"
                           fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
                           showBusyCursor="true"/>
        <!-- Place non-visual elements (e.g., services, value objects) here -->


    </fx:Declarations>
    <s:TextInput id="BookCode" x="9" y="22"/>
    <s:DataGrid id="dataGrid" x="75" y="95"
                creationComplete="dataGrid_creationCompleteHandler(event)" requestedRowCount="4">
        <s:columns>
            <s:ArrayList>
            </s:ArrayList>
        </s:columns>
        <s:typicalItem>
            <fx:Object></fx:Object>
        </s:typicalItem>
        <s:AsyncListView list="{TypeUtility.convertToCollection(PubInfoResult.lastResult)}"/>
    </s:DataGrid>


</s:WindowedApplication>

I’m new flex and web services so I’m having some trouble in this area , any help would be great.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T12:30:27+00:00Added an answer on May 30, 2026 at 12:30 pm

    What I did not do is set the return type of the service in the data service is flash builder, once I did that the error was fix. now I ran into another issue which I have to research. its now only retuning the root element of the return XML file, I need the data in the element..

    thanks everyone for helping.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a flex web application with php server side support. There is
I have a Flex application that connects to a BlazeDS server using the StreamingAMF
I have a Flex application that seems larger than it should be. There is
I have a flex application that loads swf files and displays them using the
I have a flex application that loads an external swf file. I created the
We have a flex application that works with ASP.NET. (through weborb). And we use
I have a flex application that when i update on the server i can
I have a Flex/Java web application that uses Maven as a build tool. Currently,
I have an enterprise Flex web application, served up over https, that runs fine
We have a flex application that connects to a proxy server which handles authentication.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.