在托管bean中调用Web服务

时间:2012-10-11 14:16:31

标签: web-services jsf jax-ws

我已经使用JAX-WS开发了一个Web服务,并在主类上测试它工作正常。我关注this tutorial。但是当我尝试从JSF页面中的托管bean调用它时,它不起作用。这是我的托管bean:

import javax.faces.event.ActionEvent;
import client.Calculator;
import client.CalculatorService;

public class addBean {

    private int n1;
    private int n2;
    private int somme;
         public addBean() {
    }

    public int getN1() {
        return n1;
    }

    public void setN1(int n1) {
        this.n1 = n1;
    }

    public int getN2() {
        return n2;
    }

    public void setN2(int n2) {
        this.n2 = n2;
    }

    public int getSomme() {
        return somme;
    }

    public void setSomme(int somme) {
        this.somme = somme;
    }

    public void countListener (ActionEvent event){
        CalculatorService calcService = new CalculatorService();
        Calculator calc = calcService.getCalculatorPort();
        somme = calc.add(n1, n2);  
    }
}

错误是

    javax.xml.ws.WebServiceException: Unable to create JAXBContext

0 个答案:

没有答案