Martin,
Okay, I will give it a try. I put the configuration in the applications service.xml and not the axis2.xml Brian From: Martin Gainty [mailto:mgai...@hotmail.com] Sent: Thursday, September 27, 2012 9:30 AM To: java-dev@axis.apache.org Subject: RE: No headers in response Hi Brian i'll take the last question.. from axis2.xml i assume you have included optional Headers axis2.xml contains: <moduleConfig name="addressing"> <parameter name="includeOptionalHeaders">true</parameter> </moduleConfig> run this test where axis2-IncludeOptionalHeadersTrue.xml contains <axisconfig name="AxisJava2.0"> <!-- Comment this to disable Addressing --> <module ref="addressing"/> <!--Configuring module , providing parameters for modules whether they refer or not--> <moduleConfig name="addressing"> <parameter name="includeOptionalHeaders">true</parameter> </moduleConfig> <!-- ================================================= --> <!-- Phases --> <!-- ================================================= --> <phaseOrder type="InFlow"> <!-- System predefined phases --> <phase name="Transport"> <handler name="RequestURIBasedDispatcher" class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"> <order phase="Transport"/> </handler> <handler name="SOAPActionBasedDispatcher" class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"> <order phase="Transport"/> </handler> </phase> <phase name="Addressing"> <handler name="AddressingBasedDispatcher" class="org.apache.axis2.dispatchers.AddressingBasedDispatcher"> <order phase="Addressing"/> </handler> </phase> <phase name="Security"/> <phase name="PreDispatch"/> <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase"> <handler name="RequestURIBasedDispatcher" class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/> <handler name="SOAPActionBasedDispatcher" class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/> <handler name="RequestURIOperationDispatcher" class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/> <handler name="SOAPMessageBodyBasedDispatcher" class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/> <handler name="HTTPLocationBasedDispatcher" class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/> <handler name="GenericProviderDispatcher" class="org.apache.axis2.jaxws.dispatchers.GenericProviderDispatcher"/> <handler name="MustUnderstandValidationDispatcher" class="org.apache.axis2.jaxws.dispatchers.MustUnderstandValidationDispatcher "/> </phase> <phase name="RMPhase"/> <!-- System predefined phases --> <!-- After Postdispatch phase module author or service author can add any phase he want --> <phase name="OperationInPhase"> <handler name="MustUnderstandChecker" class="org.apache.axis2.jaxws.dispatchers.MustUnderstandChecker"> <order phase="OperationInPhase"/> </handler> </phase> <phase name="soapmonitorPhase"/> </phaseOrder> <phaseOrder type="OutFlow"> <!-- user can add his own phases to this area --> <phase name="soapmonitorPhase"/> <phase name="OperationOutPhase"/> <!--system predefined phase--> <!--these phase will run irrespective of the service--> <phase name="RMPhase"/> <phase name="PolicyDetermination"/> <phase name="MessageOut"/> <phase name="Security"/> </phaseOrder> <phaseOrder type="InFaultFlow"> <phase name="Addressing"> <handler name="AddressingBasedDispatcher" class="org.apache.axis2.dispatchers.AddressingBasedDispatcher"> <order phase="Addressing"/> </handler> </phase> <phase name="Security"/> <phase name="PreDispatch"/> <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase"> <handler name="RequestURIBasedDispatcher" class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/> <handler name="SOAPActionBasedDispatcher" class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/> <handler name="RequestURIOperationDispatcher" class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/> <handler name="SOAPMessageBodyBasedDispatcher" class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/> <handler name="HTTPLocationBasedDispatcher" class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/> <handler name="GenericProviderDispatcher" class="org.apache.axis2.jaxws.dispatchers.GenericProviderDispatcher"/> <handler name="MustUnderstandValidationDispatcher" class="org.apache.axis2.jaxws.dispatchers.MustUnderstandValidationDispatcher "/> </phase> <phase name="RMPhase"/> <!-- user can add his own phases to this area --> <phase name="OperationInFaultPhase"/> <phase name="soapmonitorPhase"/> </phaseOrder> <phaseOrder type="OutFaultFlow"> <!-- user can add his own phases to this area --> <phase name="soapmonitorPhase"/> <phase name="OperationOutFaultPhase"/> <phase name="RMPhase"/> <phase name="PolicyDetermination"/> <phase name="MessageOut"/> <phase name="Security"/> </phaseOrder> </axisconfig> //now run the TestCase org.apache.axis2.handlers.addressing.AddressingOutHandlerTest.java: java.io.File configFile = new java.io.File(System.getProperty("basedir",".") + "/test-resources/axis2-IncludeOptionalHeadersTrue.xml"); org.apache.axis2.context.ConfigurationContext cfgCtx =org.apache.axis2.context.ConfigurationContextFactory.createConfigurationCon textFromFileSystem("target/test-classes",configFile.getAbsolutePath()); //<parameter name="includeOptionalHeaders">true</parameter> in addressing module should now be true msgCtxt = cfgCtx.createMessageContext(); msgCtxt.setEnvelope(OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope( )); msgCtxt.setTo(new EndpointReference("http://www.to.org/service/")); msgCtxt.setFrom(new EndpointReference("http://www.from.org/service/")); msgCtxt.setReplyTo(new EndpointReference("http://www.replyTo.org/service/")); msgCtxt.setFaultTo(new EndpointReference("http://www.faultTo.org/service/")); msgCtxt.setWSAAction("http://www.actions.org/action"); msgCtxt.setMessageID("123456-7890"); msgCtxt.addRelatesTo(new RelatesTo("http://www.relatesTo.org/service/")); msgCtxt.setProperty(WS_ADDRESSING_VERSION, Final.WSA_NAMESPACE); outHandler.invoke(msgCtxt); org.custommonkey.xmlunit.XMLUnit.setIgnoreWhitespace(true); assertXMLEqual(msgCtxt.getEnvelope().toString(), org.apache.axis2.handlers.util.TestUtil.getOMBuilder("withOptionalHeadersTes t.xml").getDocumentElement().toString()); //msgCtxt.getEnvelope().toString() should be IDENTICAL to contents of withOptionalHeadersTest.xml shown here <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"> <wsa:To>http://www.to.org/service/ <http://www.to.org/service/%3c/wsa:To> </wsa:To> <wsa:From><wsa:Address>http://www.from.org/service/ <http://www.from.org/service/%3c/wsa:Address%3e%3c/wsa:From> </wsa:Address></wsa:From> <wsa:ReplyTo><wsa:Address>http://www.replyTo.org/service/ <http://www.replyTo.org/service/%3c/wsa:Address%3e%3c/wsa:ReplyTo> </wsa:Address></wsa:ReplyTo> <wsa:FaultTo><wsa:Address>http://www.faultTo.org/service/ <http://www.faultTo.org/service/%3c/wsa:Address%3e%3c/wsa:FaultTo> </wsa:Address></wsa:FaultTo> <wsa:Action>http://www.actions.org/action <http://www.actions.org/action%3c/wsa:Action> </wsa:Action> <wsa:MessageID>123456-7890</wsa:MessageID> <wsa:RelatesTo RelationshipType="http://www.w3.org/2005/08/addressing/reply">http://www.rel atesTo.org/service/ <http://www.relatesTo.org/service/%3c/wsa:RelatesTo> </wsa:RelatesTo> </soapenv:Header> <soapenv:Body /> </soapenv:Envelope> is this not the case? Martin Gainty ______________________________________________ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. _____ From: brianreinh...@lampreynetworks.com To: java-dev@axis.apache.org Subject: No headers in response Date: Thu, 27 Sep 2012 07:35:07 -0400 I am re-opening a question I saw no answer to asked in this forum quite a while ago. In the STS service requesting a SMAL20 token the response is okay. But in the service that needs to have the SAML20 token, the response has no headers at all. This is in spite of the must understand setting in the client headers in both the addressing and security part. Everything is 1.6.2; rampart, axis2, and axiom is 1.2.14. Adding the <parameter name="includeOptionalHeaders">true</parameter> in the service.xml does not help (though that is what I used programmatically on the client side to generate the correct addressing headers). Is this a bug or what am I doing wrong in the configuration? Thanks, Brian Reinhold