Package org.eclipse.wst.wsdl

Examples of org.eclipse.wst.wsdl.Definition


    }
    return qname;
  }
  static public QName getQName(PartnerLinkType plnk) {
    QName qname;
    Definition def = plnk.getEnclosingDefinition();
    if (def == null) {
      qname = new QName(plnk.getName());
    } else {
      qname = new QName(def.getTargetNamespace(), plnk.getName());
    }
    return qname;
  }
View Full Code Here


//    }
//    return null;
//  }
 
  static public String getIdForExtensibilityElement(ExtensibilityElement element, String localName) {
    Definition def = element.getEnclosingDefinition();
    if (def != null) {
      String targetNameSpace = def.getTargetNamespace();
      if (targetNameSpace != null){
        return getId(new QName(targetNameSpace,localName), element);
      }
    }
    return  getId(new QName(":<unknown>:",localName), element);
View Full Code Here

    String localName = prefixedName;
    if (i != -1) {
      prefix = prefixedName.substring(0,i);
      localName = prefixedName.substring(i+1);
    }
    Definition definition = (Definition)EcoreUtil.getObjectByType(contextResource.getContents(), WSDLPackage.eINSTANCE.getDefinition());
    String namespace = definition.getNamespace(prefix);
    return contextResource.getURI().appendFragment(targetClass+":"+namespace+":"+localName);
  }
View Full Code Here

     
      Iterator<?> it = defn.getImports(qname.getNamespaceURI()).iterator();
      while (it.hasNext() && result == null) {
             ImportImpl imp = (ImportImpl) it.next();
             imp.importDefinitionOrSchema();              
             Definition importedDefinition = (Definition) imp.getDefinition();
             if (importedDefinition != null) {
                 result = resolveUsingFinder (importedDefinition, qname, finder, seen );                         
             }
        }
      return result;
View Full Code Here

            if (schema != null) {
                result = finder.find(schema, qname);
                if (result != null)
                    return result;
            }
            Definition importedDefinition = imp.getEDefinition();
            if (importedDefinition != null) {
                result = resolveXSD(importedDefinition, qname, finder, seen );
                if (result != null) {
                    return result;
                }               
View Full Code Here

          XSDSchema schema = xsdSchemaMap.get(e);
          schema.updateElement();
          fireAddMappingEvent(new JbprocessElementMapping(e,schema.getElement()));
        }
        if (wsdlDefMap.get(e) != null){
          Definition wsdl = wsdlDefMap.get(e);
          wsdl.updateElement();
          fireAddMappingEvent(new JbprocessElementMapping(e,wsdl.getElement()));
        }
        if (classProcessMap.get(e) != null){
          org.eclipse.bpel.model.Process process = classProcessMap.get(e);
          process.updateElement();
          fireAddMappingEvent(new JbprocessBpelProcessMapping(e,process));
View Full Code Here

        }       
      }
    }
    Iterator<Definition> deflist = wsdlDeps.iterator();
    while (deflist.hasNext()){
      Definition def = deflist.next();
      org.eclipse.bpel.model.Import bpelImport = BPELFactory.eINSTANCE.createImport();
      bpelImport.setImportType(WSDLConstants.WSDL_NAMESPACE_URI);
      bpelImport.setLocation(def.getDocumentBaseURI());
      bpelImport.setNamespace(def.getTargetNamespace());
      process.getImports().add(bpelImport);
    }
    Iterator<XSDSchema> schemaList = schemaDeps.iterator();
    while (schemaList.hasNext()){
      XSDSchema schema = schemaList.next();
View Full Code Here

  }
 
  <T> void createClassToPortTypeMapping(CtClass<T> ctClass){
    javax.jws.WebService webService = ctClass.getAnnotation(javax.jws.WebService.class);
    if (webService != null){
      Definition wsdlDef = wsdlDefMap.get(ctClass.getPackage());
      if (wsdlDef != null){
        String prefix = wsdlNsPrefixMap.get(ctClass.getPackage().getQualifiedName());
        if (prefix != null){
          if (!webService.targetNamespace().equals("")){
            wsdlDef.getNamespaces().remove(wsdlDef.getTargetNamespace());
            //wsdlDef.removeNamespace(webService.targetNamespace());
            wsdlDef.setTargetNamespace(webService.targetNamespace());
            wsdlDef.addNamespace(prefix, webService.targetNamespace());
          }
          PortType portType = typePortTypeMap.get(ctClass);
          if (portType == null){
            String portTypeName = ctClass.getSimpleName();
            if (!webService.name().equals(""))
              portTypeName = webService.name();
            portType = WSDLFactory.eINSTANCE.createPortType();
            portType.setQName(new QName(wsdlDef.getQName().getNamespaceURI(),portTypeName));
            portType.setUndefined(false);
            wsdlDef.addPortType(portType);
            typePortTypeMap.put(ctClass, portType);
            javax.jws.soap.SOAPBinding soapBinding = ctClass.getAnnotation(javax.jws.soap.SOAPBinding.class);
            if (soapBinding != null)
              typeSoapBindingMap.put(ctClass, soapBinding);
          }       
View Full Code Here

  }
  <T> void createInterfaceToPortTypeMapping(CtInterface<T> intrface){
    javax.jws.WebService webServiceAnnotation = intrface.getAnnotation(javax.jws.WebService.class);
    if (webServiceAnnotation != null && typePortTypeMap.get(intrface) == null){
      String packageName = intrface.getPackage().getQualifiedName();
      Definition wsdlDef = wsdlDefMap.get(intrface.getPackage());
      String prefix = wsdlNsPrefixMap.get(packageName);
      if (wsdlDef != null && prefix != null){     
        if (!webServiceAnnotation.targetNamespace().equals("")){
          // override default namespace
          wsdlDef.getNamespaces().remove(wsdlDef.getTargetNamespace());
          //wsdlDef.removeNamespace(wsdlDef.getTargetNamespace());
          wsdlDef.setTargetNamespace(webServiceAnnotation.targetNamespace());
          wsdlDef.addNamespace(prefix, webServiceAnnotation.targetNamespace());
        }       
        PortType portType = typePortTypeMap.get(intrface);
        if (portType == null){       
          String portTypeName = intrface.getSimpleName();
          if (!webServiceAnnotation.name().equals(""))
            portTypeName = webServiceAnnotation.name();
          portType = WSDLFactory.eINSTANCE.createPortType();
          portType.setQName(new QName(wsdlDef.getQName().getNamespaceURI(),portTypeName));
          portType.setUndefined(false);       
          wsdlDef.addPortType(portType);
          typePortTypeMap.put(intrface,portType);
          javax.jws.soap.SOAPBinding soapBindingAnnoation = intrface.getAnnotation(javax.jws.soap.SOAPBinding.class);
          if (soapBindingAnnoation != null)
            typeSoapBindingMap.put(intrface, soapBindingAnnoation);       
        }     
View Full Code Here

 
  <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);
               
View Full Code Here

TOP

Related Classes of org.eclipse.wst.wsdl.Definition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.