# Webservice help

**URL:** <https://forum.kirupa.com/t/webservice-help/245921>\
**Category:** Uncategorized\
**Created:** [December 5, 2007, 2:55pm UTC](https://forum.kirupa.com/t/webservice-help/245921 "2007-12-05T14:55:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsmith](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@dsmith](https://forum.kirupa.com/u/dsmith)\
**Post date:** [December 5, 2007, 2:55pm UTC](https://forum.kirupa.com/t/webservice-help/245921/1 "2007-12-05T14:55:49Z")

</div>

I am trying to pass an object to a web service call in flash. I need the output of the webservice call to have multiple questions with the same xml tag name.

//setup webservice  
var webService:WebService;  
webService= new WebService(ws);  
webService.getCall.concurrency(SOAPCall.MULTIPLE\_CONCURRENCY);  
webService.getCall.doLazyDecoding(true);

//create object to pass to the service  
var SurveyRequest:Object = new Object;  
SurveyRequest.surveyName = “my survey”;  
SurveyRequest.question = getAnswer();

//pass object into webservice  
var IDResult:Object = new Object();  
IDResult = webService.getRequest(SurveyRequest);

//handle webservice result  
IDResult.onResult = function(result)  
{  
}

//function to return an object containing the question data  
public function getAnswer():Object  
{  
var Q0:Object = new Object;  
var A0:Object = new Object;  
A0.answer = “my answer”;  
Q0.answer = A0;  
Q0.qTitle = “my question”;

return Q0;  
}

When the webService.getRequest(SurveyRequest); is called, it creates an xml structure similar to…

\<SurveyRequest\>  
\<surveyName\>my survey\</surveyName\>  
\<question\>\<qTitle\>my question\</qTitle\>\<answer\>my answer\</answer\>\</question\>  
\</SurveyRequest\>

What I need is to have multiple questions added to the survey, but they must have the same tag name.  
It should look something like

\<SurveyRequest\>  
\<surveyName\>my survey\</surveyName\>  
\<question\>\<qTitle\>my question\</qTitle\>\<answer\>my answer\</answer\>\</question\>  
\<question\>\<qTitle\>my question2\</qTitle\>\<answer\>my answer2\</answer\>\</question\>  
\<question\>\<qTitle\>my question3\</qTitle\>\<answer\>my answer3\</answer\>\</question\>  
\</SurveyRequest\>

Thank you for your help .
