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 MessageContext.java
Date Fri, 02 Jan 2004 08:34:12 GMT
muthulee    2004/01/02 00:34:12

  Modified:    contrib/axismora/src/org/apache/axismora/soap
                        BasicMessageContext.java
               contrib/axismora/src .classpath
               contrib/axismora/src/org/apache/axismora MessageContext.java
  Added:       contrib/axismora/src/org/apache/axismora/provider/result
                        DocLiteralSerializer.java
  Removed:     contrib/axismora/src/org/apache/axismora/provider/result
                        DocLiteralResult.java
  Log:
  doc\literal 
  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       +25 -30    ws-axis/contrib/axismora/src/org/apache/axismora/soap/BasicMessageContext.java
  
  Index: BasicMessageContext.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/axismora/src/org/apache/axismora/soap/BasicMessageContext.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BasicMessageContext.java	15 Dec 2003 11:17:59 -0000	1.4
  +++ BasicMessageContext.java	2 Jan 2004 08:34:12 -0000	1.5
  @@ -79,7 +79,7 @@
   import org.apache.axismora.encoding.DesirializationContext;
   import org.apache.axismora.encoding.OutParameter;
   import org.apache.axismora.encoding.Serializable;
  -import org.apache.axismora.provider.result.DocLiteralResult;
  +import org.apache.axismora.provider.result.DocLiteralSerializer;
   import org.apache.axismora.provider.result.HandlerResetResult;
   import org.apache.axismora.provider.result.MSGResult;
   import org.apache.axismora.provider.result.RPCResult;
  @@ -92,6 +92,7 @@
   import org.apache.axis.encoding.SerializationContext;
   import org.apache.axis.encoding.SerializationContextImpl;
   import org.apache.axis.enum.Style;
  +import org.apache.axis.enum.Use;
   import org.apache.axis.message.SOAPBody;
   import org.apache.axis.message.SOAPBodyElement;
   import org.apache.axis.message.SOAPEnvelope;
  @@ -177,7 +178,7 @@
       //indicate at server side or the client side
       private boolean atServerSide;
       //indicate to use literal or encoded
  -    private boolean isLiteral=false;
  +    private Use use = Use.ENCODED;
   	/**
   	 * this Constructor is for the sake of testing only
   	 */
  @@ -202,7 +203,7 @@
           this.soapHeaderElements = new Vector(ELEMENT_MAP_SIZE);
           this.createdSoapHeaders = new Vector(ELEMENT_MAP_SIZE);
           this.streamEncoding = streamEncoding;
  -        this.methodName = service.getQName();
  +       // this.methodName = service.getQName();
           this.style = service.getStyle();
           //initialize desirialization context - this drives the desiarialization
           this.deserializer =
  @@ -241,8 +242,7 @@
           this.service = service;
           this.outStream = requestContext.getSender().getOut();
           this.streamEncoding = requestContext.getEncoding();
  -        this.style = requestContext.getStyle();//service.getStyle();
  -        //initialize desirialization context - this drives the desiarialization
  +       
           this.deserializer =
               new DesirializationContext(
                   this,
  @@ -257,7 +257,10 @@
             serializzation of these naturally followed the existing model.
           */
           serializer = new SerializationContextImpl(w);
  -
  +        
  +        this.style=requestContext.getStyle();
  +        this.use = requestContext.getUse();
  +        
           log.info("MessageContext created.......");
   
       }
  @@ -308,33 +311,24 @@
   
       public boolean setSoapBodyContent(Object result) throws AxisFault {
          if (result instanceof OutParameter){
  -           		this.resultValue = new RPCResult((OutParameter) result, this.methodName);

  +           	this.resultValue = new RPCResult((OutParameter) result, this.methodName);	
           }else if (result instanceof Element[])
               this.resultValue = new MSGResult((Element[]) result);
  +        else if( result instanceof DocLiteralSerializer)
  +            this.resultValue = (DocLiteralSerializer)result;
           else if (result instanceof InputParameterInfo[])
  -            this.resultValue =
  -                new RequestBodyContent((InputParameterInfo[]) result, this.methodName);
  +            this.resultValue = new RequestBodyContent((InputParameterInfo[]) result, this.methodName);
           else
               throw new AxisFault("unknown result type set to message Context");
           return true;
       }
   
  -    /**
  -     * This method takes care of serializing of body according to the style.
  -     * Style specific serialization is handled in the java classes in the package
  -     * provider.serializers.
  -     * 
  -     * @param styleProvider Manages serialization of the body acording to the style.
  -     * @throws AxisFault
  -     */ 
  -	public void setSoapBodyContents(Serializable styleProvider) throws AxisFault{
  -			this.resultValue = styleProvider; 
  -    }
  -    
  +   
       public QName getMethodName() {
           return this.methodName;
       }
  -
  +    
  +     
       public void setMethodName(QName mName) {
           this.methodName = mName;
       }
  @@ -456,8 +450,8 @@
           this.deserializer.startParseSOAPBody();
       }
   
  -    public void setLitereal(boolean boo){
  -		isLiteral = boo;
  +    public void setUse(Use tUse){
  +		this.use = tUse;
       }
       
       
  @@ -483,7 +477,8 @@
               Iterator headers = this.soapHeaderElements.iterator();
               SOAPHeaderElement header;
               
  -            if(this.isLiteral){
  +            if(this.use.equals(Use.LITERAL)){
  +            	 log.info("I am literal delete me");
                    serializer.setDoMultiRefs(false);
                    serializer.setShouldSendXSIType(true);
               }
  @@ -514,11 +509,11 @@
   
               this.soapEnvelope.addBodyElement(bo);
   
  -            ///specific to rpc
  -            if (this.methodName != null) {
  -                bo.setName(this.methodName.getLocalPart() + "Response");
  -                bo.setNamespaceURI(this.methodName.getNamespaceURI());
  -            }
  +//  NOt needed specific to rpc
  +//            if (this.methodName != null) {
  +//                bo.setName(this.methodName.getLocalPart() + "Response");
  +//                bo.setNamespaceURI(this.methodName.getNamespaceURI());
  +//            }
   
               /*
                  ** registor our Serializer **
  
  
  
  1.2       +1 -1      ws-axis/contrib/axismora/src/.classpath
  
  Index: .classpath
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/axismora/src/.classpath,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- .classpath	15 Dec 2003 11:17:59 -0000	1.1
  +++ .classpath	2 Jan 2004 08:34:12 -0000	1.2
  @@ -33,5 +33,5 @@
       <classpathentry kind="lib" path="E:/lib/xml-apis.jar"/>
       <classpathentry kind="lib" path="E:/lib/xmlParserAPIs.jar"/>
       <classpathentry kind="lib" path="E:/lib/activation.jar"/>
  -    <classpathentry kind="output" path=""/>
  +    <classpathentry kind="output" path="bin"/>
   </classpath>
  
  
  
  1.1                  ws-axis/contrib/axismora/src/org/apache/axismora/provider/result/DocLiteralSerializer.java
  
  Index: DocLiteralSerializer.java
  ===================================================================
  package org.apache.axismora.provider.result;
  
  import java.io.IOException;
  
  import javax.xml.namespace.QName;
  
  import org.apache.axismora.encoding.OutParameter;
  import org.apache.axismora.encoding.Serializable;
  
  import org.apache.axis.encoding.SerializationContext;
  
  /**
   * Manages serialization of the body.
   * Serialization at both client and server side should be taken care of by this.
   * @author Dimuthu Leelarathne.
   *
   */
  public class DocLiteralSerializer implements Serializable {
  	private OutParameter parm;
  	private boolean clientSide=false;
  	private QName eleQName;   
  
  	   public DocLiteralSerializer(OutParameter param,QName qName) {
  		   this.parm = param;
  		   this.eleQName=qName;
  	   }
  	
  	  /**
  		* this method is called by the SOAPHeaderElement when serializing
  		*/
  	   public void serialize(SerializationContext sc) throws IOException {
             
              if(parm != null){ 		 
                 //writing start tag
              	StringBuffer buf = new StringBuffer();
  				String uri = eleQName.getNamespaceURI();
  				if (uri != null && !("".equals(uri))) {
  					buf.append("<pre:").append(this.eleQName.getLocalPart());
  					buf.append(" xmlns:pre=\"").append(uri);
  					buf.append("\">\n");
  				} else {
  					buf.append("<").append(this.eleQName.getLocalPart());
                  	buf.append(">\n");
  				}
  				sc.writeString(buf.toString());
                 	parm.serialize(sc);
                 	
                 	//writing end tag
                 	buf = new StringBuffer();
  				if (uri != null && !("".equals(uri))) {
  					buf.append("\n</pre:").append(this.eleQName.getLocalPart());
  					buf.append(">\n");
  				} else {
  					buf.append("\n</").append(this.eleQName.getLocalPart());
  					buf.append(">\n");
  				}
  			    sc.writeString(buf.toString());
  			} else System.out.println("DEBUG - The param is null");
  	   }
  
            
  }
  
  
  
  1.5       +3 -11     ws-axis/contrib/axismora/src/org/apache/axismora/MessageContext.java
  
  Index: MessageContext.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/axismora/src/org/apache/axismora/MessageContext.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MessageContext.java	15 Dec 2003 11:17:59 -0000	1.4
  +++ MessageContext.java	2 Jan 2004 08:34:12 -0000	1.5
  @@ -69,6 +69,7 @@
   import org.apache.axis.AxisFault;
   import org.apache.axis.deployment.wsdd.WSDDService;
   import org.apache.axis.encoding.SerializationContext;
  +import org.apache.axis.enum.Use;
   import org.apache.axis.message.SOAPEnvelope;
   import org.apache.axis.message.SOAPFault;
   import org.apache.axis.message.SOAPHeaderElement;
  @@ -115,7 +116,7 @@
   	/**
   	 * Tells the serializer to use literal encoding. 
   	 */
  -	public void setLitereal(boolean boo);
  +	public void setUse(Use t);
       
       public int getVersion();
       /**
  @@ -125,16 +126,7 @@
        * @return
        */
       
  -	/**
  -		* This method takes care of serializing of body according to the style.
  -		* Style specific serialization is handled in the java classes in the package
  -		* provider.serializers.
  -		* 
  -		* @param styleProvider Manages serialization of the body acording to the style.
  -		* @throws AxisFault
  -		*/ 
  -	   public void setSoapBodyContents(Serializable styleProvider) throws AxisFault;
  -	   
  +	
       public boolean setSoapBodyContent(Object result) throws AxisFault;
       /**
        * get the name of the method (wsdl operation) invoke by this requst
  
  
  

Mime
View raw message