Skip to content

Instantly share code, notes, and snippets.

View malintha's full-sized avatar
🐢

Malintha Fernando malintha

🐢
View GitHub Profile
<service name="MyServiceWithModule">
<description>
This is a sample Web service with a logging module engaged.
</description>
<module ref="logging"/>
<parameter name="ServiceClass" locked="xsd:false">userguide.example2.MyService</parameter>
<operation name="echo">
<messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
</operation>
<operation name="ping">
<phaseOrder type="outflow">
<!-- user can add his own phases to this area -->
<phase name="OperationOutPhase"/>
<phase name="loggingPhase"/>
<!--system predefined phases-->
<!--these phases will run irrespective of the service-->
<phase name="PolicyDetermination"/>
<phase name="MessageOut"/>
</phaseOrder/>
<phaseOrder type="INfaultflow">
<module name="logging" class="LoggingModule">
<InFlow>
<handler name="InFlowLogHandler" class="LogHandler">
<order phase="loggingPhase" />
</handler>
</InFlow>
<OutFlow>
<handler name="OutFlowLogHandler" class="LogHandler">
<order phase="loggingPhase"/>
public class LoggingHandler extends AbstractHandler implements Handler {
private static final Log log = LogFactory.getLog(LogHandler.class);
private String name;
public String getName() {
return name;
}
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
log.info(msgContext.getEnvelope().toString());
/**
* Created by malintha on 9/25/14.
*/
public class LoggingModule implements Module {
public void init(ConfigurationContext configurationContext, AxisModule axisModule) throws AxisFault {}
public void engageNotify(AxisDescription axisDescription) throws AxisFault {}
public void shutdown(ConfigurationContext configurationContext) throws AxisFault {}
/**
* Created by malintha on 9/25/14.
*/
public class MyHandler extends AbstractHandler {
private static Log audit = LogFactory.getLog(MyHandler.class);
@Override
public InvocationResponse invoke(MessageContext messageContext) throws AxisFault {
SOAPEnvelope mes = messageContext.getEnvelope();
SOAPHeader mesh = mes.getHeader();
<?xml version="1.0"?>
<artifactType type="application/vnd.wso2-inventory+xml" shortName="inventory" singularLabel="Inventory" pluralLabel="Inventories"
hasNamespace="false" iconSet="10">
<storagePath>/inventory/@{overview_supplier}/@{overview_item}/@{overview_date}</storagePath>
<nameAttribute>overview_supplier</nameAttribute>
<ui>
<list>
<column name="Supplier">
<data type="path" value="overview_supplier" href="@{storagePath}"/>
</column>
{{#if this.attributes.overview_<wbr />department}}
<div class="col-lg-12 divrow">
<div class="col-lg-2">{{t "Department"}}</div>
<div class="col-lg-10">{{this.<wbr />attributes.overview_<wbr />department}}</div>
</div>
{{/if}}
<field type="text-area" required="false">
<name>Department</name>
</field></div>
<div>
var name;
var hps = require('/extensions/app/greg-publisher-defaults/themes/default/helpers/view-asset.js');
var that = this;
/*
In order to inherit all variables in the default helper
*/
for (name in hps) {
if (hps.hasOwnProperty(name)) {
that[name] = hps[name];