Author: mmerz Date: Tue Dec 21 17:22:09 2004 New Revision: 123026 URL: http://svn.apache.org/viewcvs?view=rev&rev=123026 Log: Fixed target namespace for types, added ant task for generation of types for wsdl2java
Contributor: Daryoush Mehrtash Added: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/AxisTypeGenerator.java incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/AxisTypeGeneratorTask.java incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/WSDLFilter.java Modified: incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/wsdl/WSDL2AnnotatedJavaTest.java incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/AxisHook.java incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181ParameterMetadataImpl.java incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181TypeMetadata.java incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181TypeMetadataImpl.java incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/WSDLProcessor.java incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/Wsdl2AJava.java incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/XmlBeanWSDLProcessor.java incubator/beehive/trunk/wsm/src/runtime/templates/wsdl2ajava.vm Modified: incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/wsdl/WSDL2AnnotatedJavaTest.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/wsdl/WSDL2AnnotatedJavaTest.java?view=diff&rev=123026&p1=incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/wsdl/WSDL2AnnotatedJavaTest.java&r1=123025&p2=incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/wsdl/WSDL2AnnotatedJavaTest.java&r2=123026 ============================================================================== --- incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/wsdl/WSDL2AnnotatedJavaTest.java (original) +++ incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/wsdl/WSDL2AnnotatedJavaTest.java Tue Dec 21 17:22:09 2004 @@ -82,7 +82,7 @@ Jsr181TypeMetadata om = new Jsr181TypeMetadataImpl("myClassName"); om.setWsName("MyWebService"); - om.setWsTargetNamespace("http://www.mynamespace.org/mywebservice"); + om.setWsTargetNamespace("http://beehive.apache.org/mywebservice"); om.setWsWsdlLocation("myWsdlLocation"); Jsr181MethodMetadata method1 = new Jsr181MethodMetadataImpl("firstMethod", void.class); @@ -97,11 +97,11 @@ Jsr181ParameterMetadata param1 = new Jsr181ParameterMetadataImpl(); param1.setJavaType(String.class); param1.setWpName("myStringParam"); - param1.setWpTargetNamespace("http://www.mynamespace.org/myparameters"); + param1.setWpTargetNamespace("http://beehive.apache.org/myparameters"); param1.setWpMode(WebParam.Mode.INOUT); method2.addParam(param1); method2.setWrName("method2Result"); - method2.setWrTargetNamespace("http://www.mynamespace.org/myresults"); + method2.setWrTargetNamespace("http://beehive.apache.org//myresults"); om.addMethod(method2); Jsr181MethodMetadata method3 = new Jsr181MethodMetadataImpl("thirdMethod", String.class); @@ -110,17 +110,17 @@ Jsr181ParameterMetadata param3_1 = new Jsr181ParameterMetadataImpl(); param3_1.setJavaType(String.class); param3_1.setWpName("myStringParam1"); - param3_1.setWpTargetNamespace("http://www.mynamespace.org/myparameters"); + param3_1.setWpTargetNamespace("http://beehive.apache.org//myparameters"); param3_1.setWpMode(WebParam.Mode.INOUT); method3.addParam(param3_1); Jsr181ParameterMetadata param3_2 = new Jsr181ParameterMetadataImpl(); param3_2.setJavaType(String.class); param3_2.setWpName("myStringParam2"); - param3_2.setWpTargetNamespace("http://www.mynamespace.org/myparameters"); + param3_2.setWpTargetNamespace("http://beehive.apache.org//myparameters"); param3_2.setWpMode(WebParam.Mode.IN); method3.addParam(param3_2); method3.setWrName("method3Result"); - method3.setWrTargetNamespace("http://www.mynamespace.org/myresults"); + method3.setWrTargetNamespace("http://beehive.apache.org//myresults"); om.addMethod(method3); Modified: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/AxisHook.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/AxisHook.java?view=diff&rev=123026&p1=incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/AxisHook.java&r1=123025&p2=incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/AxisHook.java&r2=123026 ============================================================================== --- incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/AxisHook.java (original) +++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/AxisHook.java Tue Dec 21 17:22:09 2004 @@ -114,7 +114,7 @@ new QName(meth.getWrTargetNamespace(), meth.getWrName()) ); final Class returnType = meth.getJavaReturnType(); - od.setReturnType(configureTypeMapping(sd, returnType)); + od.setReturnType(configureTypeMapping(sd, returnType, meth.getWrTargetNamespace())); od.setReturnClass(returnType); } List<Class> paramClasses = new ArrayList<Class>(); @@ -123,7 +123,8 @@ ParameterDesc pd = new ParameterDesc(); final Class paramType = param.getJavaType(); paramClasses.add(paramType); - final QName dummy = configureTypeMapping(sd, paramType); + + final QName dummy = configureTypeMapping(sd, paramType, param.getWpTargetNamespace()); // set QName pd.setQName( @@ -171,7 +172,7 @@ { FaultDesc fd = new FaultDesc(); fd.setClassName(thrown.getName()); - QName qname = configureTypeMapping(sd, thrown); + QName qname = configureTypeMapping(sd, thrown, meth.getWrTargetNamespace()); fd.setXmlType(qname); fd.setQName(qname); fd.setComplex(true); @@ -223,7 +224,7 @@ return null; } - private static QName configureTypeMapping(ServiceDesc desc, Class type) + private static QName configureTypeMapping(ServiceDesc desc, Class type, String defaultNameSpace) throws InvalidTypeMappingException { if (Void.TYPE.equals(type)) @@ -253,7 +254,9 @@ { if (null == q) { - q = generateQName(type, desc); + // q = generateQName(type, desc); + q = new QName(defaultNameSpace, + Types.getLocalNameFromFullName(type.getName())); } if (type.isArray()) { @@ -266,7 +269,7 @@ new ArrayDeserializerFactory() ); } - configureTypeMapping(desc, type.getComponentType()); + configureTypeMapping(desc, type.getComponentType(), defaultNameSpace); } else if (! tm.isRegistered(type, q)) { @@ -348,7 +351,7 @@ && (supa != java.rmi.RemoteException.class) && (supa != org.apache.axis.AxisFault.class)) { - configureTypeMapping(desc, supa); + configureTypeMapping(desc, supa, defaultNameSpace); } superTd = TypeDesc.getTypeDescForClass(supa); if (superTd != null) @@ -384,7 +387,7 @@ || subType.getName().startsWith("java.") || subType.getName().startsWith("javax."))) { - configureTypeMapping(desc, subType); + configureTypeMapping(desc, subType, defaultNameSpace); } if (td != null) { String ns = q.getNamespaceURI(); Added: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/AxisTypeGenerator.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/AxisTypeGenerator.java?view=auto&rev=123026 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/AxisTypeGenerator.java Tue Dec 21 17:22:09 2004 @@ -0,0 +1,76 @@ +/* + * AxisTypeGenerator.java + * + * Copyright 2001-2004 The Apache Software Foundation. + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + * Original author: Jonathan Colwell + */ +package org.apache.beehive.wsm.axis.ant; + +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Message; +import javax.wsdl.PortType; +import javax.wsdl.Service; + +import org.apache.axis.wsdl.gen.Generator; +import org.apache.axis.wsdl.gen.NoopGenerator; +import org.apache.axis.wsdl.symbolTable.SymbolTable; +import org.apache.axis.wsdl.toJava.Emitter; +import org.apache.axis.wsdl.toJava.JavaGeneratorFactory; + +/******************************************************************************* + * + * + * @author Jonathan Colwell + */ +public class AxisTypeGenerator extends JavaGeneratorFactory { + + public AxisTypeGenerator() { + super(); + Emitter e = new Emitter(); + setEmitter(e); + emitter.setFactory(this); + } + + public void generateTypes(String wsdl, String outputDir) throws Exception { + + emitter.setOutputDir(outputDir); + emitter.run(wsdl); + } + + public Generator getGenerator(Message message, SymbolTable symbolTable) { + return new NoopGenerator(); + } + + public Generator getGenerator(PortType portType, SymbolTable symbolTable) { + return new NoopGenerator(); + } + + public Generator getGenerator(Binding binding, SymbolTable symbolTable) { + return new NoopGenerator(); + } + + public Generator getGenerator(Service service, SymbolTable symbolTable) { + return new NoopGenerator(); + } + + public Generator getGenerator(Definition definition, + SymbolTable symbolTable) { + return new NoopGenerator(); + } +} Added: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/AxisTypeGeneratorTask.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/AxisTypeGeneratorTask.java?view=auto&rev=123026 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/AxisTypeGeneratorTask.java Tue Dec 21 17:22:09 2004 @@ -0,0 +1,88 @@ +/* + * AxisTypeGeneratorTask.java + * + * Copyright 2001-2004 The Apache Software Foundation. + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + * Original author: Jonathan Colwell + */ +package org.apache.beehive.wsm.axis.ant; + +import java.io.File; + +import org.apache.tools.ant.AntClassLoader; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.apache.tools.ant.types.FileSet; +import org.apache.tools.ant.types.Path; +import org.apache.tools.ant.types.Reference; + +/******************************************************************************* + * + * + * @author Jonathan Colwell + */ +public class AxisTypeGeneratorTask extends Task { + + File mWSDL, mOutDir; + boolean generateJWS=false; + + /** + * @return Returns the generateJWS. + */ + public boolean isGenerateJWS() { + return generateJWS; + } + /** + * @param generateJWS The generateJWS to set. + */ + public void setGenerateJWS(boolean generateJWS) { + this.generateJWS = generateJWS; + } + public void setWSDLDir(File wsdl) { + mWSDL = wsdl; + } + + public void setOutputDir(File outputDir) { + mOutDir = outputDir; + } + + public void execute() throws BuildException { + try { + AntClassLoader acl = (AntClassLoader)getClass().getClassLoader(); + //System.out.println(acl.getClasspath()); + if (mOutDir != null && mWSDL != null && mWSDL.isDirectory()) { + AxisTypeGenerator atg = new AxisTypeGenerator(); + for (File f : mWSDL.listFiles(new WSDLFilter())) { + atg.generateTypes(f.getPath(), + mOutDir.getPath()); + } + } + else { + throw new BuildException("Both a valid wsdl directory and an output directory must be provided."); + } + } + catch (Throwable e) { + e.printStackTrace(); + if (e instanceof BuildException) { + throw (BuildException)e; + } + else { + throw new BuildException(e.toString(), e); + } + } + } +} Added: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/WSDLFilter.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/WSDLFilter.java?view=auto&rev=123026 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/WSDLFilter.java Tue Dec 21 17:22:09 2004 @@ -0,0 +1,37 @@ +/* + * WSDLFilter.java + * + * Copyright 2001-2004 The Apache Software Foundation. + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + * Original author: Jonathan Colwell + */ +package org.apache.beehive.wsm.axis.ant; + +/******************************************************************************* + * + * + * @author Jonathan Colwell + */ +public class WSDLFilter implements java.io.FileFilter { + + + public boolean accept(java.io.File f) { + return (f.isFile() + && (f.getName().endsWith("wsdl") + || f.getName().endsWith("WSDL"))); + } +} Modified: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181ParameterMetadataImpl.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181ParameterMetadataImpl.java?view=diff&rev=123026&p1=incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181ParameterMetadataImpl.java&r1=123025&p2=incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181ParameterMetadataImpl.java&r2=123026 ============================================================================== --- incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181ParameterMetadataImpl.java (original) +++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181ParameterMetadataImpl.java Tue Dec 21 17:22:09 2004 @@ -88,7 +88,7 @@ } public String getWpTargetNamespace() { - return wpTargetNamespace; + return wpTargetNamespace; } public void setWpTargetNamespace(String wpTargetNamespace) { Modified: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181TypeMetadata.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181TypeMetadata.java?view=diff&rev=123026&p1=incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181TypeMetadata.java&r1=123025&p2=incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181TypeMetadata.java&r2=123026 ============================================================================== --- incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181TypeMetadata.java (original) +++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181TypeMetadata.java Tue Dec 21 17:22:09 2004 @@ -69,6 +69,7 @@ String getWsTargetNamespace(); void setWsTargetNamespace(String wsTargetNamespace); + public String[] getTargetNamespaceParts(); String getWsEndpointInterface(); void setWsEndpointInterface(String wsEndpointInterface); Modified: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181TypeMetadataImpl.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181TypeMetadataImpl.java?view=diff&rev=123026&p1=incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181TypeMetadataImpl.java&r1=123025&p2=incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181TypeMetadataImpl.java&r2=123026 ============================================================================== --- incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181TypeMetadataImpl.java (original) +++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/model/Jsr181TypeMetadataImpl.java Tue Dec 21 17:22:09 2004 @@ -24,6 +24,7 @@ import java.lang.reflect.Type; import java.net.URL; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -747,6 +748,18 @@ this.wsTargetNamespace = wsTargetNamespace; } + + public String[] getTargetNamespaceParts() { + // strip the "http://" from the targetnamespace + String namespace=getWsTargetNamespace().substring(7, getWsTargetNamespace().length()); + System.out.println("name space before split: " + namespace + " after split size: " + namespace.split("[\\./]").length); + String[] beforeTranspose = namespace.split("[\\./]"); + String[] res = new String[beforeTranspose.length]; + for(int i=0; i<res.length; i++) + res[i] = beforeTranspose[res.length - i - 1]; + return res; + } + /** * @return Returns the wsEndpointInterface. */ Modified: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/WSDLProcessor.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/WSDLProcessor.java?view=diff&rev=123026&p1=incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/WSDLProcessor.java&r1=123025&p2=incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/WSDLProcessor.java&r2=123026 ============================================================================== --- incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/WSDLProcessor.java (original) +++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/WSDLProcessor.java Tue Dec 21 17:22:09 2004 @@ -1,7 +1,8 @@ /* * WSDLProcessor.java * - * Copyright 2004 BEA Systems, Inc. + * Copyright 2001-2004 The Apache Software Foundation. + * * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +15,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * - * - * Original author: Jonathan Colwell */ package org.apache.beehive.wsm.jsr181.wsdl; Modified: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/Wsdl2AJava.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/Wsdl2AJava.java?view=diff&rev=123026&p1=incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/Wsdl2AJava.java&r1=123025&p2=incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/Wsdl2AJava.java&r2=123026 ============================================================================== --- incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/Wsdl2AJava.java (original) +++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/Wsdl2AJava.java Tue Dec 21 17:22:09 2004 @@ -1,7 +1,8 @@ /* - * Wsdl2AJava.java + * Wsld2AJava.java + * + * Copyright 2001-2004 The Apache Software Foundation. * - * Copyright 2004 BEA Systems, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +15,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * - * - * Original author: Daryoush Mehrtash */ package org.apache.beehive.wsm.jsr181.wsdl; Modified: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/XmlBeanWSDLProcessor.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/XmlBeanWSDLProcessor.java?view=diff&rev=123026&p1=incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/XmlBeanWSDLProcessor.java&r1=123025&p2=incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/XmlBeanWSDLProcessor.java&r2=123026 ============================================================================== --- incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/XmlBeanWSDLProcessor.java (original) +++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/XmlBeanWSDLProcessor.java Tue Dec 21 17:22:09 2004 @@ -1,7 +1,8 @@ /* * XmlBeanWSDLProcessor.java * - * Copyright 2004 BEA Systems, Inc. + * Copyright 2001-2004 The Apache Software Foundation. + * * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +15,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * - * - * Original author: Jonathan Colwell */ package org.apache.beehive.wsm.jsr181.wsdl; Modified: incubator/beehive/trunk/wsm/src/runtime/templates/wsdl2ajava.vm Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/wsm/src/runtime/templates/wsdl2ajava.vm?view=diff&rev=123026&p1=incubator/beehive/trunk/wsm/src/runtime/templates/wsdl2ajava.vm&r1=123025&p2=incubator/beehive/trunk/wsm/src/runtime/templates/wsdl2ajava.vm&r2=123026 ============================================================================== --- incubator/beehive/trunk/wsm/src/runtime/templates/wsdl2ajava.vm (original) +++ incubator/beehive/trunk/wsm/src/runtime/templates/wsdl2ajava.vm Tue Dec 21 17:22:09 2004 @@ -103,7 +103,7 @@ targetNamespace="$param.wpTargetNamespace" mode="$param.wpMode" header="$param.wpHeader" - )$param.javaType $param.wpName#if($ctr < $size), + )$param.javaType.name $param.wpName#if($ctr < $size), #end #end #end @@ -115,11 +115,21 @@ from wsdl: $webServiceOM.wsWsdlLocation */ +#set($packageName="") +#set($ctr=0) +#set($size=$webServiceOM.targetNamespaceParts.size()) +#foreach( $dirName in $webServiceOM.targetNamespaceParts) +Next Dir name: $dirName +#if($ctr != 0) #set($packageName="$packageName.")#end +#set($ctr=$ctr + 1) +#set($packageName="$packageName$dirName") +#end +package $packageName #webService($webServiceOM.wsName $webServiceOM.wsTargetNamespace $webServiceOM.wsWsdlLocation) #handlerChain($webServiceOM.hcFileName $webServiceOM.name) #soapBinding($webServiceOM.soapBinding) #soapMsgHandlers($webServiceOM.soapHandlers) -public class $webServiceOM.getWsName()Impl { +public class $webServiceOM.wsName { #foreach( $method in $webServiceOM.methods) /********************************************** @@ -133,7 +143,7 @@ ***********************************************/ #webMethod($method) #results($method) - public $method.javaReturnType $method.javaMethodName (#if($method.params.size() == 0)) + public $method.javaReturnType.name $method.javaMethodName (#if($method.params.size() == 0)) throws java.rmi.RemoteException {#end #if($method.params.size() > 0)
