Examples of WSDLUtils


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");
        
         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

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

      return q1.equals(q2);
   }

   private void checkNullParametersInconsistency(Object o1, Object o2, Class c)
   {
      WSDLUtils utils = WSDLUtils.getInstance();
      if ((o1 == null && o2 != null) || (o1 != null && o2 == null))
         throw new IllegalStateException(utils.getJustClassName(c) + " does not match");
   }
View Full Code Here

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

   //                                PRIVATE METHODS
   //
   //*********************************************************************************
   private void checkNullParametersInconsistency(Object o1, Object o2, Class c)
   {
      WSDLUtils utils = WSDLUtils.getInstance();
      if((o1 == null && o2 != null) || (o1 != null && o2 == null) )
         throw new IllegalStateException(utils.getJustClassName(c) + " does not match");
   }
View Full Code Here

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

    * @param ns
    * @return
    */
   public static QName getXMLType(Class javaClass, String ns)
   {
      WSDLUtils utils = WSDLUtils.getInstance();
      QName xmlType = null;
      if(void.class == javaClass)
         return null;

      /**
       * Special boundary condition: When the javaClass is ByteArrayHolder,
       * the xmlType should be xsd:base64Binary, but because of our algorithm,
       * it will become xsd:byte - so need to bypass this.
       */
      if(ByteArrayHolder.class == javaClass)
      {
         return Constants.TYPE_LITERAL_BASE64BINARY;
      }

      if(Holder.class.isAssignableFrom(javaClass))
         javaClass = utils.getJavaTypeForHolder(javaClass);
      xmlType = SchemaUtils.getInstance().getToolsOverrideInTypeMapping(javaClass);
      if(xmlType != null)
         return xmlType;

      // Byte[] should always be mapped to an array of bytes
      // String[] should always be mapped to an array of strings
      if (javaClass != Byte[].class && javaClass != String[].class)
      {
         xmlType = mapping.getXMLType(javaClass,false);
         if(xmlType != null)
            return xmlType;
      }
      //Else create a QName
      String typeName = utils.getJustClassName(javaClass);;
      if(javaClass.isArray())
      {
         int dim = utils.getArrayDimension(javaClass);
         Class cls = javaClass;
         while(cls.isArray())
         {
            cls = cls.getComponentType();
         }
View Full Code Here

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

      // 7.3 Conformance (WebServiceProvider and WebService): A class annotated with the WebServiceProvider
      // annotation MUST NOT carry a WebService annotation
      if (sepClass.isAnnotationPresent(WebService.class))
         throw new WebServiceException("Provider cannot carry @WebService annotation: " + sepClass.getName());

      WSDLUtils wsdlUtils = WSDLUtils.getInstance();

      String name = wsdlUtils.getJustClassName(sepClass);

      String serviceName = anWebServiceProvider.serviceName();
      if (serviceName.length() == 0)
         serviceName = name + "Service";

      String targetNS = anWebServiceProvider.targetNamespace();
      if (targetNS.length() == 0)
         targetNS = wsdlUtils.getTypeNamespace(sepClass);

      String portName = anWebServiceProvider.portName();
      if (portName.length() == 0)
         portName = name + "Port";
View Full Code Here

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.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

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

   }

   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

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

   }

   public void generateJavaSourceFileForRequestResponseStruct(File location, ServiceEndpointInterfaceMapping seim, JBossXSModel xsmodel, String typeNamespace)
         throws IOException
   {
      WSDLUtils utils = WSDLUtils.getInstance();
      XSDTypeToJava xst = new XSDTypeToJava(namespacePackageMap);
      xst.setTypeMapping(this.typeMapping);
      xst.setPackageName(getPackageName(typeNamespace));
      ServiceEndpointMethodMapping[] mapArr = seim.getServiceEndpointMethodMappings();
      int len = mapArr != null ? mapArr.length : 0;
      for (int i = 0; i < len; i++)
      {
         ServiceEndpointMethodMapping mm = mapArr[i];
         String opname = mm.getJavaMethodName();
         String sei = seim.getServiceEndpointInterface();
         String plainClassName = utils.getJustClassName(sei);
         String classname = plainClassName + "_" + opname + "_RequestStruct";
         List<VAR> listInputs = new ArrayList<VAR>();
         MethodParamPartsMapping[] mppmarr = mm.getMethodParamPartsMappings();
         int lenmppmarr = mppmarr != null ? mppmarr.length : 0;
         for (int j = 0; j < lenmppmarr; j++)
View Full Code Here

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.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

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

      // 7.3 Conformance (WebServiceProvider and WebService): A class annotated with the WebServiceProvider
      // annotation MUST NOT carry a WebService annotation
      if (sepClass.isAnnotationPresent(WebService.class))
         throw new WebServiceException("Provider cannot carry @WebService annotation: " + sepClass.getName());

      WSDLUtils wsdlUtils = WSDLUtils.getInstance();

      String name = wsdlUtils.getJustClassName(sepClass);

      String serviceName = anWebServiceProvider.serviceName();
      if (serviceName.length() == 0)
         serviceName = name + "Service";

      String targetNS = anWebServiceProvider.targetNamespace();
      if (targetNS.length() == 0)
         targetNS = wsdlUtils.getTypeNamespace(sepClass);

      String portName = anWebServiceProvider.portName();
      if (portName.length() == 0)
         portName = name + "Port";
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.