This guide leads you through the steps of writing a simple service using JSR 181 annotations. JSR 181 annotations allow you to customize your service and the resulting WSDL relatively easily. This guide assumes you're already familiar with the concepts of getting up and running with XFire outlined in the Quick Start guide. The full example can be found in "examples/jsr181" in the distribution.
First one needs to write the service class. In this example we will allow our users to add Customers to our database and also list them. There will also be some authorization, which comes in the form of the UserToken class. Often authorization information is put in the soap header, so we've declared that all the UserTokens are headers via the @WebParam(header=true) annotation.
Here is the customer service:
The authorization token:
The customer object:
And finally our configuration xml:
