<T> void createMethodToOperationMapping(CtMethod<T> m){
String packageName = m.getDeclaringType().getPackage().getQualifiedName();
String operationName = m.getSimpleName();
Definition wsdlDef = wsdlDefMap.get(m.getDeclaringType().getPackage());
String prefix = wsdlNsPrefixMap.get(packageName);
if (wsdlDef != null && prefix != null){
if (wsdlDef.getTypes() == null)
wsdlDef.setTypes(WSDLFactory.eINSTANCE.createTypes());
PortType portType = typePortTypeMap.get(m.getDeclaringType());
javax.jws.WebMethod webMethodAnnotation = m.getAnnotation(javax.jws.WebMethod.class);
if (portType != null && webMethodAnnotation != null){
Operation operation = methodOperationMap.get(m);
if (operation == null) {
operation = WSDLFactory.eINSTANCE.createOperation();
if (!webMethodAnnotation.operationName().equals(""))
operationName = webMethodAnnotation.operationName();
operation.setName(operationName);
operation.setUndefined(false);
Input input = WSDLFactory.eINSTANCE.createInput();
operation.setInput(input);
Output output = WSDLFactory.eINSTANCE.createOutput();
operation.setOutput(output);
portType.addOperation(operation);
Message inputMessage = WSDLFactory.eINSTANCE.createMessage();
inputMessage.setQName(new QName(operation.getEnclosingDefinition().getTargetNamespace(), operationName));
inputMessage.setUndefined(false);
input.setMessage(inputMessage);
wsdlDef.addMessage(inputMessage);
Message outputMessage = WSDLFactory.eINSTANCE.createMessage();
outputMessage.setQName(new QName(operation.getEnclosingDefinition().getTargetNamespace(), operationName + "Response"));
outputMessage.setUndefined(false);
output.setMessage(outputMessage);
wsdlDef.addMessage(outputMessage);
methodOperationMap.put(m,operation);
createWsdlStyleMapping(m);
ASTNodeData typeNodeData = new ASTNodeData();
resolveTypeReference(m.getType(), typeNodeData);
if (typeNodeData.xsdType != null)
createMethodResultToOperationResultMapping(m,typeNodeData.xsdType);
for (CtTypeReference<?> type : m.getThrownTypes()){
if (type.getDeclaration() != null){
if (exceptionTypes.contains(type.getDeclaration())){
XSDComplexTypeDefinition complexType = typeXSDComplexTypeMap.get(type.getDeclaration());
Part part = WSDLFactory.eINSTANCE.createPart();
part.setName(complexType.getName());
part.setTypeDefinition(complexType);
Message faultMessage = WSDLFactory.eINSTANCE.createMessage();
//faultMessage.setQName(new QName(operation.getEnclosingDefinition().getTargetNamespace(), complexType.getName() + "Message"));
faultMessage.setQName(new QName(operation.getEnclosingDefinition().getTargetNamespace(), complexType.getName()));
//faultMessage.setQName(new QName(complexType.getName()));
faultMessage.addPart(part);
faultMessage.setUndefined(false);
wsdlDef.addMessage(faultMessage);
Fault fault = WSDLFactory.eINSTANCE.createFault();
fault.setName(complexType.getName());
fault.setMessage(faultMessage);