Package org.jboss.ws.core.jaxrpc

Examples of org.jboss.ws.core.jaxrpc.LiteralTypeMapping


   {
      WSDLToJavaConfig w2jc = config.getWSDLToJavaConfig(false);
      GlobalConfig glc = config.getGlobalConfig(false);

      WSDLToJava wsdlToJava = new WSDLToJava();
      wsdlToJava.setTypeMapping(new LiteralTypeMapping());

      WSDLDefinitions wsdl = null;
      try
      {
         URL wsdlURL = null;
         try
         {
            wsdlURL = new URL(w2jc.wsdlLocation);
         }
         catch (MalformedURLException e)
         {
            // ignore
         }

         if (wsdlURL == null)
         {
            File wsdlFile = new File(w2jc.wsdlLocation);
            if (wsdlFile.exists())
            {
               wsdlURL = wsdlFile.toURL();
            }
         }

         if (wsdlURL == null)
         {
            ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
            wsdlURL = ctxLoader.getResource(w2jc.wsdlLocation);
         }

         if (wsdlURL == null)
            throw new IllegalArgumentException("Cannot load wsdl: " + w2jc.wsdlLocation);

         wsdl = wsdlToJava.convertWSDL2Java(wsdlURL);
         if (glc != null)
            wsdlToJava.setNamespacePackageMap(glc.packageNamespaceMap);

         wsdlToJava.setParameterStyle(w2jc.parameterStyle);
         wsdlToJava.generateSEI(wsdl, new File(outDir));

         //Generate the Service File
         this.generateServiceFile(getPackageName(wsdl, glc), wsdl, outDir);

         //Generate the Mapping File
         if (w2jc.mappingFileNeeded)
         {
            MappingFileGenerator mgf = new MappingFileGenerator(wsdl, new LiteralTypeMapping());
            if (glc != null && glc.packageNamespaceMap != null)
               mgf.setNamespacePackageMap(glc.packageNamespaceMap);       
            mgf.setServiceName(wsdl.getServices()[0].getName().getLocalPart());
            mgf.setParameterStyle(w2jc.parameterStyle);
View Full Code Here


/*     */
/* 131 */         if (xsSimpleType.getVariety() == 2)
/*     */         {
/* 133 */           XSSimpleTypeDefinition itemType = xsSimpleType.getItemType();
/* 134 */           QName xmlBaseType = new QName(itemType.getNamespace(), itemType.getName());
/* 135 */           javaTypeName = new LiteralTypeMapping().getJavaTypeName(xmlBaseType);
/* 136 */           if (javaTypeName != null)
/*     */           {
/* 138 */             javaTypeName = javaTypeName + "[]";
/*     */           }
/*     */
/*     */         }
/*     */
/* 147 */         XSTypeDefinition xsBaseType = xsType.getBaseType();
/* 148 */         while ((javaTypeName == null) && (xsBaseType != null))
/*     */         {
/* 150 */           QName xmlBaseType = new QName(xsBaseType.getNamespace(), xsBaseType.getName());
/* 151 */           javaTypeName = new LiteralTypeMapping().getJavaTypeName(xmlBaseType);
/* 152 */           xsBaseType = xsBaseType.getBaseType();
/*     */         }
/*     */
/* 155 */         if (javaTypeName != null)
/*     */         {
View Full Code Here

/*     */
/* 484 */         if (xmlTypeLocalPart.indexOf("ArrayOfArrayOf") >= 0) {
/* 485 */           compJavaType = compJavaType.getComponentType();
/*     */         }
/* 487 */         boolean isSoapEnc = xmlTypeLocalPart.toLowerCase().indexOf("soapenc") > 0;
/* 488 */         TypeMappingImpl typeMapping = isSoapEnc ? new EncodedTypeMapping() : new LiteralTypeMapping();
/* 489 */         QName compXMLType = typeMapping.getXMLType(compJavaType);
/*     */
/* 491 */         if (compXMLType != null)
/*     */         {
/* 493 */           boolean isBase64 = compXMLType.getLocalPart().startsWith("base64");
View Full Code Here

/*     */   {
/* 260 */     Configuration.WSDLToJavaConfig w2jc = config.getWSDLToJavaConfig(false);
/* 261 */     Configuration.GlobalConfig glc = config.getGlobalConfig(false);
/*     */
/* 263 */     WSDLToJava wsdlToJava = new WSDLToJava();
/* 264 */     wsdlToJava.setTypeMapping(new LiteralTypeMapping());
/*     */
/* 266 */     WSDLDefinitions wsdl = null;
/*     */     try
/*     */     {
/* 269 */       URL wsdlURL = null;
/*     */       try
/*     */       {
/* 272 */         wsdlURL = new URL(w2jc.wsdlLocation);
/*     */       }
/*     */       catch (MalformedURLException e)
/*     */       {
/*     */       }
/*     */
/* 279 */       if (wsdlURL == null)
/*     */       {
/* 281 */         File wsdlFile = new File(w2jc.wsdlLocation);
/* 282 */         if (wsdlFile.exists())
/*     */         {
/* 284 */           wsdlURL = wsdlFile.toURL();
/*     */         }
/*     */       }
/*     */
/* 288 */       if (wsdlURL == null)
/*     */       {
/* 290 */         ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
/* 291 */         wsdlURL = ctxLoader.getResource(w2jc.wsdlLocation);
/*     */       }
/*     */
/* 294 */       if (wsdlURL == null) {
/* 295 */         throw new IllegalArgumentException("Cannot load wsdl: " + w2jc.wsdlLocation);
/*     */       }
/* 297 */       wsdl = wsdlToJava.convertWSDL2Java(wsdlURL);
/* 298 */       if (glc != null) {
/* 299 */         wsdlToJava.setNamespacePackageMap(glc.packageNamespaceMap);
/*     */       }
/* 301 */       wsdlToJava.setParameterStyle(w2jc.parameterStyle);
/* 302 */       wsdlToJava.generateSEI(wsdl, new File(outDir));
/*     */
/* 305 */       generateServiceFile(getPackageName(wsdl, glc), wsdl, outDir);
/*     */
/* 308 */       if (w2jc.mappingFileNeeded)
/*     */       {
/* 310 */         MappingFileGenerator mgf = new MappingFileGenerator(wsdl, new LiteralTypeMapping());
/* 311 */         mgf.setPackageName(getPackageName(wsdl, glc));
/* 312 */         mgf.setServiceName(wsdl.getServices()[0].getName().getLocalPart());
/* 313 */         mgf.setParameterStyle(w2jc.parameterStyle);
/*     */
/* 315 */         JavaWsdlMapping jwm = mgf.generate();
View Full Code Here

TOP

Related Classes of org.jboss.ws.core.jaxrpc.LiteralTypeMapping

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.