加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

webservice学习问题(一)

发布时间:2020-12-16 23:33:57 所属栏目:安全 来源:网络整理
导读:今天写了一个webservice小例子,可是发布服务时程序报错: Exception in thread "main" com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class com.anything.service.jaxws.Minus is not found. Have you run APT t

今天写了一个webservice小例子,可是发布服务时程序报错:

Exception in thread "main" com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class com.anything.service.jaxws.Minus is not found. Have you run APT to generate them?
?? ?at com.sun.xml.internal.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:256)
?? ?at com.sun.xml.internal.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:567)
?? ?at com.sun.xml.internal.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:514)
?? ?at com.sun.xml.internal.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:341)
?? ?at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:227)
?? ?at com.sun.xml.internal.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:308)
?? ?at com.sun.xml.internal.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:174)
?? ?at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:420)
?? ?at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:439)
?? ?at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:208)
?? ?at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:138)
?? ?at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:90)
?? ?at javax.xml.ws.Endpoint.publish(Endpoint.java:170)
?? ?at com.anything.service.MyServer.main(MyServer.java:12)


经查资料,最终解决方法

第一种:在服务接口的方法添加@SOAPBinding(style = SOAPBinding.Style.RPC)得以解决

第二种:升级jdk版本,升级为jdk1.6u17及以上版本


初学建议使用第二种方式,第一种方式是改变@SOAPBinding消息的编码样式,webservice默认的DOCUMENT

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读