[jboss-user] [JBossWS] - advice needed

andydale do-not-reply at jboss.com
Mon Mar 12 10:56:02 EDT 2007


Hi,

Let me first explain that i am a beginner when it come to jboss web services, so i am sorry if this is a stupid problem.

I installed jbossws-1.2.0.GA last week to an ejb3-clustered install of jboss4.0.5.GA.  I then proceeded to follow the simple step listed here http://wiki.jboss.org/wiki/Wiki.jsp?page=JBWS181HelloWorld 
I created an EJB3 (Stateless bean) like so:


@RemoteBinding(jndiBinding = "ws_remote")
  | @Stateless
  | @WebService
  | @SOAPBinding(style = SOAPBinding.Style.RPC)
  | public class WebServiceTestBean implements IWebServiceTestRemote {
  | 
  | 
  |     @WebMethod
  |     @WebResult(name = "res")
  |     public String echo(@WebParam(name = "input_string") String pInputString) {
  |         System.out.println(pInputString);
  |         return pInputString + " :: web serviced";
  |     }
  | 
  | ............
  | }

And the wsdl generation for it worked.  So i am now trying to access it with a simple client.  I created the client using the wsconsume.sh script (with -k option) provided with jbossws.  This creates the following file:

 /**
  |  * JBossWS Generated Source
  |  * 
  |  * Generation Date: Mon Mar 12 14:55:35 CET 2007
  |  * 
  |  * This generated source code represents a derivative work of the input to
  |  * the generator that produced it. Consult the input for the copyright and
  |  * terms of use that apply to this source code.
  |  * 
  |  * JAX-WS Version: 2.0
  |  * 
  |  */
  | @WebServiceClient(name = "WebServiceTestBeanService", targetNamespace = "http://beans.test.com/", wsdlLocation = "http://172.16.26.83:8080/test/Echo?wsdl")
  | public class WebServiceTestBeanService extends Service {
  | 
  |     private final static URL WEBSERVICETESTBEANSERVICE_WSDL_LOCATION;
  | 
  |     static {
  |         URL url = null;
  |         try {
  |             url = new URL("http://172.16.26.83:8080/test/Echo?wsdl");
  |         } catch (MalformedURLException e) {
  |             e.printStackTrace();
  |         }
  |         WEBSERVICETESTBEANSERVICE_WSDL_LOCATION = url;
  |     }
  | 
  |     public WebServiceTestBeanService(URL wsdlLocation, QName serviceName) {
  |         super(wsdlLocation, serviceName);
  |     }
  |     
  |     public WebServiceTestBeanService() {
  |         super(WEBSERVICETESTBEANSERVICE_WSDL_LOCATION, new QName("http://beans.test.com/", "WebServiceTestBeanService"));
  |     }
  | 
  |     
  |     /**
  |      * 
  |      * @return
  |      *     returns WebServiceTestBean
  |      */
  |     @WebEndpoint(name = "WebServiceTestBeanPort")
  |     public WebServiceTestBean getWebServiceTestBeanPort() {
  |         return (WebServiceTestBean)super.getPort(new QName("http://beans.test.com/", "WebServiceTestBeanPort"), WebServiceTestBean.class);
  |     }
  | 
  | }

I then try to create a WebServiceTestBeanService object, and call the getWebServiceTestBeanPort method which should return a proxy to the web service which i can call the test method "echo" with.  

I am running into trouble with creating the WebServiceTestBeanService object, as i get a noClassDefFound exception, the stack trace is:

Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/xb/binding/ObjectModelFactory
  | 	at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:108)
  | 	at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:61)
  | 	at javax.xml.ws.Service.<init>(Service.java:83)
  | 	at com.test.beans.WebServiceTestBeanService.<init>(WebServiceTestBeanService.java:45)
  | 	at com.test.beans.driver.main(driver.java:13)
  | 

can anybody tell me what i have done wrong.

Cheers,

Andy

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4027192#4027192

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4027192



More information about the jboss-user mailing list