报错信息如下:
Exception in thread "main" org.codehaus.xfire.annotations.AnnotationException: Service class cannot be abstract: com.tongtech.bjvsp.client.HelloWordServicePortType
at org.codehaus.xfire.annotations.AnnotationServiceFactory.assertValidImplementationClass(AnnotationServiceFactory.java:268)
at org.codehaus.xfire.annotations.AnnotationServiceFactory.create(AnnotationServiceFactory.java:177)
at org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:284)
at com.tongtech.bjvsp.client.HelloWordServiceClient.create0(HelloWordServiceClient.java:59)
at com.tongtech.bjvsp.client.HelloWordServiceClient.<init>(HelloWordServiceClient.java:26)
at com.tongtech.bjvsp.testclient.TestClient.main(TestClient.java:14)
由于客户端的代码是自动生成,所以不知哪里有问题,还是我在写服务器端代码时出了错?
因为是根据wsdl生成的客户端代码,因此我认为服务端应该不存在问题。
本人对于xfire不是十分熟悉,希望指点一二,谢谢
自己已解决(问题为xfire版本冲突),具体是这样的
xfire通过eclipse的software的find and install自动从网上找到最新版本的eclipse的xfire插件(http://dist.codehaus.org/xfire/update/).安装完毕后,使用其Code generation from WSDL document生成stub。其客户端生成后,需要选择生成后的置放路径。由于我之前在本地使用xfire建立客户端,xfire建立时导入了xfire1.1的jar包,当我再建立客户端试图测试访问本地webservice服务器端时,也将客户端的生成代码以及运行客户端所需要的jar包一同导入到同一工程中了,即自己建立的服务器端的工程中。此时,客户端运行所导入的xfire1.2.6和服务器端的xfire1.2.5版本不一致,导致以上问题。只是xfire提示的不是很明确