XsdConfig.jws Sample

A web service illustrating how you can use an XSDCONFIG file to guide naming translation when the schema compiler generates an API corresponding to your schema. The schema for the XML created by this code is EasyPOLocal.xsd, in the Schemas project of the SamplesApp application. Without any configuration, compiling that schema would result in the package and type names defined by that schema.

The EasyPOConfig.xsdconfig file included with the XSD file in the Schemas project tells the schema compiler how to name and package the types it generates. The XSDCONFIG file presents a one-to-one mapping between schema element and proposed API name. It also gives the compiler a package name to use instead of the namespace URI. A name such as "PurchaseOrder2" is the schema compiler's effort to avoid a name conflict. Here, there would be a conflict between the purchase order "document" type that allows you to add a new PURCH_ORDER element to the document, and the purchase order element that gives you access to its children.

Note that guiding the compiler-generated naming does not affect names and namespaces for the underlying XML. The createPO method of this web service returns the XML as it should be shaped according to the original schema.

Concepts Demonstrated by this Sample

Location of Sample Files

This sample is located in the xmlBeans/schema folder of the SamplesApp WebLogic Workshop project. In the file system the location is:

BEA_HOME\weblogic81\samples\workshop\SamplesApp\WebServices\xmlBeans\schema\XsdConfig.jws

To Run the Sample

Related Topics

Getting Started with XMLBeans

How Do I: Guide XMLBeans Type Naming During Schema Compilation?