_operationQName = new QName( wsdlTypes.getTargetNamespace(), op.getName() ); _oneway = true; String soapBindingUse = WsdlUtils.getSOAPBindingUse( binding, op.getName() ); if ( "encoded".equals( soapBindingUse ) ) { _bindingUse = SOAPBindingUse.ENCODED; _soapAction = WsdlUtils.getSOAPAction( binding.getBindingOperation( op.getName(), null, null ) );
&& wsdlOperation == null; ) { WsdlOperation vCurrentOperation = vItOperation.next(); if ( vCurrentOperation.getOperationQName().getLocalPart().equals( anOperationName ) ) { wsdlOperation = vCurrentOperation; WsdlOpParameterList parameters = wsdlOperation.getParameters(); if ( parameters != null && parameters.getOperation() != null && parameters.getOperation().getInput() != null && parameters.getOperation().getInput().getName() != null ) { request = wsdlOperation.getParameters().getOperation().getInput().getName().toString(); String attributeName = itrType.next(); QName attributeType = type.getElementType( attributeName ); if ( !WebServiceMeta.XSD_NS_URI.equals( attributeType.getNamespaceURI() ) ) { throw new KettleStepException( BaseMessages.getString( PKG, "WebServiceDialog.ERROR0007.UnsupporteOperation.ComplexType" ) ); + param.getName().getLocalPart() + ", mode=" + param.getMode().toString() + ", is not considered" );
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 ); Output output = op.getOutput(); if ( output != null ) { Message out = output.getMessage(); List<Part> outParts = out.getOrderedParts( null );
String opName = op.getName(); OperationType opStyle = op.getStyle(); String defaultInputName = opName; Input input = op.getInput(); String opInputName = input.getName(); OperationType opStyle = op.getStyle(); String defaultOutputName = opName; Output output = op.getOutput(); String opOutputName = output.getName();
if (!operation.isUndefined()) operation.getName(), pw); DOMUtils.printAttribute(Constants.ATTR_PARAMETER_ORDER, StringUtils.getNMTokens(operation.getParameterOrdering()), pw); printDocumentation(operation.getDocumentationElement(), def, pw); OperationType operationType = operation.getStyle(); printInput(operation.getInput(), def, pw); printOutput(operation.getOutput(), def, pw); printInput(operation.getInput(), def, pw); printOutput(operation.getOutput(), def, pw); printInput(operation.getInput(), def, pw); printOutput(operation.getOutput(), def, pw); printFaults(operation.getFaults(), def, pw); List extElements = operation.getExtensibilityElements();
public static QName getInputPartName(Operation op) { Input input = op.getInput(); Map parts = input.getMessage().getParts(); // // one message, one part, one XSD element - that's the system // if (parts.size() != 1) { Object[] filler = { op.getName() }; throw new RuntimeException(_MESSAGES.get("NotDocLiteral", filler)); } Part docLiteralPart = (Part)parts.values().iterator().next(); QName partName = docLiteralPart.getElementName(); // // HACK: this is for Axis/Axiom - they don't handle the default // namespace/prefix well, so we always use a prefix // String prefix = partName.getPrefix(); if (prefix == null || prefix.length() == 0) partName = new QName(partName.getNamespaceURI(), partName.getLocalPart(), "muse-op"); return partName; }
public Map getParts(Operation operation, boolean out) { Message message = null; if (out) { Output output = operation.getOutput(); message = output.getMessage(); } else { Input input = operation.getInput(); message = input.getMessage(); } return message.getParts() == null ? new HashMap() : message.getParts(); }
private Map<QName, Operation> getOperations(PortType portType) { Map<QName, Operation> operations = new HashMap<>(); Collection<Operation> pops = CastUtils.cast(portType.getOperations()); for (Operation op : pops) { operations.put(new QName(portType.getQName().getNamespaceURI(), op.getName()), op); } return operations; }
Message msg = writeRequestMessage(def, desc, bindingOper); input.setMessage(msg); String name = msg.getQName().getLocalPart(); input.setName(name); bindingOper.getBindingInput().setName(name); oper.setInput(input); def.addMessage(msg); output.setMessage(msg); name = msg.getQName().getLocalPart(); output.setName(name); bindingOper.getBindingOutput().setName(name); oper.setOutput(output); def.addMessage(msg); oper.addFault(fault); bindingOper.addBindingFault(bFault); names.clear(); } else { oper.setParameterOrdering(names);
protected void buildBindingOperation(Definition def, Binding binding, Collection<BindingOperationInfo> bindingOperationInfos) { BindingOperation bindingOperation = null; for (BindingOperationInfo bindingOperationInfo : bindingOperationInfos) { bindingOperation = def.createBindingOperation(); addDocumentation(bindingOperation, bindingOperationInfo.getDocumentation()); bindingOperation.setName(bindingOperationInfo.getName().getLocalPart()); for (Operation operation : CastUtils.cast(binding.getPortType().getOperations(), Operation.class)) { if (operation.getName().equals(bindingOperation.getName())) { bindingOperation.setOperation(operation); break; } } buildBindingInput(def, bindingOperation, bindingOperationInfo.getInput()); buildBindingOutput(def, bindingOperation, bindingOperationInfo.getOutput()); buildBindingFault(def, bindingOperation, bindingOperationInfo.getFaults()); addExtensibilityAttributes(def, bindingOperation, bindingOperationInfo.getExtensionAttributes()); addExtensibilityElements(def, bindingOperation, getWSDL11Extensors(bindingOperationInfo)); binding.addBindingOperation(bindingOperation); } }
/** * Create a Operation * * @param def * @param binding * @param desc * @return */ protected BindingOperation writeOperation(Definition def, Binding binding, OperationDesc desc) { Operation oper = def.createOperation(); QName elementQName = desc.getElementQName(); if(elementQName != null && elementQName.getLocalPart() != null) { oper.setName(elementQName.getLocalPart()); } else { oper.setName(desc.getName()); } oper.setUndefined(false); return writeBindingOperation(def, binding, oper, desc); }
private Operation generateOperation(String name, Message inputMsg, Message outputMsg) { Input input = definition.createInput(); input.setName(inputMsg.getQName().getLocalPart()); input.setMessage(inputMsg); Output output = definition.createOutput(); output.setName(outputMsg.getQName().getLocalPart()); output.setMessage(outputMsg); Operation result = definition.createOperation(); result.setName(name); result.setInput(input); result.setOutput(output); result.setUndefined(false); portType.addOperation(result); return result; }
@SuppressWarnings("unchecked") private boolean checkXMLFormat(Binding binding) { List<BindingOperation> bos = binding.getBindingOperations(); boolean result = true; boolean needRootNode = false; for (BindingOperation bo : bos) { Operation op = binding.getPortType().getOperation(bo.getName(), null, null); needRootNode = false; if (op.getInput().getMessage().getParts().size() == 0 || op.getInput().getMessage().getParts().size() > 1) { needRootNode = true; String path = "Binding(" + binding.getQName().getLocalPart() + "):BindingOperation(" + bo.getName() + ")"; Iterator itIn = bo.getBindingInput().getExtensibilityElements().iterator(); if (findXMLFormatRootNode(itIn, bo, path + "-input")) { if (op.getOutput().getMessage().getParts().size() == 0 || op.getOutput().getMessage().getParts().size() > 1) { needRootNode = true;
public Message generateInputMessage(Operation operation, BindingOperation bindingOperation) { Message msg = definition.createMessage(); QName msgName; if (!mapper.isDefaultMapping()) { //mangle the message name //REVISIT, do we put in the entire scope for mangling msgName = new QName(definition.getTargetNamespace(), getScope().tail() + "." + operation.getName()); } else { msgName = new QName(definition.getTargetNamespace(), operation.getName()); } msg.setQName(msgName); msg.setUndefined(false); String inputName = operation.getName() + REQUEST_SUFFIX; Input input = definition.createInput(); input.setName(inputName); input.setMessage(msg); BindingInput bindingInput = definition.createBindingInput(); bindingInput.setName(inputName); bindingOperation.setBindingInput(bindingInput); operation.setInput(input); definition.addMessage(msg); return msg; }
public Message generateOutputMessage(Operation operation, BindingOperation bindingOperation) { Message msg = definition.createMessage(); QName msgName; if (!mapper.isDefaultMapping()) { //mangle the message name //REVISIT, do we put in the entire scope for mangling msgName = new QName(definition.getTargetNamespace(), getScope().tail() + "." + operation.getName() + RESPONSE_SUFFIX); } else { msgName = new QName(definition.getTargetNamespace(), operation.getName() + RESPONSE_SUFFIX); } msg.setQName(msgName); msg.setUndefined(false); String outputName = operation.getName() + RESPONSE_SUFFIX; Output output = definition.createOutput(); output.setName(outputName); output.setMessage(msg); BindingOutput bindingOutput = definition.createBindingOutput(); bindingOutput.setName(outputName); bindingOperation.setBindingOutput(bindingOutput); operation.setOutput(output); definition.addMessage(msg); return msg; }
public QName getOperationQname(String operationName) throws UnknownOperationException { if (getStyle().equals("document")) { try { // Get the QName of the first element of the input message return ((Part) getBindingOperation(operationName) .getOperation().getInput().getMessage() .getOrderedParts(null).get(0)).getElementName(); } catch (RuntimeException e) { logger.warn("Could not find qname of message for operation " + operationName, e); String ns = getDefinition().getTargetNamespace(); return new QName(ns, operationName); } } else { String ns = getOperationNamespaceURI(operationName); return new QName(ns, operationName); } }
private String getWrapperNamespace(String operationName, boolean input) { String ns = null; if (_wsdlPort != null) { Operation operation = WSDLUtil.getOperationByName(_wsdlPort, operationName); if (!_documentStyle) { ns = input ? operation.getInput().getMessage().getQName().getNamespaceURI() : operation.getOutput().getMessage().getQName().getNamespaceURI(); } else { // Note: WS-I Profile allows only one child under SOAPBody. Part part = input ? (Part)operation.getInput().getMessage().getParts().values().iterator().next() : (Part)operation.getOutput().getMessage().getParts().values().iterator().next(); if (part.getElementName() != null) { ns = part.getElementName().getNamespaceURI(); } else if (part.getTypeName() != null) { ns = part.getTypeName().getNamespaceURI(); } } } return ns; }
public void generate() { PortType portType = definition.createPortType(); portType.setQName(new QName(wmodel.getTargetNameSpace(), wmodel.getPortTypeName())); portType.setUndefined(false); for (JavaMethod method : wmodel.getJavaMethods()) { Operation operation = definition.createOperation(); operation.setName(method.getName()); operation.setUndefined(false); Message inputMessage = null; inputMessage = definition.createMessage(); inputMessage.setQName(new QName(wmodel.getTargetNameSpace(), method.getName())); processInputMessage(operation, method, inputMessage); Message outputMessage = null; if (!method.isOneWay()) { outputMessage = definition.createMessage(); outputMessage.setQName(new QName(wmodel.getTargetNameSpace(), method.getName() + "Response")); processOutputMessage(operation, method, outputMessage); } generateFault(method, operation); portType.addOperation(operation); definition.addPortType(portType); } }
public WSDLAwareMessage parseRequest() throws AxisFault { /** * I assume that local part of the Axis Operation's name is always equal to * the operation name in the WSDL. */ BindingOperation bindingOp = wsdlBinding.getBindingOperation( wsdlBinding.getPortType().getOperation( inMessageCtx.getAxisOperation().getName().getLocalPart(), null, null).getName(), null, null); if (bindingOp == null) { throw new AxisFault("WSDL binding operation not found for service: " + serviceName.getLocalPart() + " port: " + portName); } BindingInput bindingInput = bindingOp.getBindingInput(); if (bindingInput == null) { throw new AxisFault("BindingInput not found for service: " + serviceName.getLocalPart() + " port: " + portName); } return processMessageParts(bindingInput); }
public static String getAction(Operation op) { Input input = op.getInput(); Object attr = input.getExtensionAttribute(WsaConstants.ACTION_QNAME); if (attr == null) { Object[] filler = { op.getName(), input.getName(), input.getExtensionAttributes().keySet() }; throw new RuntimeException(_MESSAGES.get("NoActionOnInput", filler)); } return attr instanceof String ? (String)attr : ((QName)attr).getLocalPart(); }