带你走进EJB–将EJB发布为Webservice(3)

***********************

CreateWeb Service Client…

CreateWeb Service…

CallWeb Service Operation…

Serversaid: port1.addUser() is a void method!

Exceptionin thread “main” javax.xml.ws.WebServiceException:java.lang.UnsupportedOperationException: setProperty must be overridden by allsubclasses of SOAPMessage

atorg.jboss.ws.core.jaxws.client.ClientImpl.handleRemoteException(ClientImpl.java:396)

atorg.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:302)

atorg.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:170)

atorg.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)

at$Proxy15.sayHello(Unknown Source)

atejb_webservice_client.WebServiceClient.main(WebServiceClient.java:15)

Causedby: java.lang.UnsupportedOperationException: setProperty must be overridden byall subclasses of SOAPMessage

atjavax.xml.soap.SOAPMessage.setProperty(SOAPMessage.java:439)

atorg.jboss.ws.core.soap.SOAPMessageImpl.(SOAPMessageImpl.java:87)

atorg.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:169)

atorg.jboss.ws.core.CommonSOAP11Binding.createMessage(CommonSOAP11Binding.java:57)

atorg.jboss.ws.core.CommonSOAPBinding.bindRequestMessage(CommonSOAPBinding.java:157)

atorg.jboss.ws.core.CommonClient.invoke(CommonClient.java:290)

atorg.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:290)

… 4more

 

Iread the release notes for Jboss as 4.2.3.GA and it describes what to do ifrunning webservies using jdk1.6. Here is what helped me: (taken from therelease notes and followed exactly as printed)

 

*JBossAS 4.2.3.GA can be compiled with both Java5 & Java6. The Java5compiled binary is our primary/recommended

binarydistribution. It has undergone rigorous testing and can run under both a Java 5and a Java 6 runtime. When

runningunder Java 6 you need to manually copy the following libraries from theJBOSS_HOME/client directory to

theJBOSS_HOME/lib/endorsed directory, so that the JAX-WS 2.0 apis supported byJBossWS are used:

          o jboss-jaxrpc.jar

          o jboss-jaxws.jar

          o jboss-jaxws-ext.jar

          o jboss-saaj.jar

 

jboss-jaxrpc.jar

jboss-jaxws.jar

jboss-jaxws-ext.jar

jboss-saaj.jar

 

出现的问题跟版本有关系.到此我们基本上能够使用EJB发布WebService服务,并且能够调用简单参数的WebService.但是如果想让客户端调用复杂一些的参数呢/span>比如一个实体.下一篇文章将会调用复杂的参数.

来源:吉庆

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2013年9月28日
下一篇 2013年10月1日

相关推荐