XmlElement shows up as lowercase in SOAP

211 views Asked by At

I have the following method

public PingResponse ping(String xml) throws RemoteException {
    PingResponse response = new PingResponse();
    response.setPingResult("Service is Live");
    return response;
}

And this is the PingResponse.java

@XmlRootElement(name = "PingResponse")
public class PingResponse implements java.io.Serializable {

    private String pingResult;

    @XmlElement(name = "PingResult")
    public String getPingResult() {
        return pingResult;
    }

    public void setPingResult(String pingResult) {
        this.pingResult = pingResult;
    }

The issue I am having is that the XML response I get has pingResult as lower case. Full example:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <PingResponse>
         <pingResult>Service is Live</pingResult>
      </PingResponse>
   </soapenv:Body>
</soapenv:Envelope>

Any idea what might be the issue here?

0

There are 0 answers