This is how I would do it. You should be able to extrapolate it to your requirements:
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="onCreationComplete()"> <mx:Script> <![CDATA[ import mx.controls.Alert; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; import mx.rpc.soap.mxml.*; private var ws:mx.rpc.soap.mxml.WebService; private var searchcriteria:Object = new Object(); public function onCreationComplete():void { ws = new mx.rpc.soap.mxml.WebService(); ws.endpointURI = "http://myserver.com/WebService"; ws.loadWSDL("http://myserver.com/MyWebService.wsdl"); ws.addEventListener(FaultEvent.FAULT, faultHandler); ws.addEventListener(ResultEvent.RESULT, resultHandler); } public function resultHandler(event:ResultEvent):void { Alert.show(event.result as String); } public function faultHandler(event:FaultEvent):void { Alert.show(event.fault.faultString); } public function doSubmit():void { searchcriteria.title = title.text; searchcriteria.item = item.text; searchcriteria.criteria = criteria.text; ws.getSearchDetails(searchcriteria); } ]]> </mx:Script> <mx:Form> <mx:FormItem label="Title:" fontWeight="bold"> <mx:TextInput id="title" width="300"/> </mx:FormItem> <mx:FormItem label="Item:" fontWeight="bold"> <mx:TextInput id="item" width="300"/> </mx:FormItem> <mx:FormItem label="Criteria:" fontWeight="bold"> <mx:TextInput id="criteria" width="300"/> </mx:FormItem> </mx:Form> <mx:Button label="Submit" click="doSubmit()"/> </mx:Application> --- In [email protected], "thibodeau.alain" <thibodeau.al...@...> wrote: > > Hi All, > > I am not sure how to go about this and couldn't find a sample > anywhere...I am trying to consume a webservice that contains dynamic > request data. Meaning that my request will change depending on what > the user has entered... I've always used services that had the same > request params, but in this case they change... > > I tried building out in AS my request like this: > > webService.SearchParams.request > = "<criterialist><searchcriteria><title>string</title><item>string</it > em><criteria>string</criteria></searchcriteria></criterialist>"; > > And I have been staring at the request tag not knowing how to make > it "loop" > > <mx:WebService id="webService" wsdl="myservice"> > <mx:operation name="SearchParams" > result="getSearchDetails_result(event)" fault="getSearchDetails_fault > (event)"> > <mx:request xmlns="schema"> > <!-- This has to be dynamic depending > on how many search params were given by user--> > <criterialist> > <searchcriteria> > <title>string</title> > <item>string</item> > <criteria>string</criteria> > </searchcriteria> > </criterialist> > <!----> > </mx:request> > </mx:operation> > </mx:WebService> > > I hope it's clear what I am trying to accomplish and that someone can > point me in the correct direction... > > thank-you! >

