Sometimes, the conversion the system creates between a Java™ code
and a Service Data Object (SDO) may not meet your needs. Use this procedure
to replace the default Service Component Architecture (SCA) class implementation
with your own.
Before you begin
Make sure that you have generated the Java to Web Services Definition Language (WSDL) type conversion using either
IBM® Integration
Designer or the
genMapper command.
About this task
You override a generated component that maps a Java type
to a WSDL type by replacing the generated code with code that meets your needs.
Consider using your own map if you have defined your own Java classes.
Use this procedure to make the changes.
Procedure
- Locate the generated component. The
component is named java_classMapper.component.
- Edit the component using a text editor.
- Comment out the generated code and provide your own method.
Do not change the file name that contains the component implementation.
Example
This is an example of a generated component to replace:
private DataObject javatodata_setAccount_output(Object myAccount) {
// You can override this code for custom mapping.
// Comment out this code and write custom code.
// You can also change the Java type that is passed to the
// converter, which the converter tries to create.
return SDOJavaObjectMediator.java2Data(myAccount);
}
What to do next
Copy the component and other files to the directory in which the containing module resides, and either wire the component in
IBM Integration
Designer or generate an enterprise archive (EAR) file using the
serviceDeploy command.