[jboss-user] [JBoss Tools (users)] - Re: Cannot build bottom up web service in eclipse using JBos

Grid.Qian do-not-reply at jboss.com
Tue Nov 11 04:40:41 EST 2008


Hi newmanw10,
I do not know how you create the web service project. So I write my steps to create a web service, please do as my steps and tell me your results.
1 set jre and jboss server in eclipse
2 create a Dynamic Web project:
   name: test
   target runtime: jboss server 4.2
   Dynamic Web Module:2.4
3 set the project facet:
   add JBoss Web Services facet, select the checkbox of Server Supplied  JBossWS Runtime in the JBossWS wizard
4 create a new package named:org.jboss.ws.test and create a java class: TestWS
5 as you said, you want create a simple web service, I write a sample:
  package org.jboss.ws.test;
  | 
  |   import javax.jws.WebMethod;
  |   import javax.jws.WebService;
  | 
  |   @WebService(name = "TestWS", targetNamespace="http://jboss.org")
  |   public class TestWS {
  |       @WebMethod
  |       public int getInt() {
  |           int num = 1;
  |           return num;
  |       }
  |   }
6 select the project,then New->Others->web service, then a wizard opened
  
  In the first page, you can set:
  Service implementation: org.jboss.ws.test.TestWS
  Server:JBoss AS 4.2
  Web Service runtime: JBossWS
  click Next

  In the second page, you can select 'Generate WSDL file' and 'Update default web.xml' 

  In the third page, you can start the server

  Then click Finish button
7 http://localhost:8080/test/TestWS?wsdl may get the wsdl file and in your project/WebContent/wsdl, you can get the wsdl     file too. But this file has not real port address.
8 Then create a web service client project:
  create a Dynamic Web project (like 2 step)
  set project facet (like 3 step)
  select the project, then Nex->Others->web service client then a wizard opened
  in the first page set 
  Service definition: http://localhost:8080/test/TestWS?wsdl
  Web Service runtime: JBossWS
  click Next, then click Finish.

  you can get the client codes.

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

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



More information about the jboss-user mailing list