use of javax.wsdl.Message in project cxf by apache.
the class WSIBPValidator method checkR2203And2204.
public boolean checkR2203And2204() {
Collection<Binding> bindings = CastUtils.cast(def.getBindings().values());
for (Binding binding : bindings) {
String style = SOAPBindingUtil.getCanonicalBindingStyle(binding);
if (binding.getPortType() == null) {
return true;
}
for (Iterator<?> ite2 = binding.getPortType().getOperations().iterator(); ite2.hasNext(); ) {
Operation operation = (Operation) ite2.next();
BindingOperation bop = wsdlHelper.getBindingOperation(def, operation.getName());
if (operation.getInput() != null && operation.getInput().getMessage() != null) {
Message inMess = operation.getInput().getMessage();
Set<String> ignorableParts = getIgnorableParts(bop.getBindingInput());
for (Iterator<?> ite3 = inMess.getParts().values().iterator(); ite3.hasNext(); ) {
Part p = (Part) ite3.next();
if (SOAPBinding.Style.RPC.name().equalsIgnoreCase(style) && p.getTypeName() == null && !isHeaderPart(bop, p) && !isIgnorablePart(p.getName(), ignorableParts)) {
addErrorMessage("An rpc-literal binding in a DESCRIPTION MUST refer, " + "in its soapbind:body element(s), only to " + "wsdl:part element(s) that have been defined " + "using the type attribute.");
return false;
}
if (SOAPBinding.Style.DOCUMENT.name().equalsIgnoreCase(style) && p.getElementName() == null && !isIgnorablePart(p.getName(), ignorableParts)) {
addErrorMessage("A document-literal binding in a DESCRIPTION MUST refer, " + "in each of its soapbind:body element(s)," + "only to wsdl:part element(s)" + " that have been defined using the element attribute.");
return false;
}
}
}
if (operation.getOutput() != null && operation.getOutput().getMessage() != null) {
Message outMess = operation.getOutput().getMessage();
Set<String> ignorableParts = getIgnorableParts(bop.getBindingOutput());
for (Iterator<?> ite3 = outMess.getParts().values().iterator(); ite3.hasNext(); ) {
Part p = (Part) ite3.next();
if (style.equalsIgnoreCase(SOAPBinding.Style.RPC.name()) && p.getTypeName() == null && !isHeaderPart(bop, p) && !isIgnorablePart(p.getName(), ignorableParts)) {
addErrorMessage("An rpc-literal binding in a DESCRIPTION MUST refer, " + "in its soapbind:body element(s), only to " + "wsdl:part element(s) that have been defined " + "using the type attribute.");
return false;
}
if (style.equalsIgnoreCase(SOAPBinding.Style.DOCUMENT.name()) && p.getElementName() == null && !isIgnorablePart(p.getName(), ignorableParts)) {
addErrorMessage("A document-literal binding in a DESCRIPTION MUST refer, " + "in each of its soapbind:body element(s)," + "only to wsdl:part element(s)" + " that have been defined using the element attribute.");
return false;
}
}
}
}
}
return true;
}
use of javax.wsdl.Message in project cxf by apache.
the class AttributeVisitor method generateMessage.
private Message generateMessage(XmlSchemaElement element, String name) {
Part part = definition.createPart();
part.setName(PART_NAME);
part.setElementName(element.getQName());
Message result = definition.createMessage();
QName qName = new QName(definition.getTargetNamespace(), name);
if (definition.getMessage(qName) != null) {
String newName = getScope().toString() + "." + name;
qName = new QName(definition.getTargetNamespace(), newName);
}
result.setQName(qName);
result.addPart(part);
result.setUndefined(false);
definition.addMessage(result);
return result;
}
use of javax.wsdl.Message in project cxf by apache.
the class AttributeVisitor method generateSetter.
private void generateSetter(AST typeNode, AST nameNode) {
// generate wrapped doc element in parameter
XmlSchemaElement inParameters = generateWrappedDocElement(typeNode, SETTER_PREFIX + nameNode.toString(), PARAM_NAME);
// generate wrapped doc element out parameter
XmlSchemaElement outParameters = generateWrappedDocElement(null, SETTER_PREFIX + nameNode.toString() + RESULT_POSTFIX, RETURN_PARAM_NAME);
// generate input message
Message inMsg = generateMessage(inParameters, SETTER_PREFIX + nameNode.toString());
// generate output message
Message outMsg = generateMessage(outParameters, SETTER_PREFIX + nameNode.toString() + RESPONSE_POSTFIX);
// generate operation
String name = SETTER_PREFIX + nameNode.toString();
Operation op = generateOperation(name, inMsg, outMsg);
// generate corba return param
ParamType corbaParam = generateCorbaParam(typeNode);
// generate corba operation
OperationType corbaOp = generateCorbaOperation(op, corbaParam, null);
// generate binding
generateCorbaBindingOperation(binding, op, corbaOp);
}
use of javax.wsdl.Message in project cxf by apache.
the class AttributeVisitor method generateGetter.
private void generateGetter(AST typeNode, AST nameNode) {
// generate wrapped doc element in parameter
XmlSchemaElement inParameters = generateWrappedDocElement(null, GETTER_PREFIX + nameNode.toString(), PARAM_NAME);
// generate wrapped doc element out parameter
XmlSchemaElement outParameters = generateWrappedDocElement(typeNode, GETTER_PREFIX + nameNode.toString() + RESULT_POSTFIX, RETURN_PARAM_NAME);
// generate input message
Message inMsg = generateMessage(inParameters, GETTER_PREFIX + nameNode.toString());
// generate output message
Message outMsg = generateMessage(outParameters, GETTER_PREFIX + nameNode.toString() + RESPONSE_POSTFIX);
// generate operation
String name = GETTER_PREFIX + nameNode.toString();
Operation op = generateOperation(name, inMsg, outMsg);
// generate corba return param
ArgType corbaReturn = generateCorbaReturnParam(typeNode);
// generate corba operation
OperationType corbaOp = generateCorbaOperation(op, null, corbaReturn);
// generate binding
generateCorbaBindingOperation(binding, op, corbaOp);
}
use of javax.wsdl.Message in project pentaho-kettle by pentaho.
the class WsdlOperation method loadParameters.
/**
* Create the parameter list for this operations parameter set.
*
* @param op
* Operation.
* @throws KettleStepException
*/
@SuppressWarnings("unchecked")
private void loadParameters(Operation op) throws KettleStepException {
Input input = op.getInput();
if (input != null) {
Message in = input.getMessage();
List<Object> paramOrdering = op.getParameterOrdering();
List<Part> inParts = in.getOrderedParts(paramOrdering);
for (Part part : inParts) {
_params.add(part, true);
}
}
Output output = op.getOutput();
if (output != null) {
Message out = output.getMessage();
List<Part> outParts = out.getOrderedParts(null);
for (Part part : outParts) {
_oneway = false;
_params.add(part, false);
}
}
}
Aggregations