IntelliJ web服务和Java客户端IllegalArgumentException TestWebService不是接口

IntelliJ web服务和Java客户端IllegalArgumentException TestWebService不是接口,java,web-services,intellij-idea,Java,Web Services,Intellij Idea,在IntelliJ 10.0.3中 我使用菜单选项new web service,这将生成一个类文件并添加到sun-jaxws.xml中-这很好-它正在工作 现在,如果我尝试为这个web服务编写一个Java客户机,我会发现IllegalArgumentException TestWebService不是一个接口 这是我的客户代码: public class WebServiceTest { public static void main(String[] args) throws Ex

在IntelliJ 10.0.3中

我使用菜单选项new web service,这将生成一个类文件并添加到sun-jaxws.xml中-这很好-它正在工作

现在,如果我尝试为这个web服务编写一个Java客户机,我会发现IllegalArgumentException TestWebService不是一个接口

这是我的客户代码:

public class WebServiceTest {

    public static void main(String[] args) throws Exception {
        URL url = new URL("http://localhost/services/TestWebService?wsdl");
        //1st argument service URI, refer to wsdl document above
        //2nd argument is service name, refer to wsdl document above
        QName qname = new QName("http://ws.mydomain.com/", "TestWebServiceService");

        Service service = Service.create(url, qname);

        TestWebService test = service.getPort(TestWebService.class); // fails here

        System.out.println(test.sayHelloWorldFrom("TESTING...."));
    }
}
我应该如何实现这一点?我应该有一个接口和一个类吗?有好的例子吗?最佳实践

这是我在sun-jaxws.xml中的端点定义

<endpoint
        name='TestWebService'
        implementation='com.allscripts.ws.TestWebService'
        url-pattern='/services/TestWebService'/>

我被搞砸了,因为我正试图使用web服务和我的应用程序使用相同的类路径。在不同的java项目中运行测试效果很好。

。。。如果我编写了一个接口,那么我需要创建一个TestWebServiceImpl类,但是web服务的名称会更改为TestWebServiceImplService,它会工作吗?你可以随时调整名字。我不知道如何调整。我用端点配置编辑了这个问题。我需要在接口和类上都添加注释吗?当我将端点更改为implementation=TestWebServiceImpl时,服务名称也会更改。我不知道要更改XML中的哪些设置。