On Sun, May 5, 2013 at 8:32 PM, Deepal jayasinghe <[email protected]> wrote:

> Good point, if that is the cases then it violates the whole point of
> deferred building. Because we prefer to build the full message only at
> the MessageReceiver.
>
> At which point does this get called ?
>

Soon after builder build the document. and before AxisEngine.receive(...)
 get called.

>
> Deepal
> > Normally (if the incoming message is a SOAP message), at the time this
> > method is called, only the SOAPEnvelope object has been instantiated
> > by Axiom. Calling SOAPEnvelope#getBody() will force Axiom to build the
> > entire SOAP header. I'm not sure it is desirable to do that at this
> > early stage. Probably it is better to do that check in the message
> > receivers (i.e. where the NullPointerException described in AXIS2-4221
> > occurs).
>

Ok, we have this disadvantage then, Implementation done base on we don't
need to
process invalid SOAP envelop. we have to choose which is the post
important. If the
existing features get affected by this changes, I too think bring this to
MessageReceiver.
would be a good solution.

Regards,
Shameera.



> >
> > On Sun, May 5, 2013 at 4:33 PM,  <[email protected]> wrote:
> >> Author: shameera
> >> Date: Sun May  5 14:33:41 2013
> >> New Revision: 1479332
> >>
> >> URL: http://svn.apache.org/r1479332
> >> Log:
> >> Fixed AXIS2-4221, check for soap body after build soap envelop
> >>
> >> Modified:
> >>
> axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
> >>
> >> Modified:
> axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
> >> URL:
> http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java?rev=1479332&r1=1479331&r2=1479332&view=diff
> >>
> ==============================================================================
> >> ---
> axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
> (original)
> >> +++
> axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
> Sun May  5 14:33:41 2013
> >> @@ -169,7 +169,7 @@ public class TransportUtils {
> >>          return createSOAPEnvelope(documentElement);
> >>      }
> >>
> >> -    public static SOAPEnvelope createSOAPEnvelope(OMElement
> documentElement) {
> >> +    public static SOAPEnvelope createSOAPEnvelope(OMElement
> documentElement) throws AxisFault {
> >>          SOAPEnvelope envelope;
> >>          // Check whether we have received a SOAPEnvelope or not
> >>          if (documentElement instanceof SOAPEnvelope) {
> >> @@ -183,6 +183,10 @@ public class TransportUtils {
> >>                  envelope.getBody().addChild(documentElement);
> >>              }
> >>          }
> >> +        //According to both SOAP 1.1 and 1.2 specification SOAP body
> is mandatory element for a valid soap envelop
> >> +        if (envelope.getBody() == null) {
> >> +            throw new AxisFault("soap body element is null, but it is
> mandatory for a valid soap envelop");
> >> +        }
> >>          return envelope;
> >>      }
> >>
> >>
> >>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>


-- 
Best Regards,
Shameera Rathnayaka.

email: shameera AT apache.org , shameerainfo AT gmail.com
Blog : http://shameerarathnayaka.blogspot.com/

Reply via email to