2
我有一顆豆如何在Web服務中使用Moxy XPath註釋的bean?
@XmlRootElement(name = "alpha")
public class MyBean {
private String thetaValue;
@XmlPath("beta/theta/text()")
public String getThetaValue() {
return this.thetaValue;
}
public void setThetaValue(String thetaValue) {
this.thetaValue = thetaValue;
}
}
這是使用的EclipseLink MOXY JAXB註釋。我想使用相同的bean和Xpath來託管一個Web服務。我該怎麼做呢?該Web服務將託管在tomcat 6或7上
在我的基於JAX WS RI客戶端我需要註釋與Eclipse MOXY的XmlCDATA註解我bean的屬性之一。問題在於JAX WS運行時不使用MOXy,儘管JAXBContextFactory在jaxb.properties中正確指定。整個問題出現在舊的com.sun.xml.ws:jaxws-tools包中以生成類。我有2.1.4,然後升級到2.2.7。此外,我不得不添加com.sun.xml.ws:jaxws-eclipselink-plugin:2.2.7包,它使用了我的XmlCDATA註釋。 –