Java EE – why do I need sun jaxws on GlassFish 4 XML file?

I'm taking the first step towards the jax-ws world and using GlassFish 4

I'm just trying to rebuild the javaee7 Oracle Jax WS sample with the following web services:

@WebService
public class Hello {

    @WebMethod
    public String sayHello(String name) {
        System.out.println("Webservice sayHello called...");
        return "Hello " + name;
    }
}

No more I've deployed it on GlassFish, I can use the tester, I can see the WSDL - good

Now I'm writing a client that should be invoked by the JSF 2 view The following are beans:

@Named
@RequestScoped
public class HelloServiceClient {

    @WebServiceRef(wsdlLocation="http://localhost:8080/HelloService/HelloService?WSDL")
    private HelloService service;

    public String callHello() {
        Hello helloPort = service.getHelloPort();
        return helloPort.sayHello(" JSF2 View!");
    }

    public String callWSSayHello(String name) {
        Hello helloPort = service.getHelloPort();
        return helloPort.sayHello(name);
    }
}

There is also a simple view that simply calls the callhello () method and displays the results

I am deploying the application to the same GlassFish server with the following error:

So I don't understand the concept of sun jaxws - even though the Oracle documentation and examples don't tell me anything about it

What did I do wrong – maybe in my ide or anything else?

Solution

I found the answer to the question:

My ide automatically adds wsservlet as my web Listener for XML – > if you start from the web Delete it from XML, it is working as expected

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>