Java Service Endpoint Interface (SEI) artifacts and stub implementation by Netbeans JAX-WS Wizard gives high level Java centric model for developers.
However there are times when one wants to operate on XML messages level. This is especially the case in Web Services, Application integration and Business integration applications. JAX-WS Provider API provides one to operate at the XML message level in a Web service.
Below example shows one such an example using simple Credit Report Web Service. Later we will show how to use JAXB binding file to customize generated classes.
Credit Report Web Service will consolidate credit report from different sources and inputs in different format.
which imports Schema file
, click finish.
, 'creditEnquiries.xml'
and 'employmentInfo.xml'
files to 'com.creditco.ws.report' package. As we use these to simulate XML data received from other applications.
In our example, if we want to change the generated class name of 'CreditAccount', we could do the following to change it.
Select the JAXB node 'CreditCoReportSchema' and action 'Change JAXB Options' .
Import binding file 'CreditCoCustomization.xjb'
Double click on 'CreditCoCustomization.xjb.xml' to edit the binding file.
Change the class name for element 'CreditAccount' to 'CreditCardAccount' .
Click on 'JAXB bindings' node and select 'Regenerate Java Code' action.
You will see editor showing invalid class reference for 'CreditAccount' in CreditCoReportProvider.java file.
Replace class reference 'CreditAccount' with 'CreditCardAccount' in CreditCoReportProvider.java to use new name.
| BuildDeploy1.png | ![]() |
9978 bytes |
| ChangeJAXBBindingFile1.png | ![]() |
30337 bytes |
| ChangeJAXBOptions1.png | ![]() |
10762 bytes |
| ChangeJAXBOptions2.png | ![]() |
39220 bytes |
| CopySchemaFiles.png | ![]() |
18773 bytes |
| CreateJAXBBinding1.PNG | ![]() |
29069 bytes |
| CreateJAXBBinding1.png | ![]() |
29069 bytes |
| CreateJAXBBinding2.PNG | ![]() |
38770 bytes |
| CreateJAXBBinding2.png | ![]() |
38770 bytes |
| CreateJAXBBinding3.PNG | ![]() |
17341 bytes |
| CreateJAXBBinding3.png | ![]() |
17341 bytes |
| CreateJAXBBinding4.PNG | ![]() |
22702 bytes |
| CreateJAXBBinding4.png | ![]() |
22702 bytes |
| CreateProviderAPIImpl.png | ![]() |
33348 bytes |
| CreditCoCustomization.xjb | ![]() |
528 bytes |
| CreditCoReport.wsdl | ![]() |
2368 bytes |
| CreditCoReport.xsd | ![]() |
7942 bytes |
| CreditCoReportProvider.java | ![]() |
5545 bytes |
| EjbProject.PNG | ![]() |
35420 bytes |
| EjbProject.png | ![]() |
35420 bytes |
| ProviderImpl1.png | ![]() |
17692 bytes |
| ProviderImpl2.png | ![]() |
23084 bytes |
| WSTest1.png | ![]() |
13017 bytes |
| WSTest2.png | ![]() |
30233 bytes |
| addresses.xml | ![]() |
510 bytes |
| createXMLDataFiles.png | ![]() |
22739 bytes |
| creditEnquiries.xml | ![]() |
458 bytes |
| employmentInfo.xml | ![]() |
479 bytes |