Expand my Community achievements bar.

Cannot Set Text Value of "simpleContent" XML Element

Avatar

Level 1
Imported WSDL but cannot set the text value of
"simpleContent" XML Elements. See WSDL element definition and
sample code below:



// WSDL Element Definition

/*

<xsd:element maxOccurs="1" minOccurs="0"
name="OpportunityName" type="xsdLocal2:queryType"/>



<xsd:complexType name="queryType">

<xsd:simpleContent>

<xsd:extension base="xsd:string">

<xsd:attribute name="sortorder" type="xsd:string"/>

<xsd:attribute name="sortsequence" type="xsd:string"/>

</xsd:extension>

</xsd:simpleContent>

</xsd:complexType>

*/

// Instantiate object

var opptyQuery:OpportunityQuery = new OpportunityQuery();

// Instantiate type

opptyQuery.OpportunityName = new QueryType();

// Set attribute values

opptyQuery.OpportunityName.sortorder = "ASC";

opptyQuery.OpportunityName.sortsequence = "1";



Resulting XML output

<xsdLocal2:OpportunityName xsi:nil="true" sortorder="ASC"
sortsequence="1"/>



Desired XML output:

<xsdLocal2:OpportunityName sortorder="ASC"
sortsequence="1">Acme Inc*</xsdLocal2:OpportunityName>



What is the ActionScript code required to generate the
desired XML output?



Thanks!
1 Reply

Avatar

Level 1
Forgot to include generated code:

/**

* QueryType.as

* This file was auto-generated from WSDL by the Apache Axis2
generator modified by Adobe

* Any change made to this file will be overwritten when the
code is re-generated.

*/



package generated.webservices{

import mx.utils.ObjectProxy;

import flash.utils.ByteArray;

import mx.rpc.soap.types.*;

/**

* Wrapper class for a operation required type

*/



public class QueryType

{

/**

* Constructor, initializes the type class

*/

public function QueryType() {}



public var sortorder:String;

public var sortsequence:String;public function
toString():String

{

return sortorder.toString() + sortsequence.toString();

}



}

}