axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From muthu...@apache.org
Subject cvs commit: ws-axis/contrib/axismora/src/org/apache/axismora/wsdl2ws/doclit DocLitWrapWriter.java DocLitStubWriter.java AllDocLitParamWriter.java DocLitBeanWriter.java DocLitWebServiceGenarator.java DocLitServiceWriter.java
Date Fri, 02 Jan 2004 08:31:40 GMT
muthulee    2004/01/02 00:31:40

  Modified:    contrib/axismora/src/org/apache/axismora/wsdl2ws/doclit
                        DocLitWrapWriter.java DocLitStubWriter.java
                        AllDocLitParamWriter.java DocLitBeanWriter.java
                        DocLitWebServiceGenarator.java
                        DocLitServiceWriter.java
  Log:
  doc\literal revision
  PR:
  Obtained from:
  Submitted by:	
  Reviewed by:	
  CVS: ----------------------------------------------------------------------
  CVS: PR:
  CVS:   If this change addresses a PR in the problem report tracking
  CVS:   database, then enter the PR number(s) here.
  CVS: Obtained from:
  CVS:   If this change has been taken from another system, such as NCSA,
  CVS:   then name the system in this line, otherwise delete it.
  CVS: Submitted by:
  CVS:   If this code has been contributed to Apache by someone else; i.e.,
  CVS:   they sent us a patch or a new module, then include their name/email
  CVS:   address here. If this is your work then delete this line.
  CVS: Reviewed by:
  CVS:   If we are doing pre-commit code reviews and someone else has
  CVS:   reviewed your changes, include their name(s) here.
  CVS:   If you have not had it reviewed then delete this line.
  
  Revision  Changes    Path
  1.5       +38 -35    ws-axis/contrib/axismora/src/org/apache/axismora/wsdl2ws/doclit/DocLitWrapWriter.java
  
  Index: DocLitWrapWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/axismora/src/org/apache/axismora/wsdl2ws/doclit/DocLitWrapWriter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DocLitWrapWriter.java	15 Dec 2003 11:15:19 -0000	1.4
  +++ DocLitWrapWriter.java	2 Jan 2004 08:31:40 -0000	1.5
  @@ -5,23 +5,25 @@
   import java.io.IOException;
   import java.util.ArrayList;
   import java.util.Collection;
  -import java.util.Iterator;
   
  -import org.apache.axis.AxisFault;
  +import javax.xml.namespace.QName;
  +
  +
  +
   import org.apache.axismora.Constants;
  -import org.apache.axismora.MessageContext;
  -import org.apache.axismora.encoding.AxisPullParser;
  +
  +
   import org.apache.axismora.wsdl2ws.WrapperFault;
   import org.apache.axismora.wsdl2ws.WrapperUtils;
   import org.apache.axismora.wsdl2ws.info.MethodInfo;
   import org.apache.axismora.wsdl2ws.info.ParameterInfo;
  -import org.apache.axismora.wsdl2ws.info.Type;
  -import org.apache.axismora.wsdl2ws.info.TypeMap;
  +
  +
   import org.apache.axismora.wsdl2ws.info.WebServiceContext;
   import org.apache.axismora.wsdl2ws.java.JavaClassWriter;
   import org.apache.axismora.wsdl2ws.java.JavaUtils;
  -import org.apache.axismora.wsdl2ws.java.WrapWriter;
  -import org.xmlpull.v1.XmlPullParser;
  +
  +
   
   
   /**
  @@ -81,9 +83,12 @@
   
   protected void writeImportStatements() throws WrapperFault {
   		try {
  -			writer.write(
  -				"import org.apache.axis.AxisFault;\nimport org.apache.axis.message.SOAPFault;\n");
  +			writer.write("import org.apache.axis.AxisFault;\nimport org.apache.axis.message.SOAPFault;\n");
   			writer.write("import org.xmlpull.v1.XmlPullParser;\n");
  +			writer.write("import javax.xml.namespace.QName;\n");
  +			writer.write("import org.apache.axismora.encoding.AxisPullParser;\n");
  +			writer.write("import org.apache.axismora.provider.result.DocLiteralSerializer;\n");
  +			writer.write("import org.apache.axis.enum.Use;\n");
   		} catch (IOException e) {
   			throw new WrapperFault(e);
   		}
  @@ -111,13 +116,13 @@
   	//write service wrapping methods
   	for (int i = 0; i < methods.size(); i++) {
   		minfo = (MethodInfo) methods.get(i);
  -			this.writeMethodInWrapper(
  -				minfo.getMethodname(),
  -				minfo.getParameterTypes(),
  -				minfo.getReturnType());
  +		System.out.println("Details of the method "+ minfo.getMethodname()+" collection "+minfo.getParameterTypes().size()+"
 returnType "+minfo.getReturnType());
  +
  +			this.writeMethodInWrapper(minfo.getMethodname(), minfo.getParameterTypes(), minfo.getReturnType());
   			writer.write("\n");
   		}
  -	} catch (IOException e) {
  +		
  +		} catch (IOException e) {
   		throw new WrapperFault(e);
   	}
   }
  @@ -136,7 +141,7 @@
   		  writer.write("\t\t try{\n");
   		  writer.write(
   			  "\t\t\tString methodToCall = msgdata.getMethodName().getLocalPart();\n");
  -		  writer.write("\t\t\tmsgdata.setLitereal(true);\n");
  +		  writer.write("\t\t\tmsgdata.setUse(Use.LITERAL);\n");
   		  //if no methods in the service simply return
   		  if (methods.size() == 0) {
   			  writer.write("\t}\n");
  @@ -200,48 +205,46 @@
   
   	
   	ArrayList paramsB = new ArrayList(params);
  -	//Iterator p = params.iterator();
   
  +	   if(paramsB.get(0)!=null){ 	
   	ParameterInfo pinfo=(ParameterInfo) paramsB.get(0);
  -
  +   
  +   if(pinfo.getElementName()==null)
  +	   throw new WrapperFault("Document Literal service accept only elements\n");
  +   
   // Writing validation code for start tag.
  -	writer.write("\t\t//This is a docLit service.\n Therefore cursor of the pull parser is
at body tag\n");
  -	writer.write("\t\tAxisPullParser aXpp = msgdata.getAxisPullParser();\n");
  +	writer.write("\t\t//This is a docLit service. Therefore cursor of the pull parser is at
body tag\n");
  +	writer.write("\t\tAxisPullParser aXpp = msgdata.getAxisParser();\n");
   	writer.write("\t//The current state is the body tag. We move one step ahead using aXpp.next()\n");
   	writer.write("\t\tint state=aXpp.next();\n");
   	writer.write("\t\tif(state == XmlPullParser.START_TAG){\n");
   	writer.write("\t\t//Validate the local name of the parameter\n");
  -	writer.write("\t\t\taXpp.getName().equals(\"Get the elementName of pinfo.get(0)\");\n");
  +	writer.write("\t\t\taXpp.getName().equals(\""+ pinfo.getElementName().getLocalPart() +"\");\n");
   	writer.write("\t\t}else{\n");
   	writer.write("\t\t\tthrow new AxisFault(\"Empty Soap Body, or text node in the soap body.\");\n}\n");
  -	writer.write("\t// Validation of start tag is done.");
  +	writer.write("\t// Validation of start tag is done.\n");
   
   
   // Create the parameter class for the first parameter. 
   // Other parameters are ignored
  -	System.out.println(paramsB.size());
  +
  +   
   	writer.write(
   			JavaUtils.getSimpleTypeParameterCreationCode(
   				pinfo,
   				wscontext,
   				1));
   	
  +   }
   	if (!(outparam == null || outparam.equals("void"))) {
  -		boolean isSimpleType = TypeMap.isSimpleType(outparam);
  -		boolean isArray = false;
  -		Type type;
  -		if ((type = this.wscontext.getTypemap().getType(returntype.getSchemaName()))
  -			!= null)
  -			isArray = type.isArray();
  -			
  -		// TODO :: Dimuthu ::: a big todo. This is ugly. Check for enums as well. Or invert checking
is better if not element ignore.
  -		if (isSimpleType || isArray) {
  +		QName eleQname = returntype.getElementName();
  +		if (eleQname==null) {
   			 throw new WrapperFault("Return type has to be a element declaration");
   		} else {
   			writer.write("org.apache.axismora.encoding.OutParameter outParam = service." + methodName
+ "(paramIn1);\n");
  -			writer.write("msgData.setSoapBodyContents(new DocLitSerializer(outParam,qame));\n");
  -			writer.write("paramIn1");
  -			writer.write("));\n");
  +			writer.write("QName qname = new QName(\""+eleQname.getNamespaceURI()+ "\", \"" + eleQname.getLocalPart()+"\");\n");

  +			writer.write("msgdata.setSoapBodyContent(new DocLiteralSerializer(outParam,qname));\n");
  +		     
   		}
   		
   	} else { // well .. web service is returning void.
  
  
  
  1.2       +35 -60    ws-axis/contrib/axismora/src/org/apache/axismora/wsdl2ws/doclit/DocLitStubWriter.java
  
  Index: DocLitStubWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/axismora/src/org/apache/axismora/wsdl2ws/doclit/DocLitStubWriter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DocLitStubWriter.java	19 Dec 2003 03:32:06 -0000	1.1
  +++ DocLitStubWriter.java	2 Jan 2004 08:31:40 -0000	1.2
  @@ -1,6 +1,6 @@
   package org.apache.axismora.wsdl2ws.doclit;
   
  -import java.io.File;
  +
   import java.io.IOException;
   import java.util.ArrayList;
   import java.util.Iterator;
  @@ -39,19 +39,7 @@
   		this.methods = wscontext.getSerInfo().getMethods();
   	}
   
  -	/* (non-Javadoc)
  -	 * @see org.apache.axismora.wsdl2ws.java.JavaClassWriter#writeAttributes()
  -	 */
  -	protected void writeAttributes() throws WrapperFault {
  -          super.writeAttributes();
  -	}
  -
  -	/* (non-Javadoc)
  -	 * @see org.apache.axismora.wsdl2ws.java.JavaClassWriter#writeConstructors()
  -	 */
  -	protected void writeConstructors() throws WrapperFault {
  -          super.writeConstructors();
  -	}
  +	
   
   	/* (non-Javadoc)
   	 * @see org.apache.axismora.wsdl2ws.java.JavaClassWriter#writeMethods()
  @@ -63,24 +51,22 @@
   		Object obj;
   		try {
   			for (int i = 0; i < methods.size(); i++) {
  -                minfo = (MethodInfo) this.methods.get(i);
  +				minfo = (MethodInfo) this.methods.get(i);
                   
  -                this.writeMethodSignature(minfo);
  +				this.writeMethodSignature(minfo);
                   
  -                // below code writes the method body.
  -                writer.write(
  +				// below code writes the method body.
  +				writer.write(
   					"\n\t\tjavax.xml.namespace.QName methodName = new javax.xml.namespace.QName(\""
   						+ minfo.getMethodname()
   						+ "\");");
   				String ops = "";
  -				writer.write(
  -					"\n\t\torg.apache.axismora.client.Call call = (org.apache.axismora.client.Call)service.createCall();");
  -				writer.write("\n\t\tcall.setOperationName(methodName);");
  -				writer.write("\n\t\tcall.setPortTypeName(SOAPAction);");
  +				writer.write("\n\t\torg.apache.axismora.client.Call call = (org.apache.axismora.client.Call)service.createCall();");
   				writer.write("\n\t\tcall.setTargetEndpointAddress(this.enduri);");
  -				writer.write("\n\t\tcall.setStyle(\"document\");");
  -				writer.write("\n\t\tcall.setUse(org.apache.axis.enum.Use.LITERAL)");
  -				
  +				writer.write("\n\t\tcall.setStyle(Style.DOCUMENT);");
  +				writer.write("\n\t\tcall.setUse(Use.LITERAL);");
  +				writer.write("\n\t\tcall.setPortTypeName(new javax.xml.namespace.QName(\""+wscontext.getSerInfo().getServicename()+"\",\""+minfo.getMethodname()+"\"));");
  +			    
   				// add paramters to the call object .........
   				Iterator params = minfo.getParameterTypes().iterator();
   				if (params.hasNext()) {
  @@ -91,12 +77,12 @@
   					paramQName = ((ParameterInfo) obj).getSchemaName();
   				
   					if ((TypeMap.isSimpleType(paramQName)) || (paramType != null && paramType.isArray())
) {
  -                	    throw new WrapperFault("Simple types and array types are not accepted
by document literal services.");
  -                	}else {
  +						throw new WrapperFault("Simple types and array types are not accepted by document
literal services.");
  +					}else {
   						paramQName = ((ParameterInfo) obj).getSchemaName();
   						writer.write(
   							"\n\t\tcall.addParameter(\"param0\",new javax.xml.namespace.QName(\""
  -								+ paramQName.getNamespaceURI()
  +								+ ops
   								+ "\",\""
   								+ paramQName.getLocalPart()
   								+ "\"),javax.xml.rpc.ParameterMode.IN);"); 
  @@ -127,15 +113,15 @@
   				
   					if ( (TypeMap.isSimpleType(paramQName)) ||(paramType != null && paramType.isArray()))
{
   						throw new WrapperFault("Simple types and array types are not accepted by document
literal services.");
  -    				} else {
  +					} else {
   						// Writing validation code for start tag.
  -							writer.write("\t\t//This is a docLit service.\n Therefore cursor of the pull parser
is at body tag\n");
  -							writer.write("\t\tAxisPullParser aXpp = msgdata.getAxisPullParser();\n");
  +							writer.write("\t\t//This is a docLit service.\n\t\t//Therefore cursor of the pull
parser is at body tag\n");
  +							writer.write("\t\tAxisPullParser aXpp = mx.getAxisParser();\n");
   							writer.write("\t//The current state is the body tag. We move one step ahead using
aXpp.next()\n");
   							writer.write("\t\tint state=aXpp.next();\n");
   							writer.write("\t\tif(state == XmlPullParser.START_TAG){\n");
   							writer.write("\t\t//Validate the local name of the parameter\n");
  -							writer.write("\t\t\taXpp.getName().equals(\"Get the elementName of pinfo.get(0)\");\n");
  +							writer.write("\t\t\taXpp.getName().equals(\""+returnType.getElementName().getLocalPart()+"\");\n");
   							writer.write("\t\t}else{\n");
   							writer.write("\t\t\tthrow new AxisFault(\"Empty Soap Body, or text node in the soap
body.\");\n}\n");
   							writer.write("\t// Validation of start tag is done.");
  @@ -168,21 +154,18 @@
   	}
   
   
  -    private void writeMethodSignature(MethodInfo minfo) throws WrapperFault, IOException{
  +	private void writeMethodSignature(MethodInfo minfo) throws WrapperFault, IOException{
   		writer.write("\n\tpublic ");
   		ParameterInfo returnType = minfo.getReturnType();
  -						if (returnType == null
  -							|| returnType.getLangName() == null
  -							|| returnType.getLangName() == "void")
  -							writer.write("void ");
  -						else
  -							writer.write(
  -								WrapperUtils.getClassNameFromParamInfoConsideringArrays(
  +		if (returnType == null || returnType.getLangName() == null || returnType.getLangName()
== "void")
  +			writer.write("void");
  +		else
  +		 writer.write(WrapperUtils.getClassNameFromParamInfoConsideringArrays(
   									minfo.getReturnType(),
   									wscontext));
   		
   		// writing the method Name
  -		writer.write(minfo.getMethodname() + "(");
  +		writer.write(" "+minfo.getMethodname() + "(");
   
   		//write parameter - only one parameter is writen. 
   		Iterator params = minfo.getParameterTypes().iterator();
  @@ -197,27 +180,19 @@
   				
   		writer.write(")throws java.rmi.RemoteException{");								
   									
  -    }
  -
  -	/* (non-Javadoc)
  -	 * @see org.apache.axismora.wsdl2ws.java.JavaClassWriter#getJavaFilePath()
  -	 */
  -	protected File getJavaFilePath() throws WrapperFault {
  -	       return super.getJavaFilePath();
  -	}
  -	/* (non-Javadoc)
  -	* @see org.apache.axismora.wsdl2ws.java.JavaClassWriter#getExtendsPart()
  -	*/
  -	protected String getExtendsPart() {
  -		return super.getExtendsPart();
   	}
   
  -	/* (non-Javadoc)
  -	 * @see org.apache.axismora.wsdl2ws.java.JavaClassWriter#getimplementsPart()
  -	 */
  -	protected String getimplementsPart() {
  -		return "implements " + wscontext.getSerInfo().getQualifiedServiceName();
  -	}
  +  protected void writeImportStatements() throws WrapperFault{
  +	try {
  +				writer.write("import org.apache.axis.AxisFault;\n");
  +				writer.write("import org.xmlpull.v1.XmlPullParser;\n");
  +				writer.write("import org.apache.axismora.encoding.AxisPullParser;\n");
  +				writer.write("import org.apache.axis.enum.Style;\n");
  +				writer.write("import org.apache.axis.enum.Use;\n");
  +			} catch (IOException e) {
  +				throw new WrapperFault(e);
  +			}
  +  }
   
   	/* (non-Javadoc)
   	 * @see org.apache.axismora.wsdl2ws.java.JavaClassWriter#writeClassComment()
  
  
  
  1.2       +2 -1      ws-axis/contrib/axismora/src/org/apache/axismora/wsdl2ws/doclit/AllDocLitParamWriter.java
  
  Index: AllDocLitParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/axismora/src/org/apache/axismora/wsdl2ws/doclit/AllDocLitParamWriter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AllDocLitParamWriter.java	15 Dec 2003 11:17:59 -0000	1.1
  +++ AllDocLitParamWriter.java	2 Jan 2004 08:31:40 -0000	1.2
  @@ -3,6 +3,7 @@
   
   import java.util.Iterator;
   
  +import org.apache.axismora.wsdl2ws.SourceWriter;
   import org.apache.axismora.wsdl2ws.WrapperConstants;
   import org.apache.axismora.wsdl2ws.WrapperFault;
   import org.apache.axismora.wsdl2ws.info.Type;
  @@ -31,7 +32,7 @@
    * @author Dimuthu Leelaratne. muthulee@yahoo.com
    *
    */
  -public class AllDocLitParamWriter {
  +public class AllDocLitParamWriter implements SourceWriter {
   /*	TODO :: Check for R2201 compliance.
    *  NO support for arrays of enums ?????
    *  Arrays can exist only inside beans ..... and how is the problem
  
  
  
  1.3       +35 -72    ws-axis/contrib/axismora/src/org/apache/axismora/wsdl2ws/doclit/DocLitBeanWriter.java
  
  Index: DocLitBeanWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/axismora/src/org/apache/axismora/wsdl2ws/doclit/DocLitBeanWriter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DocLitBeanWriter.java	19 Dec 2003 03:31:37 -0000	1.2
  +++ DocLitBeanWriter.java	2 Jan 2004 08:31:40 -0000	1.3
  @@ -6,7 +6,7 @@
   import java.util.Enumeration;
   
   import javax.xml.namespace.QName;
  -
  +import org.apache.axismora.encoding.AxisPullParser;
   import org.apache.axismora.wsdl2ws.java.JavaClassWriter;
   import org.apache.axismora.wsdl2ws.java.JavaUtils;
   import org.apache.axismora.wsdl2ws.WrapperConstants;
  @@ -31,11 +31,8 @@
       Type type; // type of this param
       String[][] attribs;
   
  -    public DocLitBeanWriter(WebServiceContext wscontext, Type type)
  -        throws WrapperFault {
  -        super(
  -            WrapperUtils.getPackegeName4QualifiedName(
  -                type.getLanguageSpecificName()),
  +  	public DocLitBeanWriter(WebServiceContext wscontext, Type type) throws WrapperFault
{
  +		super(WrapperUtils.getPackegeName4QualifiedName(type.getLanguageSpecificName()),
               WrapperUtils.getClassNameFromFullyQualifiedName(
                   type.getLanguageSpecificName()));
           this.wscontext = wscontext;
  @@ -44,8 +41,7 @@
               throw new WrapperFault("I am doclit in, out param writer. I do not write arrays");
   
           this.attribs =
  -            this.getAttribList(
  -                wscontext.getSerInfo().getQualifiedServiceName());
  +				 this.getAttribList(wscontext.getSerInfo().getQualifiedServiceName());
       }
   
       /**
  @@ -62,15 +58,16 @@
               }
   
               writer.write("\t\tint count = " + this.attribs.length + ";\n");
  +				      writer.write("\t\tAxisPullParser aXpp = msgdata.getAxisParser();\n");
  +					  
               writer.write("\t\tint state=aXpp.next();\n");
  -            writer.write("\t\t{\n");
               writer.write(
                   "\t\t//if the type of the next tag is end tag that means the content of
element is null\n");
               writer.write("if(state == XmlPullParser.END_TAG){\n");
               writer.write("\t\t\t return null;\n");
               writer.write("\t\t}else if(state == XmlPullParser.START_TAG){\n");
               writer.write(
  -                "\t\t}else{\nthrow new Exception(\" Invalid things inside element tag.
Text data is in the element straight away\");}\n");
  +						  "\t\t}else{\nthrow new AxisFault(\" Invalid things inside element tag. Text data
is in the element straight away\");}\n");
   
               //start looping
               writer.write("\t\tfor(int i = 0;i<count;i++) {\n");
  @@ -213,18 +210,6 @@
                   return;
               }
   
  -            writer.write(
  -                "\t\tString m_URI =\""
  -                    + type.getName().getNamespaceURI()
  -                    + "\";\n");
  -            writer.write(
  -                "\t\tString type_name = \""
  -                    + type.getName().getLocalPart()
  -                    + "\";\n");
  -
  -            writer.write(
  -                "\t\t\torg.apache.axismora.wsdl2ws.java.ParmWriter.tagWritten = false;\n");
  -
               writer.write("\t\t//write the parameters\n\n");
               for (int i = 0; i < attribs.length; i++) {
                   /**
  @@ -238,9 +223,7 @@
                   if (TypeMap.isSimpleType(attribs[i][1])) {
                       //for simple type
                       writer.write(
  -                        "\t\tcontext.writeString(\"<"
  -                            + attribs[i][0]
  -                            + ">\");\n");
  +							"\t\tcontext.writeString(\"<" + attribs[i][0] + ">\");\n");
                       writer.write(
                           check4null
                               ? "\t\tif(this." + attribs[i][0] + "!=null){\n"
  @@ -287,23 +270,18 @@
                   } else {
                       //for complex type 
                       writer.write(
  -                        "\t\tcontext.writeString(\"<"
  -                            + attribs[i][0]
  -                            + ">\");\n");
  +							"\t\tcontext.writeString(\"<" + attribs[i][0] + ">\");\n");
                       writer.write(
                           check4null
                               ? "\t\tif(this." + attribs[i][0] + "!=null){\n"
                               : "");
                       writer.write(
                           "\t\t\torg.apache.axismora.wsdl2ws.java.ParmWriter.tagWritten =
true;\n");
  -                    writer.write(
  -                        "\t\t\t" + attribs[i][0] + ".serialize(context);\n");
  +						writer.write("\t\t\t" + attribs[i][0] + ".serialize(context);\n");
                   }
                   writer.write(check4null ? "\t\t}\n" : "");
                   writer.write(
  -                    "\t\tcontext.writeString(\"</"
  -                        + attribs[i][0]
  -                        + ">\\n\");\n\n");
  +						"\t\tcontext.writeString(\"</" + attribs[i][0] + ">\\n\");\n\n");
               }
   
           } catch (IOException e) {
  @@ -318,11 +296,10 @@
   
       protected void writeClassComment() throws WrapperFault {
           try {
  -            writer.write(
  -                "/**\n * <p>This class is genarated by the tool WSDL2Ws.\n"
  -                    + " * It take care of the serialization and the desirialization of\n"
  -                    + " * the in and out parameters of document literal web service.\n"
  -                    + " */ \n");
  +			  writer.write("/**\n * <p>This class is genarated by the tool WSDL2Ws.\n" +
  +				  " * It take care of the serialization and the desirialization of\n" +
  +				  " * the in and out parameters of document literal web service.\n" +
  +				  " */ \n");
           } catch (IOException e) {
               e.printStackTrace();
               throw new WrapperFault(e);
  @@ -331,11 +308,10 @@
   
       protected void writeImportStatements() throws WrapperFault {
           try {
  +					writer.write("import org.apache.axis.AxisFault;\n");
               writer.write("import org.xmlpull.v1.XmlPullParser;\n");
  -            writer.write(
  -                "import org.apache.axismora.encoding.AxisPullParser;\n");
  +					writer.write("import org.apache.axismora.encoding.AxisPullParser;\n");
           } catch (IOException e) {
  -            e.printStackTrace();
               throw new WrapperFault(e);
           }
       }
  @@ -388,8 +364,6 @@
               writer.write(
                   "\tpublic org.apache.axismora.encoding.InParameter desierialize(org.apache.axismora.MessageContext
msgdata)throws org.apache.axis.AxisFault{\n");
               this.writeDesireializeCode();
  -            writer.write("\t\treturn this;\n");
  -            writer.write("\n\t}\n");
           } catch (IOException e) {
               e.printStackTrace();
               throw new WrapperFault(e);
  @@ -417,10 +391,10 @@
           new File(
               wscontext.getWrapInfo().getTargetOutputLocation()
                   + "/"
  -                + WrapperUtils
  -                    .getPackegeName4QualifiedName(
  -                        type.getLanguageSpecificName())
  -                    .replace('.', '/'))
  +				  + WrapperUtils.getPackegeName4QualifiedName(
  +					  type.getLanguageSpecificName()).replace(
  +					  '.',
  +					  '/'))
               .mkdirs();
           String fileName =
               wscontext.getWrapInfo().getTargetOutputLocation()
  @@ -469,12 +443,10 @@
               attribs[i][6] = null;
           }
   
  -        for (int i = attribfeilds.size();
  -            i < attribfeilds.size() + elementfeilds.size();
  -            i++) {
  +        
  +		  for (int i = attribfeilds.size(); i < attribfeilds.size()+elementfeilds.size();
i++) {
               attribs[i] = new String[7];
  -            attribs[i][0] =
  -                ((String) elementfeilds.get(i - attribfeilds.size()));
  +			  attribs[i][0] = ((String) elementfeilds.get(i - attribfeilds.size()));
   
               ElementInfo element = type.getElementForElementName(attribs[i][0]);
               Type t = element.getType();
  @@ -497,16 +469,9 @@
   
               if (element.getMaxOccurs() > 1) {
                   attribs[i][1] = attribs[i][1] + "[]";
  -                Type typedata =
  -                    new Type(
  -                        new QName(
  -                            name.getNamespaceURI(),
  -                            name.getLocalPart() + "Array"),
  -                        null,
  -                        false,
  -                        WrapperConstants.LANGUAGE_JAVA);
  -                typedata.setTypeNameForElementName(
  -                    new ElementInfo(new QName("item"), t));
  +				  Type typedata = new Type(new QName(name.getNamespaceURI(),name.getLocalPart()+"Array")
  +					  ,null,false,WrapperConstants.LANGUAGE_JAVA);
  +				  typedata.setTypeNameForElementName(new ElementInfo(new QName("item"),t));
                   typedata.setArray(true);
                   attribs[i][4] = TypeMap.regestorArrayTypeToCreate(typedata);
                   attribs[i][5] = t.getName().getNamespaceURI();
  @@ -550,18 +515,17 @@
                           type.getLanguageSpecificName())
                       + "(");
               if (attribs.length > 0) {
  -                writer.write(attribs[0][1] + " " + attribs[0][0]);
  +				  writer.write(attribs[0][1]
  +						  + " "
  +						  + attribs[0][0]);
                   for (int i = 1; i < this.attribs.length; i++)
  -                    writer.write(attribs[i][1] + " " + attribs[i][0]);
  +					  writer.write(", "+attribs[i][1]
  +							  + " "
  +							  + attribs[i][0]);
               }
               writer.write("){\n");
               for (int i = 0; i < this.attribs.length; i++)
  -                writer.write(
  -                    "\t\tthis."
  -                        + attribs[i][0]
  -                        + " = "
  -                        + attribs[i][0]
  -                        + ";\n");
  +				  writer.write("\t\tthis." + attribs[i][0] + " = " + attribs[i][0] + ";\n");
               writer.write("\t}\n");
           } catch (IOException e) {
               throw new WrapperFault(e);
  @@ -576,8 +540,7 @@
               writer.write("this." + attribs[i][0] + " =");
   
               if (name.endsWith("[]")) {
  -                writer.write(
  -                    !"byte[]".equals(name) ? (" new " + name + "{") : "");
  +				  writer.write(!"byte[]".equals(name) ? (" new " + name + "{") : "");
                   temp = attribs[i][1];
                   attribs[i][1] = name.substring(0, name.length() - 2);
               }
  
  
  
  1.3       +15 -8     ws-axis/contrib/axismora/src/org/apache/axismora/wsdl2ws/doclit/DocLitWebServiceGenarator.java
  
  Index: DocLitWebServiceGenarator.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/axismora/src/org/apache/axismora/wsdl2ws/doclit/DocLitWebServiceGenarator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DocLitWebServiceGenarator.java	21 Nov 2003 05:45:19 -0000	1.2
  +++ DocLitWebServiceGenarator.java	2 Jan 2004 08:31:40 -0000	1.3
  @@ -76,10 +76,12 @@
   	 * @see org.apache.axismora.wsdl2ws.WebServiceGenarator#genarate()
   	 */
   	public void genarate() throws WrapperFault {
  +	
   		String language = wscontext.getWrapInfo().getWrapperLanguage();
  -
  -		if (WrapperConstants.LANGUAGE_JAVA.equalsIgnoreCase(language)) {
  -			(new Genarator(WrapperConstants.GENERATOR_PARAM_JAVA, wscontext))
  +		System.out.println(language);
  +		if(WrapperConstants.LANGUAGE_JAVA.equalsIgnoreCase(language)){
  +	   // if(WrapperConstants.SERVER_CLIENT.equals(wscontext.getWrapInfo().getTargetEngine())){
  +			(new Genarator(WrapperConstants.GENERATOR_DOCLIT_PARAM_JAVA, wscontext))
   				.genarate();
   			(new Genarator(WrapperConstants.GENERATOR_DOCLIT_WRAPPER_JAVA,
   				wscontext))
  @@ -87,9 +89,14 @@
   			(new Genarator(WrapperConstants.GENERATOR_DOCLIT_SERVICE_JAVA,
   				wscontext))
   				.genarate();
  -
  -		} else {
  -			throw new WrapperFault("Unsupported Language" + language);
  -		}
  +			(new Genarator(WrapperConstants.GENERATOR_DOCLIT_STUB_JAVA,
  +							wscontext))
  +							.genarate();
  +			(new Genarator(WrapperConstants.GENERATOR_STUB_LOCATOR_JAVA, wscontext)).genarate();
  +			(new Genarator(WrapperConstants.GENERATOR_STUB_SERVICE_INTERFACE_JAVA, wscontext)).genarate();

   	}
  -}
  +
  +} // generate
  +
  +
  +}
  \ No newline at end of file
  
  
  
  1.5       +6 -14     ws-axis/contrib/axismora/src/org/apache/axismora/wsdl2ws/doclit/DocLitServiceWriter.java
  
  Index: DocLitServiceWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/axismora/src/org/apache/axismora/wsdl2ws/doclit/DocLitServiceWriter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DocLitServiceWriter.java	12 Dec 2003 08:00:02 -0000	1.4
  +++ DocLitServiceWriter.java	2 Jan 2004 08:31:40 -0000	1.5
  @@ -80,8 +80,7 @@
   	private ArrayList methods;
   	private WebServiceContext wscontext;
   
  -	public DocLitServiceWriter(WebServiceContext wscontext)
  -		throws WrapperFault {
  +	public DocLitServiceWriter(WebServiceContext wscontext) throws WrapperFault {
   		super(
   			WrapperUtils.getPackegeName4QualifiedName(
   				wscontext.getSerInfo().getQualifiedServiceName()),
  @@ -121,8 +120,7 @@
   					writer.write("void ");
   				else
   					writer.write(
  -						WrapperUtils
  -							.getClassNameFromParamInfoConsideringArrays(
  +						WrapperUtils.getClassNameFromParamInfoConsideringArrays(
   							minfo.getReturnType(),
   							wscontext)
   							+ " ");
  @@ -132,8 +130,7 @@
   				Iterator params = minfo.getParameterTypes().iterator();
   				if (params.hasNext())
   					writer.write(
  -						WrapperUtils
  -							.getClassNameFromParamInfoConsideringArrays(
  +						WrapperUtils.getClassNameFromParamInfoConsideringArrays(
   							(ParameterInfo) params.next(),
   							wscontext)
   							+ " param"
  @@ -142,8 +139,7 @@
   				for (int j = 1; params.hasNext(); j++) {
   					writer.write(
   						","
  -							+ WrapperUtils
  -								.getClassNameFromParamInfoConsideringArrays(
  +							+ WrapperUtils.getClassNameFromParamInfoConsideringArrays(
   								(ParameterInfo) params.next(),
   								wscontext)
   							+ " param"
  @@ -163,9 +159,7 @@
   			this.wscontext.getWrapInfo().getTargetOutputLocation();
   		if (targetOutputLocation.endsWith("/"))
   			targetOutputLocation =
  -				targetOutputLocation.substring(
  -					0,
  -					targetOutputLocation.length() - 1);
  +				targetOutputLocation.substring(0, targetOutputLocation.length() - 1);
   		new File(
   			targetOutputLocation
   				+ "/"
  @@ -177,9 +171,7 @@
   		String fileName =
   			targetOutputLocation
   				+ "/"
  -				+ this.wscontext.getSerInfo().getQualifiedServiceName().replace(
  -					'.',
  -					'/')
  +				+ this.wscontext.getSerInfo().getQualifiedServiceName().replace('.', '/')
   				+ "Impl.java";
   		return new File(fileName);
   	}
  
  
  

Mime
View raw message