Configuring message mapping to process a Web service request
In this lesson, you are enabling the WebSphere Commerce Web services framework to handle your Web Service Description Language (WSDL) document. To enable your Web services framework you must configure message mapping to process a Web service request.
About this task
In the WebSphere Commerce development environment, the default XML configuration files are placed in the xml directory under the installation directory. It is recommended that you use the Rational XML tools to update the message mapping template. You update the template to configure the request operations and determine how the XML document maps as parameters that pass to the business logic.
Procedure
- Open the webservice_SOABOD_template.extension.xml file
to configure the message mapping settings:
- In the Enterprise Explorer view, navigate to .
- Right-click the webservice_SOABOD_template.extension.xml file; select . The XML editor displays.
- Create a template document for the webservice_SOABOD_template.extension.xml file:
- Create the template tags for the webservice_SOABOD_template.extension.xml file:
Results
<TemplateDocument>
<DocumentType>SyncCustomer</DocumentType>
Compare your source code with the following code snippets
to ensure that your message mapping is configured: <TemplateDocument>
<DocumentType>SyncCustomer</DocumentType>
<StartElement>Customer</StartElement>
<TemplateTagName>SyncCustomerMap</TemplateTagName>
<CommandMapping>
<Command CommandName="com.ibm.commerce.usermanagement.commands.UserRegistrationAddCmd">
<Constant Field="URL">noURL</Constant>
<Constant Field="viewTaskName">ConfirmSyncCustomerSuccessBOD</Constant>
<Constant Field="errorViewName">ConfirmSyncCustomerErrorBOD</Constant>
</Command>
</CommandMapping>
</TemplateDocument>
<TemplateTag name="SyncCustomerMap">
<Tag XPath="DisplayName" Field="displayName" />
<Tag XPath="Store" Field="storeId" />
<Tag XPath="ParentOrganization" Field="parentMember" />
<Tag XPath="ProfileType" Field="profileType" />
<Tag XPath="PreferredCurrency" Field="preferredCurrency" />
<Tag XPath="PreferredLanguage" Field="preferredLanguage" />
<Tag XPath="Authentication/Logon" Field="logonId" ></Tag>
<Tag XPath="Authentication/Password" Field="logonPassword" />
<Tag XPath="Authentication/PasswordVerify" Field="logonPasswordVerify" />
<Tag XPath="Authentication/ChallengeQuestion" Field="challengeQuestion" />
<Tag XPath="Authentication/ChallengeAnswer" Field="challengeAnswer" ></Tag>
<!--Contact Information-->
<Tag XPath="Contact/FirstName" Field="firstName" />
<Tag XPath="Contact/LastName" Field="lastName" />
<Tag XPath="Contact/PhoneNumber" Field="phone1" />
<Tag XPath="Contact/FaxNumber" Field="fax1" ></Tag>
<Tag XPath="Contact/Email" Field="email1" ></Tag>
<Tag XPath="Contact/Address/StreetAddress" Field="address1" />
<Tag XPath="Contact/Address/City" Field="city" />
<Tag XPath="Contact/Address/State" Field="state" />
<Tag XPath="Contact/Address/Country" Field="country" />
<Tag XPath="Contact/Address/ZipCode" Field="zipCode" />
<!--Demographics-->
<Tag XPath="Demographics/Gender" Field="gender" />
<Tag XPath="Demographics/Age" Field="age" />
<Tag XPath="Demographics/Income" Field="income" />
<Tag XPath="Demographics/IncomeCurrency" Field="incomeCurrency" />
<Tag XPath="Demographics/MaritalStatus" Field="maritalStatus" ></Tag>
<Tag XPath="Demographics/Hobbies" Field="hobbies" />
<Tag XPath="Demographics/AdditionalInformation" Field="demographicField5" />
</TemplateTag>
You have configured WebSphere Commerce
to accept the SyncCustomer
Web service request and
call the existing business logic to process the request.