You can use the "validate" module for schema validation of messages going in and out of xMatters web services.
Add the following lines to the services.xml file inside your service .aar file:
<module ref="validate" />
<parameter name="validationSchema">AlarmPointWebServiceValidation.wsdl.xml</parameter>
<parameter name="validationPolicyOnError">ABORT</parameter>
Parameter | Description |
---|---|
validationSchema | Specifies the URL to access the schema definitions for your service. You must have a separate schema file for this feature; future releases may support automatic schema extraction from the WSDL. Note that schemas are cached for efficiency; if you change the schema, you must restart your web server. |
validationPolicyOnError |
Optional: Indicates how the module should respond if an error occurs during the validation. The possible values are:
|
The validation information is output to the log at the "INFO" logging level. With logging enabled, you should see messages similar to the following:
AlarmPointValidateHandler - Successfully validated 'getItem' body element for service AlarmPointWebService
AlarmPointValidateHandler - Successfully validated 'getItemResponse' body element for service AlarmPointWebService
AlarmPointValidateHandler - Successfully validated 'getTypes' body element for service AlarmPointWebService
AlarmPointValidateHandler - Successfully validated 'getTypesResponse' body element for service AlarmPointWebService
AlarmPointValidateHandler - Successfully validated 'addItem' body element for service AlarmPointWebService
AlarmPointValidateHandler - Successfully validated 'addItemResponse' body element for service AlarmPointWebService
AlarmPointValidateHandler - Successfully validated 'addItem' body element for service AlarmPointWebService
AlarmPointValidateHandler - Successfully validated 'addItem' body element for service AlarmPointWebService
AlarmPointValidateHandler - Successfully validated 'addItemResponse' body element for service AlarmPointWebService
AlarmPointValidateHandler - Successfully validated 'getItemsByType' body element for service AlarmPointWebService
AlarmPointValidateHandler - Successfully validated 'getItemsByTypeResponse' body element for service AlarmPointWebService
Use the following steps to view log messages related to schema validation; note that the following example requires the SOAP monitoring utility to be enabled:
<module ref="validate"/>
<parameter name="validationSchema">file:///e:/AlarmpointSystems/AlarmPoint/webserver/webapps/axis2/WEB-INF/services/AlarmPointWebService/META-INF/AlarmPointWebService.xsd</parameter>
<appender name="AXIS2_VALIDATION" class="org.apache.log4j.FileAppender">
<param name="File" value="${axis2.webapp.root}/WEB-INF/logs/validation.log" />
<param name="Append" value="false" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p %c{2} - %m%n"/>
</layout>
</appender>
<logger name="com.alarmpoint.axis2">
<level value="INFO"/>
<appender-ref ref="AXIS2_VALIDATION" />
</logger>
As the web service requests are received, a new log file called validation.log is created in the webserver/webapps/axis2/WEB-INF/logs directory. View this file to determine why your web service request might be failing.