2 Replies Latest reply on Dec 19, 2010 10:39 PM by rajeshell

    Web Services

    jd-lingwai
      Here's my problem, I created a projected using web services in the past and they load the data. So i've used the same code layout(changed the names where needed) on this new project. However, when the site loads I get this error message: Error #1096: XML parser failure: Unterminated element. I'm running the web service localy, can this be the problem? Also, I checked the url and it runs and displays, just not in flex. Does this mean there's something wrong with the Web service layout or my code?

      This web service takes a parameter and I'm using the <mx: request> to define it.....is that correct?

      Any advice would be helpful,
      JoSh

        • 1. Re: Web Services
          Level 7
          Please send the WSDL and XML schema so we can help you out.

          - Jorge


          • 2. Re: Web Services
            rajeshell

            I too have the same problem. with the wsdl: "http://soamoa.org:9292/artistRegistry?WSDL"

             

             

             

            Flex_screen-shot.JPG

             

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

            <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

               xmlns:s="library://ns.adobe.com/flex/spark"

               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:artistregistry="services.artistregistry.*" xmlns:valueObjects="valueObjects.*">

            <fx:Script>

            <![CDATA[

            import mx.controls.Alert;

             

            protected function button_clickHandler(event:MouseEvent):void

            {

            getAllResult.token = artistRegistry.getAll(parseInt(pageSizeTextInput.text),parseInt(pageNumberTextInput.text) );

            }

             

             

            protected function button2_clickHandler(event:MouseEvent):void

            {

            artist.address.city = cityTextInput.text;

            artist.address.country = countryTextInput.text;

            artist.address.houseNumber = houseNumberTextInput.text;

            artist.address.street = streetTextInput.text;

            artist.address.zipCode = zipCodeTextInput.text;

            artist.artType = artTypeTextInput.text;

            artist.famousWorks = famousWorksTextInput.text;

            artist.firstName = firstNameTextInput.text;

            artist.lastName = lastNameTextInput.text;

            }

             

            ]]>

            </fx:Script>

            <fx:Declarations>

            <artistregistry:ArtistRegistry id="artistRegistry" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>

            <s:CallResponder id="getAllResult" result="artist = getAllResult.lastResult[0] as Artist"/>

            <valueObjects:Artist id="artist">

            <valueObjects:address>

            <valueObjects:Address/>

            </valueObjects:address>

            </valueObjects:Artist>

            <!-- Place non-visual elements (e.g., services, value objects) here -->

            </fx:Declarations>

            <mx:Form defaultButton="{button}" x="86" y="81">

            <mx:FormItem label="PageSize">

            <s:TextInput id="pageSizeTextInput"/>

            </mx:FormItem>

            <mx:FormItem label="PageNumber">

            <s:TextInput id="pageNumberTextInput"/>

            </mx:FormItem>

            <s:Button label="GetAll" id="button" click="button_clickHandler(event)"/>

            </mx:Form>

            <mx:Form defaultButton="{button2}" x="347" y="10">

            <mx:FormHeading label="Artist"/>

            <mx:HRule width="100%"/>

            <mx:FormHeading label="Address"/>

            <mx:FormItem label="City">

            <s:TextInput id="cityTextInput" text="{artist.address.city}"/>

            </mx:FormItem>

            <mx:FormItem label="Country">

            <s:TextInput id="countryTextInput" text="{artist.address.country}"/>

            </mx:FormItem>

            <mx:FormItem label="HouseNumber">

            <s:TextInput id="houseNumberTextInput" text="{artist.address.houseNumber}"/>

            </mx:FormItem>

            <mx:FormItem label="Street">

            <s:TextInput id="streetTextInput" text="{artist.address.street}"/>

            </mx:FormItem>

            <mx:FormItem label="ZipCode">

            <s:TextInput id="zipCodeTextInput" text="{artist.address.zipCode}"/>

            </mx:FormItem>

            <mx:HRule width="100%"/>

            <mx:FormItem label="ArtType">

            <s:TextInput id="artTypeTextInput" text="{artist.artType}"/>

            </mx:FormItem>

            <mx:FormItem label="FamousWorks">

            <s:TextInput id="famousWorksTextInput" text="{artist.famousWorks}"/>

            </mx:FormItem>

            <mx:FormItem label="FirstName">

            <s:TextInput id="firstNameTextInput" text="{artist.firstName}"/>

            </mx:FormItem>

            <mx:FormItem label="LastName">

            <s:TextInput id="lastNameTextInput" text="{artist.lastName}"/>

            </mx:FormItem>

            <s:Button id="button2" label="Submit" click="button2_clickHandler(event)"/>

            </mx:Form>

            </s:Application>