error(Code.R2702, binding);
}
// R2706
for (Iterator itBop = binding.getBindingOperations().iterator(); itBop.hasNext();) {
BindingOperation bop = (BindingOperation) itBop.next();
if (!ensureLiteral(bop)) {
error(Code.R2706, binding);
break;
}
}
// R2705
Style bindingStyle = null;
for (Iterator itBop = binding.getBindingOperations().iterator(); itBop.hasNext();) {
BindingOperation bop = (BindingOperation) itBop.next();
SOAPOperation soapBop = WSDLUtils.getExtension(bop, SOAPOperation.class);
Style opStyle = soapBop != null ? getStyle(soapBop.getStyle()) : null;
if (opStyle == null) {
opStyle = getStyle(soapBinding.getStyle());
if (opStyle == null) {
opStyle = Style.DOCUMENT;
}
}
if (bindingStyle == null) {
bindingStyle = opStyle;
} else if (bindingStyle != opStyle) {
error(Code.R2705, binding);
break;
}
}
// R2201, R2204, R2209
if (bindingStyle == Style.DOCUMENT) {
for (Iterator itBop = binding.getBindingOperations().iterator(); itBop.hasNext();) {
BindingOperation bop = (BindingOperation) itBop.next();
validateDocLitBodyParts(binding,
WSDLUtils.getExtension(bop.getBindingInput(), SOAPBody.class),
bop.getOperation().getInput().getMessage());
validateDocLitBodyParts(binding,
WSDLUtils.getExtension(bop.getBindingOutput(), SOAPBody.class),
bop.getOperation().getOutput().getMessage());
}
}
// R2203
if (bindingStyle == Style.RPC) {
}
// R2205
for (Iterator itBop = binding.getBindingOperations().iterator(); itBop.hasNext();) {
BindingOperation bop = (BindingOperation) itBop.next();
validateHeaderParts(binding,
WSDLUtils.getExtensions(bop.getBindingInput(), SOAPHeader.class),
bop.getOperation().getInput().getMessage());
if (bop.getOperation().getOutput() != null) {
validateHeaderParts(binding,
WSDLUtils.getExtensions(bop.getBindingOutput(), SOAPHeader.class),
bop.getOperation().getOutput().getMessage());
}
/*
for (BindingFault fault : getBindingFaults(bop)) {
validateFaultParts(binding,
getExtension(fault, SOAPFault.class),
bop.getOperation().getFault(fault.getName()).getMessage());
}
*/
}
// R2716
if (bindingStyle == Style.DOCUMENT) {
for (Iterator itBop = binding.getBindingOperations().iterator(); itBop.hasNext();) {
BindingOperation bop = (BindingOperation) itBop.next();
if (!ensureNamespace(bop, false, false) || !ensureNamespace(bop, true, false)) {
error(Code.R2716, binding);
break;
}
}
}
// R2717
if (bindingStyle == Style.RPC) {
for (Iterator itBop = binding.getBindingOperations().iterator(); itBop.hasNext();) {
BindingOperation bop = (BindingOperation) itBop.next();
if (!ensureNamespace(bop, true, true)) {
error(Code.R2717, binding);
break;
}
}
}
// R2726
if (bindingStyle == Style.RPC) {
for (Iterator itBop = binding.getBindingOperations().iterator(); itBop.hasNext();) {
BindingOperation bop = (BindingOperation) itBop.next();
if (!ensureNamespace(bop, false, false)) {
error(Code.R2726, binding);
break;
}
}
}
// R2718
{
Set<String> opNames = new HashSet<String>();
for (Iterator itOp = binding.getPortType().getOperations().iterator(); itOp.hasNext();) {
opNames.add(((Operation) itOp.next()).getName());
}
Set<String> bopNames = new HashSet<String>();
for (Iterator itBop = binding.getBindingOperations().iterator(); itBop.hasNext();) {
bopNames.add(((BindingOperation) itBop.next()).getName());
}
if (!opNames.equals(bopNames)) {
error(Code.R2718, binding);
}
}
// R2720
for (Iterator itBop = binding.getBindingOperations().iterator(); itBop.hasNext();) {
BindingOperation bop = (BindingOperation) itBop.next();
List<ElementExtensible> els = WSDLUtils.getElements(bop);
boolean error = false;
for (SOAPHeader sh : WSDLUtils.getExtensions(els, SOAPHeader.class)) {
error |= (sh.getPart() == null);
for (SOAPHeaderFault shf : WSDLUtils.getSOAPHeaderFaults(sh)) {
error |= (shf.getPart() == null);
}
}
if (error) {
error(Code.R2720, binding);
}
}
// R2721, R2754
for (Iterator itBop = binding.getBindingOperations().iterator(); itBop.hasNext();) {
BindingOperation bop = (BindingOperation) itBop.next();
for (BindingFault fault : WSDLUtils.getBindingFaults(bop)) {
for (SOAPFault sf : WSDLUtils.getExtensions(fault, SOAPFault.class)) {
if (sf.getName() == null) {
error(Code.R2721, binding);
} else if (!sf.getName().equals(fault.getName())) {