WebService异常(一)__javax.xml.ws.Endpoint.publish()

Exception in thread "main" com.sun.xml.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class com.ws.publish.jaxws.SelectMaxAgeStudent is not found. Have you run APT to generate them?

at com.sun.xml.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:285)

at com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:596)

at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:543)

at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:370)

at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:256)

at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:322)

at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:188)

at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)

at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:486)

at com.sun.xml.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:222)

at com.sun.xml.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:152)

at com.sun.xml.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:113)

at javax.xml.ws.Endpoint.publish(Endpoint.java:170)

at com.ws.publish.EndpointPublish.main(EndpointPublish.java:8)

 

完整贴出Eclipse中错误,

jaxws.SelectMaxAgeStudent is not found jaxws在之前学习过手动dos命令下生成Webservice想到我少了JAX-WS2.1.2,jar包;Build Path加入所有jar后还是报错;原因就是我的jdk1.6版本不是最新,需要在实现类前加入@SOAPBinding(style = SOAPBinding.Style.RPC),运行!一切正常

 

tip:

@SOAPBinding(style = SOAPBinding.Style.RPC)指定SOAP消息样式,有两个枚举值:SOAPBinding.Style.DOCUMENT(默认)和 SOAPBinding.Style.RPC,可以对比这两种方式生成的wsdl会有所不同,而且生成的客户端代码也会有所不同。

 

你可能感兴趣的:(exception)