I have an element defined as an xsd:double. If I try and place a value say 285 into the element and then I marshal it I get an output of 285.0... That is fine .However, if I put a value in of say 285292746, I get an output of 2.85292746E8 when I marshal. I like something so that double output does not get converted into scientific notation with decimal? Basically I want 285292746 or 2852292746.0000000

java.lang.Double.toString() uses "computerized scientific notation" for certain values which produce isues for xml.

I know double representation of given value is fine. But the fact the value was in exponential format, The system that I am working on is accept my XML but does not know what to do with the exponential value and that causes my program not to work correctly. Changing xsd:double type in WSDL or server is not feasible for me. I am working on client side.

I came across Jaxb:binding for xsd:double type. I am still having hard time to fix the issue to send values double value in non –exponents format.

package com.logger.client 
import javax.xml.bind.annotation.adapters.XmlAdapter;
import javax.xml.bind.DatatypeConverter;

public class JaxbDoubleSerializer  extends XmlAdapter<String, Double>
{


    public Double unmarshal(String value) {
        return ((double)javax.xml.bind.DatatypeConverter.parseDouble(value));
    }

    public String marshal(Double value) {
        if (value == null) {
            return null;
        }
        return (javax.xml.bind.DatatypeConverter.printDouble((double)(double)value));
    }

}

I need help how to use DoubleSerializer so that I can pass values without exponents. I tried using xmlAdapter Annotation in my class MyLogClient.java. I need to know how I can solve this situation.

package com.logger.client 
import javax.xml.ws.BindingProvider;
import javax.xml.bind.JAXBElement;import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBExc
Edit
Report