private boolean generateWsdl(AxisService axisService) { Iterator operatins = axisService.getOperations(); if (operatins.hasNext()) { while (operatins.hasNext()) { AxisOperation axisOperation = (AxisOperation) operatins.next(); if (axisOperation.isControlOperation()) { continue; } if (axisOperation.getMessageReceiver() == null) { continue; } String messageReceiverClass = axisOperation.getMessageReceiver().getClass().getName(); if (!("org.apache.axis2.rpc.receivers.RPCMessageReceiver".equals(messageReceiverClass) || "org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" .equals(messageReceiverClass) || "org.apache.axis2.rpc.receivers.RPCInOutAsyncMessageReceiver" .equals(messageReceiverClass) || "org.apache.axis2.jaxws.server.JAXWSMessageReceiver".equals(messageReceiverClass))) { return false; } } } return true; }
/** * To get the methods which do not use RPC* MessageReceivers * * @param axisService the AxisService to search * @return an ArrayList of the LOCAL PARTS of the QNames of any non-RPC operations TODO: Why not * just return the AxisOperations themselves?? */ private ArrayList<String> getNonRPCMethods(AxisService axisService) { ArrayList<String> excludeOperations = new ArrayList<String>(); Iterator<AxisOperation> operatins = axisService.getOperations(); if (operatins.hasNext()) { while (operatins.hasNext()) { AxisOperation axisOperation = operatins.next(); if (axisOperation.getMessageReceiver() == null) { continue; } String messageReceiverClass = axisOperation.getMessageReceiver().getClass().getName(); if (!("org.apache.axis2.rpc.receivers.RPCMessageReceiver".equals(messageReceiverClass) || "org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" .equals(messageReceiverClass) || "org.apache.axis2.rpc.receivers.RPCInOutAsyncMessageReceiver" .equals(messageReceiverClass) || "org.apache.axis2.jaxws.server.JAXWSMessageReceiver".equals(messageReceiverClass))) { excludeOperations.add(axisOperation.getName().getLocalPart()); } } } return excludeOperations; }
private void setDefaultMessageReceivers() { Iterator operations = service.getPublishedOperations().iterator(); while (operations.hasNext()) { AxisOperation operation = (AxisOperation) operations.next(); if (operation.getMessageReceiver() == null) { MessageReceiver messageReceiver = loadDefaultMessageReceiver(operation.getMessageExchangePattern(), service); if (messageReceiver == null && // we assume that if the MEP is ROBUST_IN_ONLY then the in-out // MR can handle that WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(operation.getMessageExchangePattern())) { messageReceiver = loadDefaultMessageReceiver(WSDL2Constants.MEP_URI_IN_OUT, service); } operation.setMessageReceiver(messageReceiver); } } }