ServiceRefPortInfo portInfo = ref.getPortInfoBySEI(serviceEndpointInterface.getName());
if (portInfo!=null) {
// Set MTOM for this port
boolean mtomEnabled = false;
if(portInfo.getMtomEnabled() != null &&
(new Boolean(portInfo.getMtomEnabled())).booleanValue()) {
mtomEnabled = true;
}
if (mtomEnabled) {
Binding bType = bp.getBinding();
// enable mtom valid only for SOAPBindings
if(SOAPBinding.class.isAssignableFrom(bType.getClass())) {
((SOAPBinding)bType).setMTOMEnabled(true);
} else {
WsUtil.getDefaultLogger().log(Level.SEVERE,
WsUtil.getDefaultStringManager().getLocalString("serviceref.invalidmtom",
"MTOM is valid only for SOAP Bindings; Ignoring Enable-MTOM for port {0}",
new Object[] {serviceEndpointInterface}));
}
}
// Set stub properties
Set properties = portInfo.getStubProperties();
for(Iterator iter = properties.iterator(); iter.hasNext();) {
NameValuePairDescriptor next = (NameValuePairDescriptor)
iter.next();
bp.getRequestContext().put(next.getName(), next.getValue());
}
}