• Rohan
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I have a WSDL that I successfully imported into Salesforce that has a simple request structure containing:

 

 

....

<xsd:choice>

<xsd:element maxOccurs="1" minOccurs="1" name="ItemCode" type="tns:ItemCodeType" />

<xsd:element maxOccurs="1" minOccurs="1" name="FullSync" type="tns:FullSyncType" />

</xsd:choice>

.....

<xsd:simpleType name="ItemCodeType">

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

<xsd:minLength value="1" />

<xsd:maxLength value="100" />

</xsd:restriction>

</xsd:simpleType>

<xsd:simpleType name="FullSyncType">

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

<xsd:pattern value="((Y|y))" />

</xsd:restriction>

</xsd:simpleType>....

 

When we generate the request in our controller class, we populate a value for ItemCode, and pass null to FullSync, expecting that no tag will be emitted for FullSync.  Instead, we are seeing both the ItemCode and the FullSync tags, with FullSync being empty ("<ItemCode>ABCDEFG</ItemCode><FullSync/>").

 

I've tried adding "nillable=false" among other things -- what could possibly be going wrong??!!?? 

 

UPDATE 01/19/2010 - I've tried using simple xs:strings as the types for my elements within the <choice> above, but had the same problem.  SFDC says they support the choice element -- is there some quirk or exacting attributes that have to be provided on the elements within the choice? 

 

Message Edited by dturkel on 01-19-2010 07:22 AM