@Override public void write(Object value, OutputStream output, Operation operation) throws IOException, ServiceException { try { Configuration c = (Configuration) xmlConfiguration.newInstance(); Encoder e = new Encoder(c); for (Map.Entry<String, String> entry : getSchemaLocations().entrySet()) { e.setSchemaLocation(entry.getKey(), entry.getValue()); } configureEncoder(e, elementName, xmlConfiguration); e.encode(value, new QName(c.getXSD().getNamespaceURI(), elementName), output); } catch (Exception e) { throw (IOException) new IOException().initCause(e); } }