Skip to main content

Modify the target package for JAXB classes when generating Web Service


Technote (FAQ)


Question

How can you specify the package where the JAXB classes are generated with IBM Rational Application Developer for WebSphere Software, when generating bottom-up Web Services?

Cause

You want to create Web Services easier.

Answer

You can use the annotations @RequestWrapper and @ResponseWrapper with properties className.


  1. Specify the name of the class that represents the request wrapper.

  2. Include the package name separated by dots.


package com;

import javax.jws.WebService;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;

@WebService
public class ServiceImpl {

@RequestWrapper(className="
x.A")
@ResponseWrapper(className=
"x.AResponse")
public A op1(B b){
 return new A();
}

}





The tool will create JAXB classes within the package x.






For more information see the Information Center article about JAX-WS 2.0 Annotations.


Rate this page:

(0 users)Average rating

Copyright and trademark information

IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.

Rate this page:


(0 users)Average rating

Add comments

Document information

Rational Application Developer for WebSphere Software

Web Services Development


Software version:
7.5.5.3, 7.5.5.4, 7.5.5.5, 8.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.0.4.1, 8.5


Operating system(s):
Linux, Solaris, Windows


Reference #:
1617700


Modified date:
2012-11-20

Translate my page

Content navigation