Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
894 views
in Technique[技术] by (71.8m points)

java - How to use Moxy XPath annotated beans in web services?

I have a 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;
    }
}

This is annotated using eclipselink moxy jaxb. I want to use the same bean and Xpath to host a web service. How do I do this? the web service will be hosted on tomcat 6 or 7

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There isn't a standards based integration point between JAX-WS (JSR-224) and JAXB (JSR-222) implementations. This means support for EclipseLink MOXy as the JAXB provider is dependent upon the JAX-WS implementation (see note below).

JAX-WS Provider - Reference Implementation

Support for MOXy is baked right into the JAX-WS reference implementation. This means any environment leveraging a new enough version of the JAX-WS RI should be able to leverage MOXy as the JAXB provider. I need to find out more about the specifics to do this.

Other JAX-WS Providers

You could leverage the javax.xml.ws.Provider interface instead of the traditional service endpoint interface. Provider gives you access to the actual XML message. With access to the XML message you can interact with it directly using MOXy.

Note

You can create traditional JAX-WS Web Services that leverage MOXy's extends annotations in the following environments:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...