Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350517

Summary: JAXWS: Class -> WSDL
Product: z_Archived Reporter: Stephan Leicht Vogt <stephan.leichtvogt>
Component: ScoutAssignee: Project Inbox <scout.sdk-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel.wiehl, trekking09, zimmermann
Version: unspecifiedFlags: zimmermann: kepler+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Stephan Leicht Vogt CLA 2011-06-28 03:05:42 EDT
Please add posibillity to write a POJO and then convert it to JAXWS WSDL-File and structure.
Comment 1 Adrian Moser CLA 2011-08-24 15:59:02 EDT
Since JAX WS already supports to start with code/POJO (or bottom up), I suggest just to enable this feature within Scout JAX-WS support.

Please check the following example:
http://www.torsten-horn.de/techdocs/jee-jax-ws.htm#Minimaler-Webservice
Comment 2 Daniel Wiehl CLA 2012-12-16 13:57:32 EST
Scout JAX-WS implementation does not prevent you from doing code-first webservices but only provides limited tooling support. Once you have registered your port type implementation within the sun-jaxws.xml descriptor file, this webservice is listed in Scout SDK and deployed as well.

At the time of writing this comment, Scout SDK wants you to specify an endpoint interface. This is not necessary and will be fixed. Also, the tooling support for calling WsGen to generate the artifacts is missing, so you have to do this by yourself on the commandline.

In the following I give you a short outline of what you have to do:

1. Create a webservice port type and annotate it with @WebService and the methods with @WebMethod. To control the artifcats generated, you optionally can specify @RequestWrapper and @ResponseWrapper on the service method.

@WebService
public class CodeFirstWebService {
  @WebMethod
  @RequestWrapper(className="foo.bar.HelloWorld")
  @ResponseWrapper(className="foo.bar.HelloWorldResponse")
  public String foo() {
    return "bar";
  }
}

2. Register the port type in sun-jaxws.xml file: 
<jws:endpoint name="CodeFirstWebService" implementation="foo.bar.CodeFirstWebService" url-pattern="/jaxws/fooBar"/>

3. Generate the webservice artifacts using wsgen and copy the 2 files generated to the 'foo.bar' package (e.g. wsgen.exe -cp bin -s gen foo.bar.CodeFirstWebService)

4. You are done, start the application and you can consume your webservice.
Comment 3 Judith Gull CLA 2013-03-05 05:09:19 EST
What is the status here? Are code-first webservices done frequently enough such that tool support makes sense or can this ticket be closed?
Comment 4 Adrian Moser CLA 2013-03-08 01:17:05 EST
If the issue "Scout SDK wants you to specify an endpoint interface. This is not necessary and will be fixed" is solved, this ticket can be closed.

Daniel, can you check if it is fixed?
Comment 5 Judith Gull CLA 2013-03-25 11:21:09 EDT
The issue with the endpoint interface is fixed.

@More Code-First support in Scout SDK
As most of the webservices in Scout projects are implemented using contract-first approach, this won't be implemented anytime soon unless it is a critical blocker for someone.
Comment 6 Matthias Zimmermann CLA 2013-07-08 17:26:33 EDT
Bug closed, shipped with 3.9.0 (Kepler)