{
if (cachedService != null) {
return cachedService;
}
Handler reqHandler = null;
WSDDChain request = getRequestFlow();
if (request != null) {
reqHandler = request.getInstance(registry);
}
Handler providerHandler = null;
if (providerQName != null) {
try {
providerHandler = WSDDProvider.getInstance(providerQName,
this,
registry);
} catch (Exception e) {
throw new ConfigurationException(e);
}
if (providerHandler == null)
throw new WSDDException(
JavaUtils.getMessage("couldntConstructProvider00"));
}
Handler respHandler = null;
WSDDChain response = getResponseFlow();
if (response != null) {
respHandler = response.getInstance(registry);
}
SOAPService service = new SOAPService(reqHandler, providerHandler,
respHandler);
service.setStyle(style);
service.setHighFidelityRecording(!streaming);
service.setSendType(sendType);
if ( getQName() != null )
service.setName(getQName().getLocalPart());
service.setOptions(getParametersTable());
service.setEngine(((WSDDDeployment)registry).getEngine());
if (style != Style.RPC) {
// No Multirefs/xsi:types
service.setOption(AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
service.setOption(AxisEngine.PROP_SEND_XSI, Boolean.FALSE);
}
// Set handlerInfoChain
if (_wsddHIchain != null) {
HandlerInfoChainFactory hiChainFactory = _wsddHIchain.getHandlerChainFactory();
service.setOption(Constants.ATTR_HANDLERINFOCHAIN, hiChainFactory);
}
AxisEngine.normaliseOptions(service);
initTMR();
tmr.delegate(registry.getTypeMappingRegistry());
WSDDFaultFlow [] faultFlows = getFaultFlows();
if (faultFlows != null && faultFlows.length > 0) {
FaultableHandler wrapper = new FaultableHandler(service);
for (int i = 0; i < faultFlows.length; i++) {
WSDDFaultFlow flow = faultFlows[i];
Handler faultHandler = flow.getInstance(registry);
wrapper.setOption("fault-" + flow.getQName().getLocalPart(),
faultHandler);
}
}