From axis-cvs-return-16800-apmail-ws-axis-cvs-archive=ws.apache.org@ws.apache.org Wed Aug 02 18:35:43 2006 Return-Path: Delivered-To: apmail-ws-axis-cvs-archive@www.apache.org Received: (qmail 17195 invoked from network); 2 Aug 2006 18:35:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Aug 2006 18:35:41 -0000 Received: (qmail 65678 invoked by uid 500); 2 Aug 2006 18:35:40 -0000 Delivered-To: apmail-ws-axis-cvs-archive@ws.apache.org Received: (qmail 65580 invoked by uid 500); 2 Aug 2006 18:35:40 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 65569 invoked by uid 500); 2 Aug 2006 18:35:40 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 65566 invoked by uid 99); 2 Aug 2006 18:35:40 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Aug 2006 11:35:40 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Aug 2006 11:35:38 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 5ED691A9820; Wed, 2 Aug 2006 11:35:18 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r428084 - in /webservices/axis2/trunk/java/modules: addressing/src/META-INF/ addressing/src/org/apache/axis2/handlers/addressing/ core/src/org/apache/axis2/description/ core/src/org/apache/axis2/engine/ integration/test/org/apache/axis2/add... Date: Wed, 02 Aug 2006 18:35:17 -0000 To: axis2-cvs@ws.apache.org From: davidillsley@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060802183518.5ED691A9820@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: davidillsley Date: Wed Aug 2 11:35:16 2006 New Revision: 428084 URL: http://svn.apache.org/viewvc?rev=428084&view=rev Log: Moving UsingAddressing check to Addressing module. More preparation for AXIS2-948 Added: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingWSDLValidationHandler.java Modified: webservices/axis2/trunk/java/modules/addressing/src/META-INF/module.xml webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/addressing/AddressingServiceTest.java Modified: webservices/axis2/trunk/java/modules/addressing/src/META-INF/module.xml URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/META-INF/module.xml?rev=428084&r1=428083&r2=428084&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/addressing/src/META-INF/module.xml (original) +++ webservices/axis2/trunk/java/modules/addressing/src/META-INF/module.xml Wed Aug 2 11:35:16 2006 @@ -7,6 +7,9 @@ + + + @@ -28,6 +31,9 @@ + + + Added: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingWSDLValidationHandler.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingWSDLValidationHandler.java?rev=428084&view=auto ============================================================================== --- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingWSDLValidationHandler.java (added) +++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingWSDLValidationHandler.java Wed Aug 2 11:35:16 2006 @@ -0,0 +1,59 @@ +/* +* Copyright 2004,2005 The Apache Software Foundation. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package org.apache.axis2.handlers.addressing; + +import org.apache.axis2.AxisFault; +import org.apache.axis2.addressing.AddressingConstants; +import org.apache.axis2.addressing.AddressingHelper.FinalFaults; +import org.apache.axis2.context.MessageContext; +import org.apache.axis2.handlers.AbstractHandler; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +public class AddressingWSDLValidationHandler extends AbstractHandler implements AddressingConstants { + + private static final Log log = LogFactory.getLog(AddressingWSDLValidationHandler.class); + + public void invoke(MessageContext msgContext) throws AxisFault { + // Check that if wsaddressing=required that addressing headers were found inbound + checkUsingAddressing(msgContext); + // Check that if anonymous flag is in effect that the replyto and faultto are valid + // Not yet implemented + // If no AxisOperation has been found at the end of the dispatch phase and addressing + // is in use we should throw and ActionNotSupported Fault + // Not yet implemented + } + + /* + * Check that if the wsaddressing="required" attribute exists on the service + * definition or was found in the + * WSDL that WS-Addressing headers were found on the inbound message + */ + private void checkUsingAddressing(MessageContext msgContext) + throws AxisFault { + String addressingFlag = msgContext.getAxisService().getWSAddressingFlag(); + if (log.isTraceEnabled()) + log.trace("checkUsingAddressing: WSAddressingFlag=" + addressingFlag); + if (AddressingConstants.ADDRESSING_REQUIRED.equals(addressingFlag)) { + Object flag = msgContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION); + if (log.isTraceEnabled()) + log.trace("checkUsingAddressing: WS_ADDRESSING_VERSION=" + flag); + if (flag == null) { + FinalFaults.triggerMessageAddressingRequiredFault(msgContext,AddressingConstants.WSA_ACTION); + } + } + } +} Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java?rev=428084&r1=428083&r2=428084&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java (original) +++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java Wed Aug 2 11:35:16 2006 @@ -274,6 +274,10 @@ AxisEngine engine = new AxisEngine(cc); mc.getConfigurationContext().registerOperationContext(mc.getMessageID(), oc); engine.send(mc); + + // Options object reused so soapAction needs to be removed so + // that soapAction+wsa:Action on response don't conflict + options.setAction(""); } else { if (block) { // Send the SOAP Message and receive a response @@ -354,6 +358,10 @@ responseMessageContext.setTransportIn(msgctx.getTransportIn()); responseMessageContext.setTransportOut(msgctx.getTransportOut()); + // Options object reused above so soapAction needs to be removed so + // that soapAction+wsa:Action on response don't conflict + responseMessageContext.setSoapAction(""); + if (responseMessageContext.getEnvelope() == null) { // If request is REST we assume the responseMessageContext is REST, so // set the variable Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java?rev=428084&r1=428083&r2=428084&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java (original) +++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java Wed Aug 2 11:35:16 2006 @@ -17,6 +17,14 @@ package org.apache.axis2.engine; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Map; + +import javax.xml.namespace.QName; + import org.apache.axiom.om.OMAbstractFactory; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMNamespace; @@ -35,9 +43,9 @@ import org.apache.axis2.AxisFault; import org.apache.axis2.Constants; import org.apache.axis2.addressing.AddressingConstants; -import org.apache.axis2.addressing.AddressingConstants.Final; import org.apache.axis2.addressing.EndpointReference; import org.apache.axis2.addressing.RelatesTo; +import org.apache.axis2.addressing.AddressingConstants.Final; import org.apache.axis2.context.ConfigurationContext; import org.apache.axis2.context.MessageContext; import org.apache.axis2.context.OperationContext; @@ -51,14 +59,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import javax.xml.namespace.QName; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Map; - /** * There is one engine for the Server and the Client. the send() and receive() * Methods are the basic operations the Sync, Async messageing are build on top. @@ -135,30 +135,6 @@ } } - /* - * Check that if the wsaddressing="required" attribute exists on the service - * definition or was found in the - * WSDL that WS-Addressing headers were found on the inbound message - */ - private void checkUsingAddressing(MessageContext msgContext) - throws AxisFault { - String addressingFlag = msgContext.getAxisService().getWSAddressingFlag(); - if (log.isTraceEnabled()) - log.trace("checkUsingAddressing: WSAddressingFlag=" + addressingFlag); - if (AddressingConstants.ADDRESSING_REQUIRED.equals(addressingFlag)) { - Object flag = msgContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION); - if (log.isTraceEnabled()) - log.trace("checkUsingAddressing: WS_ADDRESSING_VERSION=" + flag); - if (flag == null) { - String message = Messages.getMessage("wsaddressingrequirednotpresent"); - AxisFault af = new AxisFault(message); - af.printStackTrace(); - log.debug(message, af); - throw af; - } - } - } - /** * This method is called to handle any error that occurs at inflow or outflow. But if the * method is called twice, it implies that sending the error handling has failed, in which case @@ -511,8 +487,6 @@ // invoke the Message Receivers checkMustUnderstand(msgContext); - checkUsingAddressing(msgContext); - MessageReceiver receiver = msgContext.getAxisOperation().getMessageReceiver(); receiver.receive(msgContext); @@ -606,8 +580,6 @@ // invoke the Message Receivers checkMustUnderstand(msgContext); - - checkUsingAddressing(msgContext); MessageReceiver receiver = msgContext.getAxisOperation().getMessageReceiver(); Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/addressing/AddressingServiceTest.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/addressing/AddressingServiceTest.java?rev=428084&r1=428083&r2=428084&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/addressing/AddressingServiceTest.java (original) +++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/addressing/AddressingServiceTest.java Wed Aug 2 11:35:16 2006 @@ -229,7 +229,7 @@ fail("Should have received a specific fault"); }catch(AxisFault af){ af.printStackTrace(); - assertEquals("WS-Addressing required but not found.", af.getMessage()); + assertEquals(Final.FAULT_ADDRESSING_HEADER_REQUIRED_REASON, af.getMessage()); } }finally { if (sender != null) --------------------------------------------------------------------- To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org For additional commands, e-mail: axis-cvs-help@ws.apache.org