What are the Java types of SYNC_TEST, profile, and
ProfileConstants.SYNCTEST_PROFILE?
Which should map to the schema type ProfileToggleType?
Do you want ProfileToggleType to be an enum? Or do you want this type
to be java.lang.String?
And the same for all other schema types defined according to
<xs:restriction base="xs:string"><xs:enumeration ...>?
-W
On Tue, May 18, 2010 at 10:59 AM, Rochak Gupta <rochak005_at_gmail.com> wrote:
>
> HI,
>
>
>
> While updgrading JAXB1.x to JAXB2.1.10 migration , there is a problem lies in the enumeration . I am pasting the snapshot of xsd which is catching problem
>
>
>
> <xs:simpleType name="ProfileToggleType">
>
> <xs:restriction base="xs:string">
>
> <xs:enumeration value="SubscriptionProfile" />
>
> <xs:enumeration value="Sync_Test" />
>
> </xs:restriction>
>
> </xs:simpleType>
>
>
>
> When we do unmarshal a request
>
>
>
> com.att.osd.bbnms.bbcats.xml.synctest.schema.SyncTestRequest req =
>
> (com.att.osd.bbnms.bbcats.xml.synctest.schema.SyncTestRequest) unmarshaller
>
> .unmarshal(request);
>
>
>
> When we get the respective value from the unmarshalled req object and do subsequent processing as given below
>
>
>
> if (SYNC_TEST.equals(profile))
>
> {
>
> profile = ProfileConstants.SYNCTEST_PROFILE;
>
> }
>
>
>
> The comparison is failing because we expect as per to xsd “Sync_Test” however we are getting “SYNC_TEST” . In JAXB1 we were getting as defined in xsd i.e. “Sync_Test”
>
>
>
> So is there any way through some external binding we can stop jaxb marshaller/unmarshaller to convert everything to bold and have exactly as there in xsd .
>
> Thanks and regards,
> Rochak Gupta
>
>