ContactMapper class

Guidewire core applications send contact information to ContactManager by using an XML SOAP object. They use the ContactMapper class both to generate the SOAP object and to interpret it when they receive an XML SOAP object from ContactManager.

ContactManager and the Guidewire core applications each have their own version of the ContactMapper class. This class enables the applications to convert Contact entities and subentities to XML and send them to ContactManager. The class also enables Guidewire core applications to receive XML representations of the entities from ContactManager and convert them to Contact entities.

ContactManager also uses its version of this class to generate XML to send to the applications and to interpret the XML it receives from the applications. The class file in each core application and in ContactManager explicitly specifies every field of the entities to send or receive and how to handle them in that application.

In the base configuration of each Guidewire core application, the ContactMapper class is configured to handle all the Contact entities and subentities. The class handles the entities and fields of those entities that are to be sent to and received from ContactManager.

In the base configuration, there are differences in entity names, typecodes, and contact entity field names between the core applications and ContactManager. Each Guidewire core application has its own domain namespace, but the ContactManager web services require the ContactManager domain namespace. The core applications use ContactManager web services to communicate with ContactManager. Therefore, when there are differences in names of fields, data types, and typecodes between the core application and ContactManager, each core application is responsible for doing the name mapping.

  • To map differing entity field names, a core application uses a method on the ContactMapper class.
  • To map names of data types and typecodes, a core application uses the ContactMapper class in conjunction with a mapping class that specifies these name mappings. For example, a Contact in the core application maps to an ABContact in ContactManager.

The ContactManager ContactMapper class handles only ABContact entities and subentities. Because ContactManager must be able to communicate with all the Guidewire core applications, its ContactMapper class must contain all fields of each type of contact that each core application needs. In a Guidewire core application, you can map just the contact fields that you want to send to ContactManager and receive from it.

The ContactMapper class creates a SOAP object called XMLBackedInstance to pass the data between a Guidewire core application and ContactManager. This object contains the fields and data of contacts and their related arrays and foreign keys that are defined in the ContactMapper class. XmlBackedInstance has a representation both as an object and as an XML string.

If you are working only with the entities supplied by Guidewire in the base configuration, you do not need to make any changes to the ContactMapper class.

You can extend your Guidewire core application’s Contact data model. You make the extension in ContactManager as well, and then map the entities to each other in ContactMapper in both the Guidewire core application and in ContactManager. Additionally, you use the application’s mapping class to map differing entity names and any different typecodes to and from ContactManager.

See also