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 ?

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).
>
> On Sun, May 5, 2013 at 4:33 PM,  <shame...@apache.org> 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: java-dev-unsubscr...@axis.apache.org
> For additional commands, e-mail: java-dev-h...@axis.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@axis.apache.org
For additional commands, e-mail: java-dev-h...@axis.apache.org

Reply via email to