[xgws-dev] CVS Update: codes/xsul/java/tests/xsul/ws_addressing

Aleksander Andrzej Slominski xgws-dev_at_extreme.indiana.edu
Sun Apr 30 19:18:01 2006


aslom       06/04/30 19:17:28

  Modified:    xsul/java/doc changes.html
               xsul/java/modules/common/xsul XsulVersion.java
               xsul/java/modules/ws_addressing/xsul/ws_addressing
                        WsaInvoker.java
               xsul/java/tests/xsul/ws_addressing TestWsaOperations.java
  Log:
  WsaInvoker will use the same WSA namespace that target EPR is using unless invoker.setTargetWsa() is called
  
  Revision  Changes    Path
  1.47      +4 -0      codes/xsul/java/doc/changes.html
  
  Index: changes.html
  ===================================================================
  RCS file: /l/extreme/cvs/codes/xsul/java/doc/changes.html,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -b -t -w -r1.46 -r1.47
  --- changes.html	30 Apr 2006 06:58:18 -0000	1.46
  +++ changes.html	30 Apr 2006 23:17:27 -0000	1.47
  @@ -14,6 +14,10 @@
   
   <ul>
   
  +<li>2006-04-30 (2.5.5): WsaInvoker will use the same WSA namespace that target EPR is using unless
  +invoker.setTargetWsa() is called
  +</li>
  +
   <li>2006-04-30 (2.5.4): replaced "Envelope" and "Header" with const, more WS-Addressing tests
   (in particular compare whole XML trees after WSA conversions)
   </li>
  
  
  
  1.73      +4 -4      codes/xsul/java/modules/common/xsul/XsulVersion.java
  
  Index: XsulVersion.java
  ===================================================================
  RCS file: /l/extreme/cvs/codes/xsul/java/modules/common/xsul/XsulVersion.java,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -b -t -w -r1.72 -r1.73
  --- XsulVersion.java	30 Apr 2006 06:48:12 -0000	1.72
  +++ XsulVersion.java	30 Apr 2006 23:17:28 -0000	1.73
  @@ -1,18 +1,18 @@
   /* -*- mode: Java; c-basic-offset: 4; indent-tabs-mode: nil; -*-  //------100-columns-wide------>|*/
   /* Copyright (c) 2002-2006 Extreme! Lab, Indiana University. All rights reserved.
    * This software is open source. See the bottom of this file for the licence.
  - * $Id: XsulVersion.java,v 1.72 2006/04/30 06:48:12 aslom Exp $ */
  + * $Id: XsulVersion.java,v 1.73 2006/04/30 23:17:28 aslom Exp $ */
   package xsul;
   
   /**
    * One place to put version number.
    *
  - * @version $Revision: 1.72 $
  + * @version $Revision: 1.73 $
    * @author <a href="http://www.extreme.indiana.edu/~aslom/">Aleksander Slominski</a>
    */
   public class XsulVersion {
  -    public final static String SPEC_VERSION = "2.5.4";
  -    private final static String BUILD = "_q1"; //"_SPECIAL_EDITION";//"_b4";
  +    public final static String SPEC_VERSION = "2.5.5";
  +    private final static String BUILD = "_f1"; //"_SPECIAL_EDITION";//"_b4";
   
       private final static String PROJECT_NAME = "XSUL";
       public  final static String IMPL_VERSION = SPEC_VERSION+BUILD;
  
  
  
  1.13      +10 -4     codes/xsul/java/modules/ws_addressing/xsul/ws_addressing/WsaInvoker.java
  
  Index: WsaInvoker.java
  ===================================================================
  RCS file: /l/extreme/cvs/codes/xsul/java/modules/ws_addressing/xsul/ws_addressing/WsaInvoker.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -b -t -w -r1.12 -r1.13
  --- WsaInvoker.java	30 Apr 2006 03:22:03 -0000	1.12
  +++ WsaInvoker.java	30 Apr 2006 23:17:28 -0000	1.13
  @@ -4,7 +4,7 @@
    *
    * This software is open source. See the bottom of this file for the licence.
    *
  - * $Id: WsaInvoker.java,v 1.12 2006/04/30 03:22:03 aslom Exp $
  + * $Id: WsaInvoker.java,v 1.13 2006/04/30 23:17:28 aslom Exp $
    */
   
   package xsul.ws_addressing;
  @@ -35,7 +35,7 @@
    * will use WSA processing node to indicate where to send replies.
    * <br />NOTE: this is class is not multi-thread safe and MUST be proected if used concurently!
    *
  - * @version $Revision: 1.12 $
  + * @version $Revision: 1.13 $
    * @author <a href="http://www.extreme.indiana.edu/~aslom/">Aleksander Slominski</a>
    */
   public class WsaInvoker implements MessageInvoker
  @@ -209,7 +209,13 @@
           
           XmlDocument doc = wrapInSoapEnvelopeIfNecessary(message);
           //System.err.println(getClass().getName()+" "+xsul.util.Util.safeXmlToString(doc.getDocumentElement()));
  -        WsaMessageInformationHeaders wmih = new WsaMessageInformationHeaders(targetWsa, doc);
  +        WsaMessageInformationHeaders wmih; {
  +            XmlNamespace wsa = targetWsa;
  +            if(targetEPR != null && wsa == null) {
  +                wsa = targetEPR.getWsAddressingVersion();
  +            }
  +            wmih = new WsaMessageInformationHeaders(wsa, doc);
  +        }
           if(targetEPR != null) {
               // explode targetER into SOAP headers
               wmih.explodeEndpointReference(targetEPR);
  
  
  
  1.3       +20 -10    codes/xsul/java/tests/xsul/ws_addressing/TestWsaOperations.java
  
  Index: TestWsaOperations.java
  ===================================================================
  RCS file: /l/extreme/cvs/codes/xsul/java/tests/xsul/ws_addressing/TestWsaOperations.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -t -w -r1.2 -r1.3
  --- TestWsaOperations.java	30 Apr 2006 03:22:04 -0000	1.2
  +++ TestWsaOperations.java	30 Apr 2006 23:17:28 -0000	1.3
  @@ -4,7 +4,7 @@
    *
    * This software is open source. See the bottom of this file for the licence.
    *
  - * $Id: TestWsaOperations.java,v 1.2 2006/04/30 03:22:04 aslom Exp $
  + * $Id: TestWsaOperations.java,v 1.3 2006/04/30 23:17:28 aslom Exp $
    */
   
   package xsul.ws_addressing;
  @@ -33,7 +33,7 @@
   /**
    * Tests for utility methods shared by all clases in package.
    *
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    * @author <a href="http://www.extreme.indiana.edu/~aslom/">Aleksander Slominski</a>
    */
   public class TestWsaOperations extends XsulTestCase {
  @@ -50,6 +50,7 @@
       
       private static SoapHttpDynamicInfosetProcessor customizedProcessor;
       private String location;
  +    private XmlNamespace expectedVersionOfWsa;
       
       public static void main (String[] args) {
           junit.textui.TestRunner.run (new TestSuite(TestWsaOperations.class));
  @@ -88,8 +89,10 @@
           XmlElement message = builder.newFragment(
               "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification", "PauseSubscription");
           
  +        expectedVersionOfWsa = wsa;
  +        
           WsaInvoker invoker = new WsaInvoker();
  -        invoker.setTargetWsa(wsa);
  +        //invoker.setTargetWsa(wsa);
           invoker.setTargetEPR(epr);
           invoker.setDefaultAction(new URI("http://www.ibm.com/Action"));
           assertNotNull(invoker.getDefaultAction());
  @@ -120,6 +123,11 @@
                   //System.err.println(getClass().getName()+" message destinaiton="+wsah.getTo());
                   assertEquals(location, wsah.getTo().toString());
                   
  +                //
  +                XmlNamespace actionNs = wsah.getSoapHeaderElement().requiredElement(null, "Action").getNamespace();
  +                //System.err.println(getClass()+" actionNs="+actionNs);
  +                assertEquals(expectedVersionOfWsa, actionNs);
  +                
                   //print reference properties
                   //XmlElement refProp = soapHeader.requiredElement(REF_PROPERTY_NS, REF_PROPERTY_NAME);
                   XmlElement refProp = wsah.getHeaderElement(REF_PROPERTY_NS, REF_PROPERTY_NAME);
  @@ -138,9 +146,11 @@
               }
               
               public XmlElement processMessage(XmlElement message) {
  +                if(logger.isFinestEnabled()) {
                   String msg = "received "+builder.serializeToString(message);
                   //System.err.println(getClass().getName()+" "+msg);
                   logger.finest(msg);
  +                }
                   //XmlElement resp = null;
                   //return resp;
                   return null; //null means send no repsonse - one way