use of javax.wsdl.BindingFault in project cxf by apache.
the class AbstractWSDLBindingFactory method initializeBindingInfo.
protected BindingInfo initializeBindingInfo(ServiceInfo service, Binding binding, BindingInfo bi) {
bi.setName(binding.getQName());
copyExtensors(bi, binding, null);
for (BindingOperation bop : cast(binding.getBindingOperations(), BindingOperation.class)) {
String inName = null;
String outName = null;
if (bop.getBindingInput() != null) {
inName = bop.getBindingInput().getName();
}
if (bop.getBindingOutput() != null) {
outName = bop.getBindingOutput().getName();
}
String portTypeNs = binding.getPortType().getQName().getNamespaceURI();
QName opName = new QName(portTypeNs, bop.getName());
BindingOperationInfo bop2 = bi.getOperation(opName);
if (bop2 == null) {
bop2 = bi.buildOperation(opName, inName, outName);
if (bop2 != null) {
bi.addOperation(bop2);
}
}
if (bop2 != null) {
copyExtensors(bop2, bop, bop2);
if (bop.getBindingInput() != null) {
copyExtensors(bop2.getInput(), bop.getBindingInput(), bop2);
}
if (bop.getBindingOutput() != null) {
copyExtensors(bop2.getOutput(), bop.getBindingOutput(), bop2);
}
for (BindingFault f : cast(bop.getBindingFaults().values(), BindingFault.class)) {
if (StringUtils.isEmpty(f.getName())) {
throw new IllegalArgumentException("wsdl:fault and soap:fault elements" + " must have a name attribute.");
}
copyExtensors(bop2.getFault(new QName(service.getTargetNamespace(), f.getName())), bop.getBindingFault(f.getName()), bop2);
}
}
}
return bi;
}
Aggregations