How can I write a condition in java for a webservice request, In my webservice request I am passing an element that has SpeedInfo. In SpeedInfo element there is two sub elements Bandwidth and AccessSpeed.
This is my Request In SoapUI:
 <sch:SpeedInfo>
    <ns:Bandwidth xmlns:ns="http://lpp.att.com/logical/classofservice/schema/v1">4000000</ns:Bandwidth>
    <ns:AccessSpeed xmlns:ns="http://lpp.att.com/logical/classofservice/schema/v1">4000000</ns:AccessSpeed>
 </sch:SpeedInfo>
My Java condition:
if (request.getSpeedInfo() == null || (request.getSpeedInfo() == null && request.getSpeedInfo().getBandwidth() == null)){
    throw new Exception(" SpeedInfo Bandwidth must be passed in the request ");
}
I need my condition to check for 3 scenarios:
 1. if <speedInfo> itself is not present
 2. <sch:SpeedInfo> is present, but bandwidth not present:
  <sch:SpeedInfo>
      <ns:AccessSpeed xmlns:ns="http://lpp.att.com/logical/classofservice/schema/v1">40000000</ns:AccessSpeed>
  </sch:SpeedInfo>
 3. Bandwidth is present but no value  
   <sch:SpeedInfo>
      <ns:Bandwidth xmlns:ns="http://lpp.att.com/logical/classofservice/schema/v1"></ns:Bandwidth>
      <ns:AccessSpeed xmlns:ns="http://lpp.att.com/logical/classofservice/schema/v1">40000000</ns:AccessSpeed>
   </sch:SpeedInfo>
error I am getting:
2016-02-02 09:45:48,349  WARN http-bio-8080-exec-3--[c0a8381152a2a943f51] c0a8381152a2a943f51 fw.ws.MessageInInterceptor:49 - Content input stream is NOT null, nothing to log in handleFault()?
2016-02-02 09:45:48,351  WARN http-bio-8080-exec-3--[c0a8381152a2a943f51] c0a8381152a2a943f51 cxf.phase.PhaseInterceptorChain:452 - Interceptor for {http://lpp.att.com/logical/v1}LogicalService#{http://lpp.att.com/logical/v1}classOfServiceAllocation has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Unmarshalling Error: cvc-datatype-valid.1.2.1: '' is not a valid value for 'integer'. 
at    org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:908)
at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:712)
 
     
    