Package org.jboss.ws.metadata.wsdl

Examples of org.jboss.ws.metadata.wsdl.WSDLUtils


      Endpoint ep = dep.getService().getEndpointByName(linkName);
     
      Class<?> seiClass = null;
      String seiName;
      WSDLUtils wsdlUtils = WSDLUtils.getInstance();

      String name = (anWebService != null) ? anWebService.name() : "";
      if (name.length() == 0)
         name = WSDLUtils.getJustClassName(sepClass);

      String serviceName = (anWebService != null) ? anWebService.serviceName() : anWebServiceProvider.serviceName();
      if (serviceName.length() == 0)
         serviceName = WSDLUtils.getJustClassName(sepClass) + "Service";

      String serviceNS = (anWebService != null) ? anWebService.targetNamespace() : anWebServiceProvider.targetNamespace();
      if (serviceNS.length() == 0)
         serviceNS = wsdlUtils.getTypeNamespace(sepClass);

      String portName = (anWebService != null) ? anWebService.portName() : anWebServiceProvider.portName();
      if (portName.length() == 0)
         portName = name + "Port";

      String wsdlLocation = (anWebService != null) ? anWebService.wsdlLocation() : anWebServiceProvider.wsdlLocation();
      String interfaceNS = serviceNS; // the default, but a SEI annotation may override this

      if (anWebService != null && anWebService.endpointInterface().length() > 0)
      {
         seiName = anWebService.endpointInterface();
         ClassLoader runtimeClassLoader = dep.getRuntimeClassLoader();
         if(null == runtimeClassLoader)
            throw new IllegalArgumentException("Runtime loader cannot be null");
        
         try
         {
            seiClass = runtimeClassLoader.loadClass(seiName);
         }
         catch(ClassNotFoundException cnfe)
         {
            String msg = "Cannot find class \"" + cnfe.getMessage() + "\" specified in @WebService.endpointInterface.";
            if(cnfe.getMessage() != null && (!cnfe.getMessage().contains(".")))
               msg += " Did you use the fully qualified class name?";
            throw new WSException(msg);
         }

         WebService seiAnnotation = seiClass.getAnnotation(WebService.class);

         if (seiAnnotation == null)
            throw new WSException("Interface does not have a @WebService annotation: " + seiName);

         if (seiAnnotation.portName().length() > 0 || seiAnnotation.serviceName().length() > 0 || seiAnnotation.endpointInterface().length() > 0)
            throw new WSException("@WebService cannot have attribute 'portName', 'serviceName', 'endpointInterface' on: " + seiName);

         // Redefine the interface or "PortType" name
         name = seiAnnotation.name();
         if (name.length() == 0)
            name = WSDLUtils.getJustClassName(seiClass);

         interfaceNS = seiAnnotation.targetNamespace();
         if (interfaceNS.length() == 0)
            interfaceNS = wsdlUtils.getTypeNamespace(seiClass);

         // The spec states that WSDL location should be allowed on an SEI, although it
         // makes far more sense on the implementation bean, so we ONLY consider the SEI
         // wsdlLocation when it is not defined on the bean already
View Full Code Here


/*     */     }
/*     */
/*  78 */     if (sepClass.isAnnotationPresent(WebService.class)) {
/*  79 */       throw new WebServiceException("Provider cannot carry @WebService annotation: " + sepClass.getName());
/*     */     }
/*  81 */     WSDLUtils wsdlUtils = WSDLUtils.getInstance();
/*     */
/*  83 */     String name = WSDLUtils.getJustClassName(sepClass);
/*     */
/*  85 */     String serviceName = anWebServiceProvider.serviceName();
/*  86 */     if (serviceName.length() == 0) {
View Full Code Here

/*     */     }
/* 288 */     Endpoint ep = dep.getService().getEndpointByName(linkName);
/*     */
/* 290 */     Class seiClass = null;
/*     */
/* 292 */     WSDLUtils wsdlUtils = WSDLUtils.getInstance();
/*     */
/* 294 */     String name = anWebService.name();
/* 295 */     if (name.length() == 0) {
/* 296 */       name = WSDLUtils.getJustClassName(sepClass);
/*     */     }
View Full Code Here

/*     */   }
/*     */
/*     */   private String getXMLName(Class javaClass)
/*     */   {
/* 244 */     String name = "";
/* 245 */     WSDLUtils utils = WSDLUtils.getInstance();
/* 246 */     if (Holder.class.isAssignableFrom(javaClass))
/* 247 */       javaClass = utils.getJavaTypeForHolder(javaClass);
/* 248 */     if (javaClass.isArray())
/*     */     {
/* 250 */       int len = utils.getArrayDimension(javaClass);
/* 251 */       for (int i = 0; i < len; i++) {
/* 252 */         javaClass = javaClass.getComponentType();
/*     */       }
/* 254 */       name = utils.getMessagePartForArray(javaClass);
/*     */     }
/*     */     else {
/* 257 */       name = WSDLUtils.getJustClassName(javaClass);
/* 258 */     }return name;
/*     */   }
View Full Code Here

/*     */   }
/*     */
/*     */   private String getDefaultName(Class javaClass)
/*     */   {
/* 352 */     String name = "";
/* 353 */     WSDLUtils utils = WSDLUtils.getInstance();
/* 354 */     if (Holder.class.isAssignableFrom(javaClass))
/* 355 */       javaClass = utils.getJavaTypeForHolder(javaClass);
/* 356 */     if (javaClass.isArray())
/*     */     {
/* 358 */       name = utils.getMessagePartForArray(javaClass);
/*     */     }
/*     */     else
/* 361 */       name = WSDLUtils.getJustClassName(javaClass);
/* 362 */     return name;
/*     */   }
View Full Code Here

/*     */   }
/*     */
/*     */   public void generateJavaSourceFileForRequestResponseStruct(File location, ServiceEndpointInterfaceMapping seim, JBossXSModel xsmodel, String typeNamespace)
/*     */     throws IOException
/*     */   {
/* 194 */     WSDLUtils utils = WSDLUtils.getInstance();
/* 195 */     XSDTypeToJava xst = new XSDTypeToJava();
/* 196 */     xst.setTypeMapping(this.typeMapping);
/* 197 */     xst.setPackageName(this.packageName);
/* 198 */     ServiceEndpointMethodMapping[] mapArr = seim.getServiceEndpointMethodMappings();
/* 199 */     int len = mapArr != null ? mapArr.length : 0;
View Full Code Here

      Endpoint ep = dep.getService().getEndpointByName(linkName);
     
      Class<?> seiClass = null;
      String seiName;
      WSDLUtils wsdlUtils = WSDLUtils.getInstance();

      String name = anWebService.name();
      if (name.length() == 0)
         name = WSDLUtils.getJustClassName(sepClass);

      String serviceName = anWebService.serviceName();
      if (serviceName.length() == 0)
         serviceName = WSDLUtils.getJustClassName(sepClass) + "Service";

      String serviceNS = anWebService.targetNamespace();
      if (serviceNS.length() == 0)
         serviceNS = wsdlUtils.getTypeNamespace(sepClass);

      String portName = anWebService.portName();
      if (portName.length() == 0)
         portName = name + "Port";

      String wsdlLocation = anWebService.wsdlLocation();
      String interfaceNS = serviceNS; // the default, but a SEI annotation may override this

      if (anWebService.endpointInterface().length() > 0)
      {
         seiName = anWebService.endpointInterface();
         ClassLoader runtimeClassLoader = dep.getRuntimeClassLoader();
         if(null == runtimeClassLoader)
            throw new IllegalArgumentException("Runtime loader cannot be null");
        
         seiClass = runtimeClassLoader.loadClass(seiName);
         WebService seiAnnotation = seiClass.getAnnotation(WebService.class);

         if (seiAnnotation == null)
            throw new WSException("Interface does not have a @WebService annotation: " + seiName);

         if (seiAnnotation.portName().length() > 0 || seiAnnotation.serviceName().length() > 0 || seiAnnotation.endpointInterface().length() > 0)
            throw new WSException("@WebService cannot have attribute 'portName', 'serviceName', 'endpointInterface' on: " + seiName);

         // Redefine the interface or "PortType" name
         name = seiAnnotation.name();
         if (name.length() == 0)
            name = WSDLUtils.getJustClassName(seiClass);

         interfaceNS = seiAnnotation.targetNamespace();
         if (interfaceNS.length() == 0)
            interfaceNS = wsdlUtils.getTypeNamespace(seiClass);

         // The spec states that WSDL location should be allowed on an SEI, although it
         // makes far more sense on the implementation bean, so we ONLY consider the SEI
         // wsdlLocation when it is not defined on the bean already
View Full Code Here

   }

   private String getXMLName(Class javaClass)
   {
      String name = "";
      WSDLUtils utils = WSDLUtils.getInstance();
      if(Holder.class.isAssignableFrom(javaClass))
         javaClass = utils.getJavaTypeForHolder(javaClass);
      if(javaClass.isArray())
      {
         int len = utils.getArrayDimension(javaClass);
         for(int i = 0; i < len; i++)
            javaClass = javaClass.getComponentType();

         name = utils.getMessagePartForArray(javaClass);
      }
      else
         name = utils.getJustClassName(javaClass);
      return name;
   }
View Full Code Here

TOP

Related Classes of org.jboss.ws.metadata.wsdl.WSDLUtils

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.