View Javadoc

1   /*
2    * $Id: MethodFixInterceptor.java 7963 2007-08-21 08:53:15Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.providers.soap;
12  
13  import org.mule.config.MuleProperties;
14  import org.mule.interceptors.EnvelopeInterceptor;
15  import org.mule.umo.Invocation;
16  import org.mule.umo.UMOException;
17  
18  /**
19   * This Interceptor decorates the current message with a property that tells the
20   * DynamicEntryPointResolver to ignore the 'method' property. The reason being is
21   * that for the SOAP endpoints have an additional hop - http --->
22   * AxisServiceComponent ---> WebService the 'method' param is targetted for the
23   * WebService not the AxisServiceComponent, so we need to ignore it
24   */
25  public class MethodFixInterceptor extends EnvelopeInterceptor
26  {
27  
28      public void before(Invocation invocation) throws UMOException
29      {
30          invocation.getMessage().setBooleanProperty(MuleProperties.MULE_IGNORE_METHOD_PROPERTY, true);
31      }
32  
33      public void after(Invocation invocation) throws UMOException
34      {
35          if (invocation.getMessage() != null)
36          {
37              invocation.getMessage().removeProperty(MuleProperties.MULE_IGNORE_METHOD_PROPERTY);
38          }
39      }
40  }