Defining a request wrapper for a web service

This recipe describes a method of defining a request wrapper for a web service that is built from Java code. A request wrapper is used by the marshalling process and specifies the bean that is used at runtime. This approach is used in most scenarios when we start developing a web service out of WSDL and want to provide a different Java implementation code.

Getting ready

In this recipe, we will build upon the example from the Wrapping exceptions into faults recipe.

How to do it…

We create a new wrapper class in JDeveloper and name it AuthoriseRequest. The content of the class is trivial; it contains two members and its getter/setter methods. The annotations of the class are more interesting:

@XmlAccessorType(XmlAccessType.FIELD) ...

Get BPEL and Java Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.