You have to program in the real world, not Hello World, so you want
to write a web service that sends and receives complex types based on a
schema that you have written. That schema is referred to by a WSDL that
you have written, and you want to be sure to maintain the constraints
specified in your schema. You are not using a Provider, but a class
@WebService, so you need to generate
portable types from the schema before your web service will
Basically, you will use the
@WebService.wsdlLocation annotation and
generate your classes at the right point in your build with the XJC Ant
You will create a
Credit web service that
defines a single operation:
authorize. It will accept a
CreditCard complex type and execute some business
logic to determine what amount the card should be authorized for. It
will then return a custom
You’ll write each artifact in the order you would in the real world: the schema, the WSDL, the Java web service, and the build script that puts it all together and deploys it.
The schema in Example 7-1 contains elements that specify parts of a credit card and an authorization amount. The idea in this solution is to create a complex schema, such as you might use in the real world, that is still not overly long.
This schema is suitable for use with a parameter style of bare because the two elements defined ...