public void accept(WSDLDocumentVisitor visitor) throws Exception { visitor.preVisit(this); //bug fix: 4947340, extensions should be the first element _helper.accept(visitor); for (Iterator iter = _operations.iterator(); iter.hasNext();) { ((BindingOperation) iter.next()).accept(visitor); } visitor.postVisit(this); }
@Override public void validateThis() { if (_name == null) { failValidation("validation.missingRequiredAttribute", "name"); } if (_style == null) { failValidation("validation.missingRequiredProperty", "style"); } // verify operation style if (_style == OperationStyle.ONE_WAY) { if (_input == null) { failValidation("validation.missingRequiredSubEntity", "input"); } if (_output != null) { failValidation("validation.invalidSubEntity", "output"); } if (_faults != null && !_faults.isEmpty()) { failValidation("validation.invalidSubEntity", "fault"); } } }
private boolean boundToFault(String partName) { for (BindingFault bindingFault : info.bindingOperation.faults()) { if (partName.equals(bindingFault.getName())) { return true; } } return false; }
protected SOAPBody getSOAPRequestBody() { SOAPBody requestBody = (SOAPBody)getAnyExtensionOfType(info.bindingOperation.getInput(), SOAPBody.class); if (requestBody == null) { // the WSDL document is invalid error(info.bindingOperation.getInput(), ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_INPUT_MISSING_SOAP_BODY(info.bindingOperation.getName())); } return requestBody; }
protected SOAPBody getSOAPResponseBody() { SOAPBody responseBody = (SOAPBody)getAnyExtensionOfType(info.bindingOperation.getOutput(), SOAPBody.class); if (responseBody == null) { // the WSDL document is invalid error(info.bindingOperation.getOutput(), ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_MISSING_SOAP_BODY(info.bindingOperation.getName())); } return responseBody; }
context.push(); context.registerNamespaces(e); BindingOperation operation = new BindingOperation(forest.locatorTable.getStartLocation(e)); String name = Util.getRequiredAttribute(e, Constants.ATTR_NAME); operation.setName(name); operation.setDocumentation(getDocumentationFor(e2)); } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_INPUT)) { if (gotInput) { XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAME); input.setName(nameAttr); operation.setInput(input); gotInput = true; if (gotOutput) { XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAME); output.setName(nameAttr); operation.setOutput(output); gotOutput = true; if (gotInput) { Util.getRequiredAttribute(e2, Constants.ATTR_NAME); fault.setName(nameAttr); operation.addFault(fault); gotFault = true; operation.setStyle(OperationStyle.ONE_WAY); } else if (gotInput && gotOutput && inputBeforeOutput) {
private List<MessagePart> getHeaderParts(BindingOperation bindingOperation, boolean isInput) { TWSDLExtensible ext; if (isInput) { ext = bindingOperation.getInput(); } else { ext = bindingOperation.getOutput(); SOAPHeader header = headers.next(); if (!header.isLiteral()) { error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_LITERAL(header.getPart(), bindingOperation.getName())); warning(header, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:header", bindingOperation.getName())); error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_CANT_RESOLVE_MESSAGE(header.getMessage(), bindingOperation.getName())); error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_FOUND(header.getPart(), bindingOperation.getName())); warning(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName())); } else { error(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName()));
for( BindingFault bindingFault : info.bindingOperation.faults() ) { com.sun.tools.ws.wsdl.document.Fault portTypeFault = null; for (com.sun.tools.ws.wsdl.document.Fault aFault : info.portTypeOperation.faults()) { info.bindingOperation.getName())); } else { portTypeFault = aFault; info.bindingOperation.getName())); info.bindingOperation.getName())); }else { error(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(bindingFault.getName(), info.bindingOperation.getName()));
@Override public String getNameValue() { return getName(); }
protected boolean isRequestMimeMultipart() { for (TWSDLExtension extension: info.bindingOperation.getInput().extensions()) { if (extension.getClass().equals(MIMEMultipartRelated.class)) { return true; } } return false; }
protected boolean isResponseMimeMultipart() { for (TWSDLExtension extension: info.bindingOperation.getOutput().extensions()) { if (extension.getClass().equals(MIMEMultipartRelated.class)) { return true; } } return false; }
@Override public QName getWSDLElementName() { return getElementName(); }
operation.addExtension(jaxwsBinding); context.pop();
context.push(); context.registerNamespaces(e); BindingOperation operation = new BindingOperation(forest.locatorTable.getStartLocation(e)); String name = Util.getRequiredAttribute(e, Constants.ATTR_NAME); operation.setName(name); operation.setDocumentation(getDocumentationFor(e2)); } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_INPUT)) { if (gotInput) { XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAME); input.setName(nameAttr); operation.setInput(input); gotInput = true; if (gotOutput) { XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAME); output.setName(nameAttr); operation.setOutput(output); gotOutput = true; if (gotInput) { Util.getRequiredAttribute(e2, Constants.ATTR_NAME); fault.setName(nameAttr); operation.addFault(fault); gotFault = true; operation.setStyle(OperationStyle.ONE_WAY); } else if (gotInput && gotOutput && inputBeforeOutput) {
private List<MessagePart> getHeaderParts(BindingOperation bindingOperation, boolean isInput) { TWSDLExtensible ext; if (isInput) { ext = bindingOperation.getInput(); } else { ext = bindingOperation.getOutput(); SOAPHeader header = headers.next(); if (!header.isLiteral()) { error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_LITERAL(header.getPart(), bindingOperation.getName())); warning(header, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:header", bindingOperation.getName())); error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_CANT_RESOLVE_MESSAGE(header.getMessage(), bindingOperation.getName())); error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_FOUND(header.getPart(), bindingOperation.getName())); warning(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName())); } else { error(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), bindingOperation.getName()));
for( BindingFault bindingFault : info.bindingOperation.faults() ) { com.sun.tools.ws.wsdl.document.Fault portTypeFault = null; for (com.sun.tools.ws.wsdl.document.Fault aFault : info.portTypeOperation.faults()) { info.bindingOperation.getName())); } else { portTypeFault = aFault; info.bindingOperation.getName())); info.bindingOperation.getName())); }else { error(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(bindingFault.getName(), info.bindingOperation.getName()));
@Override public String getNameValue() { return getName(); }
protected SOAPBody getSOAPRequestBody() { SOAPBody requestBody = (SOAPBody)getAnyExtensionOfType(info.bindingOperation.getInput(), SOAPBody.class); if (requestBody == null) { // the WSDL document is invalid error(info.bindingOperation.getInput(), ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_INPUT_MISSING_SOAP_BODY(info.bindingOperation.getName())); } return requestBody; }