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 );
output.setName(name); message.setQName(messageName); def.addMessage(message); output.setMessage(message); output.setDocumentationElement(tempEl); output.addExtensibilityElement( parseExtensibilityElement(Output.class, tempEl, def));
protected void printOutput(Output output, Definition def, PrintWriter pw) throws WSDLException { if (output != null) { String tagName = DOMUtils.getQualifiedValue(Constants.NS_URI_WSDL, Constants.ELEM_OUTPUT, def); pw.print(" <" + tagName); DOMUtils.printAttribute(Constants.ATTR_NAME, output.getName(), pw); Message message = output.getMessage(); if (message != null) { DOMUtils.printQualifiedAttribute(Constants.ATTR_MESSAGE, message.getQName(), def, pw); } printExtensibilityAttributes(Output.class, output, def, pw); pw.println('>'); printDocumentation(output.getDocumentationElement(), def, pw); List extElements = output.getExtensibilityElements(); printExtensibilityElements(Output.class, extElements, def, pw); pw.println(" </" + tagName + '>'); } }
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 void buildInterfaceOperation(InterfaceInfo inf, Operation op) { OperationInfo opInfo = inf.addOperation(new QName(inf.getName().getNamespaceURI(), op.getName())); if (recordOriginal) { opInfo.setProperty(WSDL_OPERATION, op); List<String> porderList = CastUtils.cast((List<?>)op.getParameterOrdering()); opInfo.setParameterOrdering(porderList); this.copyExtensors(opInfo, op.getExtensibilityElements()); if (input.getMessage() == null) { throw new WSDLRuntimeException(LOG, "NO_MESSAGE", "input", op.getName(), input.getName()); MessageInfo minfo = opInfo.createMessage(input.getMessage().getQName(), MessageInfo.Type.INPUT); if (output.getMessage() == null) { throw new WSDLRuntimeException(LOG, "NO_MESSAGE", "output", op.getName(), output.getName()); MessageInfo minfo = opInfo.createMessage(output.getMessage().getQName(), MessageInfo.Type.OUTPUT); opInfo.setOutput(output.getName(), minfo); buildMessage(minfo, output.getMessage()); copyExtensors(minfo, output.getExtensibilityElements()); copyExtensionAttributes(minfo, output);
flat.setTargetNamespace(name.getNamespaceURI()); addNamespaces(flat, definition); if (defOper.getOutput() != null) { Output flatOutput = flat.createOutput(); flatOutput.setName(defOper.getOutput().getName()); if (defOper.getOutput().getMessage() != null) { Message flatOutputMsg = copyMessage(defOper.getOutput().getMessage(), flat); flatOutput.setMessage(flatOutputMsg); flat.addMessage(flatOutputMsg); Fault defFault = (Fault) itFault.next(); Fault flatFault = flat.createFault(); flatFault.setName(defFault.getName()); if (defFault.getMessage() != null) { Message flatFaultMsg = copyMessage(defFault.getMessage(), flat); flatFault.setMessage(flatFaultMsg); javax.wsdl.extensions.schema.Schema imp = new SchemaImpl(); imp.setElement(((Schema)it.next()).getRoot()); imp.setElementType(new QName("http://www.w3.org/2001/XMLSchema", "schema")); types.addExtensibilityElement(imp);
operation = def.createOperation(); addDocumentation(operation, operationInfo.getDocumentation()); operation.setUndefined(false); operation.setName(operationInfo.getName().getLocalPart()); addNamespace(operationInfo.getName().getNamespaceURI(), def); if (operationInfo.isOneWay()) { operation.setStyle(OperationType.ONE_WAY); input.setName(operationInfo.getInputName()); Message message = def.createMessage(); buildMessage(message, operationInfo.getInput(), def); this.addExtensibilityAttributes(def, input, getInputExtensionAttributes(operationInfo)); this.addExtensibilityElements(def, input, getWSDL11Extensors(operationInfo.getInput())); input.setMessage(message); Output output = def.createOutput(); addDocumentation(output, operationInfo.getOutput().getDocumentation()); output.setName(operationInfo.getOutputName()); message = def.createMessage(); buildMessage(message, operationInfo.getOutput(), def); this.addExtensibilityAttributes(def, output, getOutputExtensionAttributes(operationInfo)); this.addExtensibilityElements(def, output, getWSDL11Extensors(operationInfo.getOutput())); output.setMessage(message);
protected void visit(Output output) { MessageInfo info = opInfo.createMessage( new QName(opInfo.getInputMessage().getName().getNamespaceURI(), output.getMessage().getQName().getLocalPart())); opInfo.setOutputMessage(info); woutput2msg.put(output, info); if (isWrapped) { createMessageParts(info, getWrappedSchema(output.getMessage())); } else { createMessageParts(info, output.getMessage()); } }
/** * Called after the {@link javax.wsdl.Output} has been created, but it's added to the operation. Subclasses can * override this method to define the output name. * * <p>Default implementation sets the output name to the message name. * * @param definition the WSDL4J {@code Definition} * @param output the WSDL4J {@code Output} */ protected void populateOutput(Definition definition, Output output) { output.setName(output.getMessage().getQName().getLocalPart()); }
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); fault.setMessage(msg); fault.setName(faultDesc.getName()); oper.addFault(fault); bindingOper.addBindingFault(bFault); if (def.getMessage(msg.getQName()) == null) { def.addMessage(msg);
log.info("\tPortType: {}", qname.getLocalPart()); clazzDef.setPackageName(toPackageName(qname.getNamespaceURI())); clazzDef.setClassName(qname.getLocalPart()); portTypeMap.put(qname, clazzDef); String opName = op.getName(); log.info("\t\tOperation: {}", opName); Input in = op.getInput(); Output out = op.getOutput(); Map<QName, Fault> f = op.getFaults(); if (in.getName() == null) { in.setName(opName); processMessages(def, portType, in.getMessage(), opName, 0); if (out.getName() == null) { out.setName(opName + "Response"); processMessages(def, portType, out.getMessage(), opName, 1); for (Object o : f.values()) { Fault fault = (Fault) o; processMessages(def, portType, fault.getMessage(), opName, 2);
Operation operation) { Input input = operation.getInput(); Output output = operation.getOutput(); Collection parts = input.getMessage().getParts().values(); for (Iterator i = parts.iterator(); i.hasNext();) { Part part = (Part)i.next(); OperationWebParam p = new OperationWebParam(part.getElementName().getLocalPart(), part.getName(), Mode.IN, part.getElementName().getNamespaceURI()); parms.add(p); parmMap.put(part.getName(), p); parts = output.getMessage().getParts().values(); for (Iterator i = parts.iterator(); i.hasNext();) { Part part = (Part)i.next(); p = new OperationWebParam(part.getElementName().getLocalPart(), part.getName(), Mode.OUT,
Collection<Binding> bindings = definition.getBindings().values(); for (Binding entry : bindings) { if (entry.getPortType().getQName().equals(portTypeName)) { binding = entry; break; for (Object element : bindingOperation.getExtensibilityElements()) { if (element instanceof SOAPOperation) { soapOperation = (SOAPOperation) element; Operation portTypeOperation = null; for (Operation entry : portTypeOperations) { if (entry.getName().equals(m.getName())) { portTypeOperation = entry; av.visit("name", portTypeOperation.getOutput().getMessage().getQName().getLocalPart()); Collection<Part> parts = portTypeOperation.getOutput().getMessage().getParts().values(); av.visit("partName", parts.iterator().next().getName()); av.visitEnd(); parts = portTypeOperation.getInput().getMessage().getParts().values(); String partName = parts.iterator().next().getName(); av.visit("name", partName);
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; }
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; }
bindIn.setName( op.getInputMessage().getName().getLocalPart() ); bindIn.addExtensibilityElement( body ); wbindOp.setBindingInput( bindIn ); if (wsdlOp.getOutput() != null) bindOut.setName( wsdlOp.getOutput().getName() ); bindOut.addExtensibilityElement( body ); wbindOp.setBindingOutput( bindOut ); Map faults = wsdlOp.getFaults(); if (faults != null) bindingFault.setName(fault.getName()); soapFault.setName(fault.getName()); wbindOp.addBindingFault(bindingFault);
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; }
private DataType getOutputType(Output output, XmlSchemaCollection collection, PortType portType, IntrospectionContext context) { if (output == null) { // no output type specified (e.g. one-way operation), use void return new XSDSimpleType(Void.TYPE, new QName("void")); } Message message = output.getMessage(); List parts = message.getOrderedParts(null); if (parts.isEmpty()) { return getElementDataType(message.getQName(), collection, portType, context); } else { Part part = (Part) parts.get(0); return getDataType(part, collection, portType, context); } }
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;