function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sarathysarathy 

WSDL having complex type objects with attributes not parsed properly

In my WSDL which I am using I have defined complex type objects with attributes. When the Apex classes get generated, the attributes are not seen in the generated classes.

Here is my wsdl: http://www.ascnet.com/~sarathy/ASARAT.wsdl.

In this WSDL, notice cObject and cForm_ASARAT_Vendor (complex type) objects have a type attribute defined. For my web service to work I need this type attribute set properly in the soap message request. If it is not part of the generated class,
a) how can my get it as part of the generated class? what do I need to adjust in the wsdl?
b) Or can I hand edit the class and add the attribute? If so, how can I do it? what is the syntax?

Thanks
Sarathy
SuperfellSuperfell
See the docs, attributes are not currently supported.
softforcesoftforce

Simon,

 

I have a problem with attributes.

Can we generate a SOAP message like the following from an Apex callout?

 

<Identifier Type="DUNSNumber">A</Identifier>
<Identifier Type="VAT_ID">DE-3324-93</Identifier>

 

<Identifier Type="DUNSNumber">A</Identifier>
<Identifier Type="VAT_ID">DE-3324-93</Identifier>

 

This appears to be possible only by using an extension as follows:

 <xs:element name="Identifier" minOccurs="0" maxOccurs="unbounded">

 <xs:complexType>

 <xs:simpleContent>

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

 <xs:attribute name="Type" use="required" type="xs:string">

 </xs:attribute>

 </xs:extension>

 </xs:simpleContent>

 </xs:complexType>

  </xs:element> 

 

But, Force.com does not like this syntax. It supports creation of only this SOAP message:

 

 

<Identifier Type="DUNSNumber"><value>A</value></Identifier>
Any thoughts on such attribute support in Force.com?
Andi Giri