Thank-you but I am still a little unclear as to how this actually works.
>From what I gather all I need to do is pass an array and flex will serialize 
>it...

I've tried passing an array of objects, I've simplified my test case, below is 
the code:

can anyone please help me figure out what I am doing wrong?

thanks in advance

----------------------------------------
 


CODE
 
varsearch1:Searchcriteria = newSearchcriteria();varsearch2:Searchcriteria = 
newSearchcriteria();var
search1.criteria1 = 
search1.criteria2 = 
search1.criteria3 = 
search1.criteria4 = 
search2.criteria1 = 
search2.criteria2 = 
search2.criteria3 = 
search2.criteria4 = 
search3.criteria1 = 
search3.criteria2 = 
search3.criteria3 = 
search3.criteria4 = 
 search3:Searchcriteria = 
newSearchcriteria();"test";"test";"test";"test";"test";"test";"test";"test";"test";"test";"test";"test";
 
varcriterialist:Array = 
[search1,search2,search3,search4,search5];"param1","param2","param3",criterialist,"param5");
ws.GetAdvancedSearchListDept(
ws.GetAdvancedSearchListDept.addEventListener(ResultEvent.RESULT, 
resultSearchHandler) ;

//search1, 2 3 4 5 are of type searchCriteria:

publicclassSearchcriteriaprivatevarcriteria1:String;privatevarcriteria2:String;privatevarcriteria3:String;publicfunctionSearchcriteria()publicfunctiongetCriteria1()
 : String { returnthis.criteria1; }publicfunctionsetCriteria1(criteria1 : 
String) : void{ this.criteria1 = criteria1; } publicfunctiongetCriteria2() : 
String { returnthis.criteria2; }publicfunctionsetCriteria2(criteria2: String) : 
void{ this.criteria2 = criteria2; } publicfunctiongetCriteria3() : String { 
returnthis.criteria3; }publicfunctionsetCriteria3(criteria3 : String) : void{ 
this.criteria3 = criteria3; }
{
{
}}


When I look at what is being sent to the service I see this for the 
criterialist param, they are not expanded...
All other params are passed ok as they are simple strings...
 
SENT SOAP snippet
tns:criterialist
<tns:searchcriteria xmlns:tns=
<tns:searchcriteria xmlns:tns=
<tns:searchcriteria xmlns:tns=
<tns:searchcriteria 
xmlns:tns="http:mysite/schema"/>"http:mysite/schema"/>"http:mysite/schema"/>"http:mysite/schema"/>





________________________________
From: Tracy Spratt <[email protected]>
To: [email protected]
Sent: Monday, February 9, 2009 11:55:42 AM
Subject: RE: [flexcoders] Webservice with Dynamic request?


What are the input parameters of the operation “SearchParams”?  What data 
types?  Does it have a single argument of type array that that contains an 
array  of “searchcriteria” objects, which have the three search specification 
values? 
 
The request object is a dynamic “Object”, not xml. build it something like this:
Var oRequest:Object = new Object();
oRequest.criteriali st = buildSearchCriteria Array()
webService.SearchPa rams.request = oRequest;
 
Be sure to remove the declarative mx:request tag.
Tracy Spratt
Lariat Services
Flex development bandwidth available

________________________________

From:flexcod...@yahoogro ups.com [mailto: flexcod...@yahoogro ups.com ] On 
Behalf Of thibodeau.alain
Sent: Monday, February 09, 2009 10:30 AM
To: flexcod...@yahoogro ups.com
Subject: [flexcoders] Webservice with Dynamic request?
 
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.SearchPa rams.request 
= "<criterialist> <searchcriteria> <title>string< /title><item> string</it
em><criteria> string</criteria ></searchcriteri a></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="getSearchDe tails_result( event)" fault="getSearchDet ails_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!



      

Reply via email to