A service module controller XML file must be attached to your service module if your service module requires any of the following features:
For example, you can create a file DemoServiceModuleController.xml with the following structure:
<ServiceModuleController validator="ZoneBasedServiceModuleValidator"
globalPanel="GlobalPanel" optionalPanel="OptionalPanel" submitControl="imgBtnSubmit">
<Control required="true" name="txtRequiredField1" message="Please enter the Required field 1 value"></Control>
<Control required="false" name="txtOptionalField1"></Control>
<Control required="true" valueSource="TestDefault" name="txtRequiredField2" message="Please enter the Required field 2 value"></Control>
</ServiceModuleController>
This code sample includes logic to set a default value to the txtRequiredField1 field. In order for this to function properly, you must add an attribute to the appSettings entry as follows:
<appSettings>
<add key="TestDefault" value="Default value example"/>
</appSettings>
Note
If there are other keys already defined in the Web.Config file do not remove them.
Attribute | Required | Description |
---|---|---|
Validator | Yes | Used to plug in the validator to be used for the service module. If you create your own validator, use this attribute to specify it. |
required | Yes | Used to specify if the control is a required field or an
optional field. The supported values are:
|
name | Yes | Used to specify the ID of the control that requires a required field validation to be marked as optional. |
message | no | Used to specify the message that will be displayed to the user if the user does not enter a value or select an item in the control. |
valueSource | No | Sets a default value when the user control is loaded. The value specified should be a valid appSetting key value in the Web.config file. |
GlobalPanel | Yes | Used to specify the ID of the panel control in the service module that will house all the data entry controls. |
OptionalPanel | Yes | Used to specify the ID of the panel control in the service module that will dynamically contain all the optional fields. |
submitControl | Yes | Used to specify the control that will submit the service module data to the Web service. Validation scripts that are generated will be executed when the control has been clicked. |