axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Illsley" <davidills...@gmail.com>
Subject Re: svn commit: r496028 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: context/MessageContext.java engine/AxisEngine.java transport/TransportUtils.java
Date Sat, 20 Jan 2007 18:45:44 GMT
Hi Chamikara,
I'm not sure about the null check you added to AxisEngine. It means
that if the MessageReceiver is null, the client simply gets a 202 back
rather than an indication anything went wrong. (I ran into it this
week.) I'd prefer an explicit exception explaining the problem rather
than silent failure or an NPE. Do you have any objections to that?

David

On 14/01/07, chamikara@apache.org <chamikara@apache.org> wrote:
> Author: chamikara
> Date: Sat Jan 13 19:49:46 2007
> New Revision: 496028
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=496028
> Log:
> A couple of null checks.
> Modified the 'TransportUtils.createSOAPMessage' method to make it usable, even when the
OperationContext is null.
>
> Modified:
>     webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
>     webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
>     webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
>
> Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
> URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java?view=diff&rev=496028&r1=496027&r2=496028
> ==============================================================================
> --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
(original)
> +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
Sat Jan 13 19:49:46 2007
> @@ -1343,7 +1343,7 @@
>          this.setParent(operationContext);
>
>          if (operationContext != null) {
> -            if ((serviceContext != null) && (operationContext.getParent() ==
null)) {
> +            if ((operationContext!=null) && (serviceContext != null) &&
(operationContext.getParent() == null)) {
>                  operationContext.setParent(serviceContext);
>              }
>
>
> Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
> URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java?view=diff&rev=496028&r1=496027&r2=496028
> ==============================================================================
> --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
(original)
> +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
Sat Jan 13 19:49:46 2007
> @@ -171,8 +171,8 @@
>                checkMustUnderstand(msgContext);
>
>                MessageReceiver receiver = msgContext.getAxisOperation().getMessageReceiver();
> -
> -              receiver.receive(msgContext);
> +              if (receiver!=null)
> +                 receiver.receive(msgContext);
>              }
>              flowComplete(msgContext, true);
>            }
>
> Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
> URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java?view=diff&rev=496028&r1=496027&r2=496028
> ==============================================================================
> --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
(original)
> +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
Sat Jan 13 19:49:46 2007
> @@ -66,15 +66,9 @@
>                         }
>                         Object contentType;
>                         boolean isMIME = false;
> -                       OperationContext opContext = msgContext.getOperationContext();
>
> -                       if (opContext != null) {
> -                               contentType = opContext
> -                                               .getProperty(HTTPConstants.MTOM_RECEIVED_CONTENT_TYPE);
> -                       } else {
> -                               throw new AxisFault(Messages
> -                                               .getMessage("cannotBeNullOperationContext"));
> -                       }
> +                       contentType = msgContext.getProperty(HTTPConstants.MTOM_RECEIVED_CONTENT_TYPE);
> +
>                         //TODO: we can improve this logic
>                         if (contentType!=null){
>                                 isMIME=true;
> @@ -83,7 +77,7 @@
>                         String charSetEnc = (String) msgContext
>                                         .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);
>                         if (charSetEnc == null) {
> -                               charSetEnc = (String) opContext
> +                               charSetEnc = (String) msgContext
>                                                 .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);
>                         }
>                         if (charSetEnc == null) {
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-cvs-help@ws.apache.org
>
>


-- 
David Illsley - IBM Web Services Development

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message