`

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会有所不同,而且生成的客户端代码也会有所不同。

 

分享到:
评论
2 楼 你有罪 2012-12-05  
报这个错是什么回事?求指教。
Exception in thread "main" java.lang.AbstractMethodError: weblogic.apache.xerces.dom.ElementNSImpl.setUserData(Ljava/lang/String;Ljava/lang/Object;Lorg/w3c/dom/UserDataHandler;)Ljava/lang/Object;
1 楼 lishuang_0638 2012-03-27  
不行不行。

相关推荐

    使用JAX-WS(JWS)发布WebService

    使用JAX-WS(JWS)发布WebService 使用myeclipse开发java的webservice的两种方式 方式一: (此方式只能作为调试,有以下bug:jdk1.6u17?以下编译器不支持以Endpoint.publish方式发布document方式的soap,必须在...

    开发基于JWS的webservice并通过jun-jaxws发布所需的jar包

    在本场景中,"开发基于JWS的webservice并通过jun-jaxws发布所需的jar包"指的是利用Java API for XML Web Services (JAX-WS) 的一个实现——Sun JAX-WS(也称为Metro)来创建、部署和运行Web服务。Sun JAX-WS是Oracle...

    java 调用webservice的各种方法总结

    import javax.xml.ws.Endpoint; @WebService public class Hello { @WebMethod public String hello(String name) { return "Hello, " + name + "\n"; } public static void main(String[] args) { ...

    java调用webService的各种方法[文].pdf

    import javax.xml.ws.Endpoint; @WebService public class Hello { @WebMethod public String hello(String name) { return "Hello, " + name + "\n"; } public static void main(String[] args) { // 创建...

    使用jaxws快速发布WebService

    运行服务类,这通常是通过继承`javax.xml.ws.Endpoint`并调用`publish()`方法来完成的: ```java public class Server { public static void main(String[] args) { Endpoint.publish(...

    jax webservice 服务器和客户端示例程序

    - **发布服务**:使用`Endpoint`类的`publish`方法发布服务,指定服务的终结点地址。 3. **生成WSDL(Web Service Description Language)** JAX-WS会自动生成WSDL文件,它是描述Web服务的语言,包含了服务的接口...

    jax-ws发布webservice

    import javax.xml.ws.Endpoint; Endpoint.publish("http://localhost:8080/HelloWorld", new HelloWorldServiceImpl()); ``` 二、JAX-WS服务发布 在"jax-ws-server"目录中,包含的就是服务端的相关代码和配置。...

    2020-WebService帮助文档Idea.docx

    WebService是一种基于XML的远程调用技术,可以跨语言和平台调用。它使用SOAP(Simple Object Access Protocol)协议来封装数据,并使用WSDL(Web Service Description Language)文件来描述服务的接口。 在上面的...

    java开发webService完整例子借鉴.pdf

    import javax.xml.ws.Endpoint; @WebService public class Hello { @WebMethod public String hello(String name) { return "Hello, " + name + "\n"; } public static void main(String[] args) { // 创建...

    Java6开发WebService详细啊.docx

    import javax.xml.ws.Endpoint; @WebService public class Java6WebService { public String doSomething() { return "Hello Java6 WebService!"; } public static void main(String[] args) { Endpoint....

    webservice客户端以及服务端

    import javax.xml.ws.Endpoint; public class ServerStart { public static void main(String[] args) { Endpoint.publish("http://localhost:8080/HelloWorld", new HelloWorldServiceImpl()); } } ``` 接下来...

    java_调用Webservice接口借鉴.pdf

    1. 创建一个Web服务Endpoint类,使用@WebService注解标记,并通过@WebMethod注解定义服务方法。例如: ```java @WebService public class Hello { @WebMethod public String hello(String name) { return "Hello,...

    JAVA自带实现webservice.docx

    5. `javax.xml.ws-api.jar` - JAX-WS API,包含Web服务相关的接口和类。 6. `metro-xxxx.jar` - Oracle Metro实现,它是JAX-WS的参考实现,包括编译和运行时支持。 **二、代码实现** 1. **接口类** 首先,定义一...

    java_调用Webservice接口

    import javax.xml.ws.Endpoint; @WebService public class Hello { @WebMethod public String hello(String name) { return "Hello," + name + "\n"; } public static void main(String[] args) { // 创建并...

    JAVA的WebService支持-CXF

    JAX-WS(Java API for XML Web Services)是Java平台中定义WebService的一组标准,它是对早期JAX-RPC的改进和发展。JAX-WS在JDK 1.6中成为标准的一部分,其版本号为2.1。JAX-WS的一个重要特点是支持更为现代的WS-I...

    java中jaxws:endpoint webservices笔记

    import javax.xml.ws.Endpoint; public class Server { public static void main(String[] args) { Endpoint.publish("http://localhost:8080/HelloWorld", new HelloWorldServiceImpl()); } } ``` 在这个例子...

    jws与spring发布WebService

    endpoint.publish("/myWebService"); return endpoint; } ``` 4. **部署和测试**:完成上述步骤后,我们可以将应用打包并部署到服务器上。通过发送SOAP请求,可以测试Web服务是否正常工作。可以使用如Postman...

    webservice

    import javax.xml.ws.Endpoint; /** * HelloService 类实现了一个简单的 WebService。 */ @WebService // 标注此类为 WebService public class HelloService { /** * sayHello 方法用于响应客户端的请求。 * ...

    SpringBoot集成webService

    import javax.xml.ws.Endpoint; @WebService(serviceName = "HelloService", portName = "HelloPort", endpointInterface = "com.example.HelloService") public class HelloServiceImpl implements HelloService {...

Global site tag (gtag.js) - Google Analytics