if (!(mediator instanceof PaypalMediator)) {
handleException("Unsupported mediator passed in for serialization : "
+ mediator.getType());
}
PaypalMediator paypalMediator = (PaypalMediator) mediator;
OMElement paypalElem = fac.createOMElement("paypal", synNS);
saveTracingState(paypalElem, paypalMediator);
if (paypalMediator.getClientRepository() != null
|| paypalMediator.getAxis2xml() != null) {
OMElement config = fac.createOMElement("configuration", synNS);
if (paypalMediator.getClientRepository() != null) {
config.addAttribute(fac.createOMAttribute("repository", nullNS,
paypalMediator.getClientRepository()));
}
if (paypalMediator.getAxis2xml() != null) {
config.addAttribute(fac.createOMAttribute("axis2xml", nullNS,
paypalMediator.getAxis2xml()));
}
paypalElem.addChild(config);
}
paypalElem.addChild(serializeRequestCredential(paypalMediator
.getRequestCredential()));
paypalElem.addChild(serializeOperation(paypalMediator.getOperation()));
return paypalElem;
}