1

How to avoid JAXB setting first letter of class to lower case?

I have the following class that dictates which SOAP request to use in terms of the class name:

@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "UnsolicitedNotificationRequest", propOrder = {
    "toAddress",
    "emailSubject",
    "emailBody",
    "sourceSystem",
    "type",
    "subType",
    "otherInfo"
    
}) 

For whatever reason, the request that my code generates shows the class name as having the first letter lowercase (so unsolicitedNotificationRequest instead of UnsolicitedNotificationRequest)

The following is the request for context:

<ns2:unsolicitedNotificationRequest xmlns:ns2="urn:com.pss.unsolicited.notifications.bo">
    <emailSubject>Alert</emailSubject>
</ns2:unsolicitedNotificationRequest>
Rao
  • 20,781
  • 11
  • 57
  • 77
Rohan
  • 11
  • 1
  • 3
  • 1
    Does this answer your question? [@XMLRootElement versus @XmlType](https://stackoverflow.com/questions/11520724/xmlrootelement-versus-xmltype) You can try: ``@XmlRootElement(name = "UnsolicitedNotificationRequest")`` – David Lukas Mar 03 '22 at 12:47

0 Answers0