ws-soap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sanj...@apache.org
Subject cvs commit: xml-soap/java/src/org/apache/soap/rpc RPCMessage.java
Date Mon, 28 Oct 2002 16:50:53 GMT
sanjiva     2002/10/28 08:50:53

  Modified:    java/src/org/apache/soap/encoding SOAPMappingRegistry.java
               java/src/org/apache/soap/encoding/soapenc
                        BeanSerializer.java SoapEncUtils.java
               java/src/org/apache/soap/rpc RPCMessage.java
  Log:
  changed write(s1+s2+..+sn) to
          write (s1)
          write (s2)
          ...
          write (sn)
  
  Revision  Changes    Path
  1.32      +4 -1      xml-soap/java/src/org/apache/soap/encoding/SOAPMappingRegistry.java
  
  Index: SOAPMappingRegistry.java
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/encoding/SOAPMappingRegistry.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- SOAPMappingRegistry.java	9 Sep 2002 21:15:27 -0000	1.31
  +++ SOAPMappingRegistry.java	28 Oct 2002 16:50:53 -0000	1.32
  @@ -302,7 +302,10 @@
                                                xjmr,
                                                ctx);
   
  -        sink.write(src + "</" + context + '>');
  +        sink.write(src.toString ());
  +        sink.write("</");
  +        sink.write(context.toString ());
  +        sink.write(">");
         }
         nsStack.popScope();
       }
  
  
  
  1.9       +17 -8     xml-soap/java/src/org/apache/soap/encoding/soapenc/BeanSerializer.java
  
  Index: BeanSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/encoding/soapenc/BeanSerializer.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- BeanSerializer.java	30 Aug 2002 21:39:00 -0000	1.8
  +++ BeanSerializer.java	28 Oct 2002 16:50:53 -0000	1.9
  @@ -77,6 +77,8 @@
    */
   public class BeanSerializer implements Serializer, Deserializer
   {
  +  private static HashMap beanInfoCache = new HashMap ();
  +
     public void marshall(String inScopeEncStyle, Class javaType, Object src,
                          Object context, Writer sink, NSStack nsStack,
                          XMLJavaMappingRegistry xjmr, SOAPContext ctx)
  @@ -138,7 +140,9 @@
         }
       }
   
  -    sink.write("</" + context + '>');
  +    sink.write("</");
  +    sink.write(context.toString ());
  +    sink.write(">");
   
       nsStack.popScope();
     }
  @@ -192,17 +196,22 @@
       return new Bean(javaType, bean);
     }
   
  -  private PropertyDescriptor[] getPropertyDescriptors(Class javaType)
  +  private static PropertyDescriptor[] getPropertyDescriptors(Class javaType)
       throws IllegalArgumentException
     {
       BeanInfo beanInfo = null;
   
  -    try
  -    {
  -      beanInfo = Introspector.getBeanInfo(javaType);
  -    }
  -    catch (IntrospectionException e)
  -    {
  +    beanInfo = (BeanInfo) beanInfoCache.get (javaType);
  +    if (beanInfo == null) {
  +      try
  +        {
  +          beanInfo = Introspector.getBeanInfo(javaType);
  +          beanInfoCache.put (javaType, beanInfo);
  +        }
  +      catch (IntrospectionException e)
  +        {
  +          // caught below via beanInfo == null
  +        }
       }
   
       if (beanInfo != null)
  
  
  
  1.17      +42 -14    xml-soap/java/src/org/apache/soap/encoding/soapenc/SoapEncUtils.java
  
  Index: SoapEncUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/encoding/soapenc/SoapEncUtils.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- SoapEncUtils.java	30 Aug 2002 21:39:00 -0000	1.16
  +++ SoapEncUtils.java	28 Oct 2002 16:50:53 -0000	1.17
  @@ -164,11 +164,19 @@
         }
       }
   
  -    sink.write('<' + context.toString() + namespaceDecl);
  +    sink.write("<");
  +    sink.write(context.toString());
  +    sink.write(namespaceDecl);
   
       // Write the id for a multiRef element
  -    if (context instanceof MultiRefContext)
  -      sink.write(' ' + Constants.ATTR_ID + "=\"" + Constants.ATTRVAL_MULTIREF_ID_PREFIX
+ ((MultiRefContext) context).getId() + "\"");
  +    if (context instanceof MultiRefContext) {
  +      sink.write(" ");
  +      sink.write(Constants.ATTR_ID);
  +      sink.write("=\"");
  +      sink.write(Constants.ATTRVAL_MULTIREF_ID_PREFIX);
  +      sink.write(((MultiRefContext) context).getId() + "");
  +      sink.write( "\"");
  +    }
   
       // Get prefixes for the needed namespaces.
       String elementTypeNS = elementType.getNamespaceURI();
  @@ -184,9 +192,15 @@
       String elementTypeNSPrefix = nsStack.getPrefixFromURI(elementTypeNS, sink);
   
       if (ctx == null || !ctx.getDocLitSerialization()) {
  -      sink.write(' ' + xsiNSPrefix + ':' + Constants.ATTR_TYPE + "=\"" +
  -                 elementTypeNSPrefix + ':' +
  -                 elementType.getLocalPart() + '\"');
  +      sink.write(" ");
  +      sink.write(xsiNSPrefix);
  +      sink.write(":");
  +      sink.write(Constants.ATTR_TYPE);
  +      sink.write("=\"");
  +      sink.write(elementTypeNSPrefix);
  +      sink.write(":");
  +      sink.write(elementType.getLocalPart());
  +      sink.write("\"");
       }
   
       if (inScopeEncStyle == null
  @@ -197,9 +211,13 @@
         String soapEnvNSPrefix = nsStack.getPrefixFromURI(
           Constants.NS_URI_SOAP_ENV, sink);
   
  -      sink.write(' ' + soapEnvNSPrefix + ':' +
  -                 Constants.ATTR_ENCODING_STYLE + "=\"" +
  -                 Constants.NS_URI_SOAP_ENC + '\"');
  +      sink.write(" ");
  +      sink.write(soapEnvNSPrefix);
  +      sink.write(":");
  +      sink.write(Constants.ATTR_ENCODING_STYLE);
  +      sink.write("=\"");
  +      sink.write(Constants.NS_URI_SOAP_ENC);
  +      sink.write("\"");
       }
   
       if (arrayElementType != null)
  @@ -212,17 +230,27 @@
         String soapEncNSPrefix = nsStack.getPrefixFromURI(
           Constants.NS_URI_SOAP_ENC, sink);
   
  -      sink.write(' ' + soapEncNSPrefix + ':' +
  -                 Constants.ATTR_ARRAY_TYPE + "=\"" + arrayTypeValue + '\"');
  +      sink.write(" ");
  +      sink.write(soapEncNSPrefix);
  +      sink.write(":");
  +      sink.write(Constants.ATTR_ARRAY_TYPE);
  +      sink.write("=\"");
  +      sink.write(arrayTypeValue);
  +      sink.write("\"");
       }
   
       if (isNull)
       {
  -      sink.write(' ' + xsiNSPrefix + ':' + nilName(xsiNamespaceURI) + "=\"" +
  -                 Constants.ATTRVAL_TRUE + "\"/");
  +      sink.write(" ");
  +      sink.write(xsiNSPrefix);
  +      sink.write(":");
  +      sink.write(nilName(xsiNamespaceURI));
  +      sink.write("=\"");
  +      sink.write(Constants.ATTRVAL_TRUE);
  +      sink.write("\"/");
       }
   
  -    sink.write('>');
  +    sink.write(">");
     }
   
     public static void generateNullStructure(String inScopeEncStyle,
  
  
  
  1.19      +62 -24    xml-soap/java/src/org/apache/soap/rpc/RPCMessage.java
  
  Index: RPCMessage.java
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/rpc/RPCMessage.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- RPCMessage.java	2 Oct 2002 14:05:52 -0000	1.18
  +++ RPCMessage.java	28 Oct 2002 16:50:53 -0000	1.19
  @@ -237,11 +237,20 @@
           String targetObjectNSPrefix = nsStack.getPrefixFromURI(
             targetObjectURI, nsDeclSW);
   
  -        sink.write('<' + 
  -                   (!ctx.getDocLitSerialization() ? targetObjectNSPrefix + ':' : "") +
  -                   methodName + suffix +
  -                   (!ctx.getDocLitSerialization() ? nsDeclSW.toString() : " xmlns=\"" +
targetObjectURI + "\"")
  -                   );
  +        sink.write("<");
  +        if (!ctx.getDocLitSerialization ()) {
  +          sink.write(targetObjectNSPrefix);
  +          sink.write(":");
  +        }
  +        sink.write(methodName);
  +        sink.write(suffix);
  +        if (!ctx.getDocLitSerialization ()) {
  +          sink.write(nsDeclSW.toString ());
  +        } else {
  +          sink.write(" xmlns=\"");
  +          sink.write(targetObjectURI);
  +          sink.write("\"");
  +        }
   
           // Determine the prefix associated with the NS_URI_SOAP_ENV
           // namespace URI.
  @@ -251,12 +260,17 @@
           if (declMsgEncStyle != null
               && (!declMsgEncStyle.equals(inScopeEncStyle))
               && (!ctx.getDocLitSerialization())) {
  -          sink.write(' ' + soapEnvNSPrefix + ':' +
  -                     Constants.ATTR_ENCODING_STYLE + "=\"" +
  -                     declMsgEncStyle + '\"');
  +          sink.write(" ");
  +          sink.write(soapEnvNSPrefix);
  +          sink.write(":");
  +          sink.write(Constants.ATTR_ENCODING_STYLE);
  +          sink.write("=\"");
  +          sink.write(declMsgEncStyle);
  +          sink.write("\"");
           }
   
  -        sink.write('>' + StringUtils.lineSeparator);
  +        sink.write(">");
  +        sink.write(StringUtils.lineSeparator);
   
           // Get the returnValue.
           Parameter ret = resp.getReturnValue();
  @@ -277,9 +291,14 @@
   
           serializeParams(params, actualMsgEncStyle, sink, nsStack, xjmr, ctx);
   
  -        sink.write("</" + 
  -                   (!ctx.getDocLitSerialization() ? targetObjectNSPrefix + ':' : "") +
  -                   methodName + suffix + '>');
  +        sink.write("</");
  +        if (!ctx.getDocLitSerialization ()) {
  +          sink.write(targetObjectNSPrefix);
  +          sink.write(":");
  +        }
  +        sink.write(methodName);
  +        sink.write(suffix);
  +        sink.write(">");
         } else {
           // Get the fault information.
           Fault fault = resp.getFault();
  @@ -292,11 +311,20 @@
         String targetObjectNSPrefix = nsStack.getPrefixFromURI(targetObjectURI,
                                                                nsDeclSW);
   
  -      sink.write('<' +
  -                 (!ctx.getDocLitSerialization() ? targetObjectNSPrefix + ':' : "") +
  -                 methodName + suffix +
  -                 (!ctx.getDocLitSerialization() ? nsDeclSW.toString() : " xmlns=\"" + targetObjectURI
+ "\"")
  -                 );
  +      sink.write("<");
  +      if (!ctx.getDocLitSerialization ()) {
  +        sink.write(targetObjectNSPrefix);
  +        sink.write(":");
  +      }
  +      sink.write(methodName);
  +      sink.write(suffix);
  +      if (!ctx.getDocLitSerialization ()) {
  +        sink.write(nsDeclSW.toString ());
  +      } else {
  +        sink.write(" xmlns=\"");
  +        sink.write(targetObjectURI);
  +        sink.write("\"");
  +      }
   
         // Determine the prefix associated with the NS_URI_SOAP_ENV
         // namespace URI.
  @@ -306,18 +334,28 @@
         if (declMsgEncStyle != null
             && (!declMsgEncStyle.equals(inScopeEncStyle))
             && (!ctx.getDocLitSerialization())) {
  -        sink.write(' ' + soapEnvNSPrefix + ':' +
  -                   Constants.ATTR_ENCODING_STYLE + "=\"" +
  -                   declMsgEncStyle + '\"');
  +        sink.write(" ");
  +        sink.write(soapEnvNSPrefix);
  +        sink.write(":");
  +        sink.write(Constants.ATTR_ENCODING_STYLE);
  +        sink.write("=\"");
  +        sink.write(declMsgEncStyle);
  +        sink.write("\"");
         }
   
  -      sink.write('>' + StringUtils.lineSeparator);
  +      sink.write(">");
  +      sink.write(StringUtils.lineSeparator);
   
         serializeParams(params, actualMsgEncStyle, sink, nsStack, xjmr, ctx);
   
  -      sink.write("</" +
  -                 (!ctx.getDocLitSerialization() ? targetObjectNSPrefix + ':' : "") +
  -                 methodName + suffix + '>');
  +      sink.write("</");
  +      if (!ctx.getDocLitSerialization()) {
  +        sink.write(targetObjectNSPrefix);
  +        sink.write(":");
  +      }
  +      sink.write(methodName);
  +      sink.write(suffix);
  +      sink.write(">");
       }
   
       nsStack.popScope();
  
  
  

Mime
View raw message