OperationType operationType = operation.getStyle();
/** * Check if we are invoking a @Oneway annotated method. * * @param operation The WSDL Operation. * @return True if there is no response to be expected. */ public static boolean isOneWay(final Operation operation) { boolean isOneWay = false; if (operation != null) { isOneWay = operation.getStyle().equals(OperationType.ONE_WAY); } return isOneWay; }
/** * Get the exchange pattern for the specified WS Operation. * * @param operation The operation to check for. * @return The Exchange Pattern. */ public static ExchangePattern getExchangePattern(final Operation operation) { if (operation.getStyle().equals(OperationType.ONE_WAY)) { return ExchangePattern.IN_ONLY; } else { return ExchangePattern.IN_OUT; } } }
/** * Check if we are invoking a @Oneway annotated method. * * @param operation The WSDL Operation. * @return True if there is no response to be expected. */ public static boolean isOneWay(final Operation operation) { boolean isOneWay = false; if (operation != null) { isOneWay = operation.getStyle().equals(OperationType.ONE_WAY); } return isOneWay; }
/** * Get the exchange pattern for the specified WS Operation. * * @param operation The operation to check for. * @return The Exchange Pattern. */ public static ExchangePattern getExchangePattern(final Operation operation) { if (operation.getStyle().equals(OperationType.ONE_WAY)) { return ExchangePattern.IN_ONLY; } else { return ExchangePattern.IN_OUT; } } }
public void checkPortTypes() { for (Iterator itPt = definition.getPortTypes().values().iterator(); itPt.hasNext();) { PortType portType = (PortType) itPt.next(); Set<String> operationNames = new HashSet<String>(); for (Iterator itOp = portType.getOperations().iterator(); itOp.hasNext();) { Operation operation = (Operation) itOp.next(); if (operation.getStyle() != OperationType.ONE_WAY && operation.getStyle() != OperationType.REQUEST_RESPONSE) { error(Code.R2303, portType); } if (!operationNames.add(operation.getName())) { error(Code.R2304, portType); } } } }
@Override public boolean isMember(Correlation o) { return (o.getPattern() == Correlation.CorrelationPattern.OUT) || (o.getPattern()== Correlation.CorrelationPattern.UNSET && oinvoke.operation.getStyle()== OperationType.ONE_WAY ); } });
/** * Registers Open IMA. * It doesn't open IMA for non two way operations. * * @param partnerLink * @param opName * @param mexId * @param mexRef * @return */ String processOutstandingRequest(PartnerLinkInstance partnerLink, String opName, String mexId, String mexRef) { if (__log.isTraceEnabled()) { __log.trace(ObjectPrinter.stringifyMethodEnter("process", new Object[] { "partnerLinkInstance", partnerLink, "operationName", opName, "messageExchangeId", mexId, "mexRef", mexRef })); } final OutstandingRequestIdTuple orid = new OutstandingRequestIdTuple(partnerLink, opName, mexId); if (_byOrid.containsKey(orid)) { //conflictingRequest found return mexRef; } // We convert into outstanding request only for in-out operations (pending release operation) if (partnerLink.partnerLink.getMyRoleOperation(opName).getStyle().equals(OperationType.REQUEST_RESPONSE)) { _byOrid.put(orid, mexRef); } return null; }
/** * Write the body of the binding's stub file. * * @param pw * @throws IOException */ protected void writeFileBody(PrintWriter pw) throws IOException { List operations = binding.getBindingOperations(); for (int i = 0; i < operations.size(); ++i) { BindingOperation operation = (BindingOperation) operations.get(i); Operation ptOperation = operation.getOperation(); OperationType type = ptOperation.getStyle(); Parameters parameters = bEntry.getParameters(operation.getOperation()); // These operation types are not supported. The signature // will be a string stating that fact. if ((OperationType.NOTIFICATION.equals(type)) || (OperationType.SOLICIT_RESPONSE.equals(type))) { pw.println(parameters.signature); pw.println(); } else { writeOperation(pw, parameters); } } } // writeFileBody
/** * Write the body of the binding's stub file. * * @param pw * @throws IOException */ protected void writeFileBody(PrintWriter pw) throws IOException { List operations = binding.getBindingOperations(); for (int i = 0; i < operations.size(); ++i) { BindingOperation operation = (BindingOperation) operations.get(i); Operation ptOperation = operation.getOperation(); OperationType type = ptOperation.getStyle(); Parameters parameters = bEntry.getParameters(operation.getOperation()); // These operation types are not supported. The signature // will be a string stating that fact. if ((OperationType.NOTIFICATION.equals(type)) || (OperationType.SOLICIT_RESPONSE.equals(type))) { pw.println(parameters.signature); pw.println(); } else { writeOperation(pw, parameters); } } } // writeFileBody
/** * Write the body of the binding's stub file. * * @param pw * @throws IOException */ protected void writeFileBody(PrintWriter pw) throws IOException { List operations = binding.getBindingOperations(); for (int i = 0; i < operations.size(); ++i) { BindingOperation operation = (BindingOperation) operations.get(i); Operation ptOperation = operation.getOperation(); OperationType type = ptOperation.getStyle(); Parameters parameters = bEntry.getParameters(operation.getOperation()); // These operation types are not supported. The signature // will be a string stating that fact. if ((OperationType.NOTIFICATION.equals(type)) || (OperationType.SOLICIT_RESPONSE.equals(type))) { pw.println(parameters.signature); pw.println(); } else { writeOperation(pw, parameters); } } } // writeFileBody
private void processPortTypeOperations(Definition srcWsdl, WSDLInterface destInterface, PortType srcPortType, WSDLBinding destBinding) throws WSDLException { Iterator itOperations = srcPortType.getOperations().iterator(); while (itOperations.hasNext()) { Operation srcOperation = (Operation)itOperations.next(); WSDLInterfaceOperation destOperation = new WSDLInterfaceOperation(destInterface, srcOperation.getName()); processUnknownExtensibilityElements(srcOperation, destOperation); destOperation.setStyle(getOperationStyle(srcWsdl, srcPortType, srcOperation)); if (srcOperation.getStyle() != null && false == OperationType.NOTIFICATION.equals(srcOperation.getStyle())) { processPortTypeOperationInput(srcWsdl, srcOperation, destOperation, srcPortType, destBinding); } processPortTypeOperationOutput(srcWsdl, srcOperation, destOperation, srcPortType, destBinding); processPortTypeOperationFaults(srcOperation, destOperation, destInterface, destBinding); // documentation Element documentationElement = srcOperation.getDocumentationElement(); if (documentationElement != null && documentationElement.getTextContent() != null) { destOperation.setDocumentationElement(new WSDLDocumentation(documentationElement.getTextContent())); } destInterface.addOperation(destOperation); } }
/** * Get the name of the specified Output element using the rules defined in WSDL 1.1 * Section 2.4.5 http://www.w3.org/TR/wsdl#_names */ private static String getNameFromOutputElement(Operation op, Output output) { // Get the name from the output element if specified. String result = output.getName(); // If not we'll have to generate it. if (result == null) { // If Request-Response or Solicit-Response do something special per // WSDL 1.1 Section 2.4.5 OperationType operationType = op.getStyle(); if (null != operationType) { if (operationType.equals(OperationType.REQUEST_RESPONSE)) { return op.getName() + RESPONSE; } else if (operationType.equals(OperationType.SOLICIT_RESPONSE)) { return op.getName() + SOLICIT; } } // If the OperationType was not available for some reason, assume on-way or notification if (result == null) { result = op.getName(); } } return result; }
/** * Get the name of the specified Input element using the rules defined in WSDL 1.1 * Section 2.4.5 http://www.w3.org/TR/wsdl#_names */ private static String getNameFromInputElement(Operation op, Input input) { // Get the name from the input element if specified. String result = input.getName(); // If not we'll have to generate it. if (result == null) { // If Request-Response or Solicit-Response do something special per // WSDL 1.1 Section 2.4.5 OperationType operationType = op.getStyle(); if (null != operationType) { if (operationType.equals(OperationType.REQUEST_RESPONSE)) { result = op.getName() + REQUEST; } else if (operationType.equals(OperationType.SOLICIT_RESPONSE)) { result = op.getName() + RESPONSE; } } // If the OperationType was not available for some reason, assume on-way or notification if (result == null) { result = op.getName(); } } return result; }
/** * Get the name of the specified Input element using the rules defined in * WSDL 1.1 Section 2.4.5 http://www.w3.org/TR/wsdl#_names */ private static String getNameFromInputElement(javax.wsdl.Operation op, Input input) { // Get the name from the input element if specified. String result = input.getName(); // If not we'll have to generate it. if (result == null) { // If Request-Response or Solicit-Response do something special per // WSDL 1.1 Section 2.4.5 OperationType operationType = op.getStyle(); if (null != operationType) { if (operationType.equals(OperationType.REQUEST_RESPONSE)) { result = op.getName() + REQUEST; } else if (operationType.equals(OperationType.SOLICIT_RESPONSE)) { result = op.getName() + RESPONSE; } } // If the OperationType was not available for some reason, assume // on-way or notification if (result == null) { result = op.getName(); } } return result; }
public AssertionResult validate( TestAssertion testAssertion, EntryContext entryContext) throws WSIException { Operation operation = (Operation) entryContext.getEntry().getEntryDetail(); OperationType opType = operation.getStyle(); if ((opType == null) || (!opType.equals(OperationType.ONE_WAY) && !opType.equals(OperationType.REQUEST_RESPONSE))) { result = AssertionResult.RESULT_FAILED; if (opType == null) failureDetail = this.validator.createFailureDetail( "Could not determine the operation type for " + operation.getName() + ".", entryContext); else failureDetail = null; // none defined in TAD at present } // Return assertion result return validator.createAssertionResult(testAssertion, result, failureDetail); } }
@SuppressWarnings("unchecked") public void process(JavaInterface intf, Operation operation) throws ToolException { JavaMethod method = new JavaMethod(intf); method.setName(ProcessorUtil.mangleNameToVariableName(operation.getName())); method.setOperationName(operation.getName()); method.setStyle(operation.getStyle()); if (method.getStyle() == null) { if (operation.getOutput() == null) { method.setStyle(OperationType.ONE_WAY); } else { method.setStyle(OperationType.REQUEST_RESPONSE); } } method.setWrapperStyle(isWrapperStyle(operation)); method.setJAXWSBinding(customizing(intf, operation)); processMethod(method, operation); Map<String, Fault> faults = operation.getFaults(); FaultProcessor faultProcessor = new FaultProcessor(env); faultProcessor.process(method, faults); intf.addMethod(method); }