JAXB XJC代码生成 – Marshaller生成的xml中缺少“schemaLocation”

我使用XJC工具为我的XSD架构生成Java类。 当我使用JAXB Marshaller将类编组为XML有效负载时,我在输出XML中缺少“schemaLocation”参数,但我在xsd文件中声明了此参数。 如何在输出XML中强制执行“schemaLocation”参数?

下面是用于代码生成的xsd模式文件的开始:

    The request for system command execution.     The action that the Voice System has to proceed.   

问候

尝试这个:

 marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "http://my.namespace my.schema.xsd");