axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r394073 - in /webservices/axis/trunk/java/src/org/apache/axis: client/Call.java client/Service.java wsa/EndpointReference.java
Date Fri, 14 Apr 2006 12:46:47 GMT
Author: dug
Date: Fri Apr 14 05:46:43 2006
New Revision: 394073

URL: http://svn.apache.org/viewcvs?rev=394073&view=rev
Log:
per the latest WSA spec - pick up ref-params in the wsdl

Modified:
    webservices/axis/trunk/java/src/org/apache/axis/client/Call.java
    webservices/axis/trunk/java/src/org/apache/axis/client/Service.java
    webservices/axis/trunk/java/src/org/apache/axis/wsa/EndpointReference.java

Modified: webservices/axis/trunk/java/src/org/apache/axis/client/Call.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/src/org/apache/axis/client/Call.java?rev=394073&r1=394072&r2=394073&view=diff
==============================================================================
--- webservices/axis/trunk/java/src/org/apache/axis/client/Call.java (original)
+++ webservices/axis/trunk/java/src/org/apache/axis/client/Call.java Fri Apr 14 05:46:43 2006
@@ -1655,14 +1655,14 @@
             else if ( obj instanceof UnknownExtensibilityElement ) {
               UnknownExtensibilityElement ee =
                 (UnknownExtensibilityElement) obj ;
-              QName QN1 = new QName( WSAConstants.NS_WSA1, "EndpointReference");
-              QName QN2 = new QName( WSAConstants.NS_WSA2, "EndpointReference");
-              if ( QN1.equals(ee.getElementType()) ||
-                   QN2.equals(ee.getElementType()) ) {
+              QName QN1 = new QName(WSAConstants.NS_WSA1,"ReferenceParameters");
+              QName QN2 = new QName(WSAConstants.NS_WSA2,"ReferenceParameters");
+              QName eeQ = ee.getElementType();
+              if ( QN1.equals(eeQ) || QN2.equals(eeQ) ) {
                 try {
-                  EndpointReference epr =
-                    EndpointReference.fromDOM( ee.getElement() );
-                  this.setTo( epr );
+                  this.setTo( this.getTargetEndpointAddress() );
+                  this.getTo().addReferenceParameters( ee.getElement() );
+                  this.getTo().setWSAVersion( eeQ.getNamespaceURI() );
                 }
                 catch(Exception exp) {
                   throw new JAXRPCException(

Modified: webservices/axis/trunk/java/src/org/apache/axis/client/Service.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/src/org/apache/axis/client/Service.java?rev=394073&r1=394072&r2=394073&view=diff
==============================================================================
--- webservices/axis/trunk/java/src/org/apache/axis/client/Service.java (original)
+++ webservices/axis/trunk/java/src/org/apache/axis/client/Service.java Fri Apr 14 05:46:43
2006
@@ -513,14 +513,14 @@
             else if ( obj instanceof UnknownExtensibilityElement ) {
               UnknownExtensibilityElement ee = 
                 (UnknownExtensibilityElement) obj ;
-              QName QN1 = new QName( WSAConstants.NS_WSA1, "EndpointReference");
-              QName QN2 = new QName( WSAConstants.NS_WSA2, "EndpointReference");
-              if ( QN1.equals(ee.getElementType()) ||
-                   QN2.equals(ee.getElementType()) ) {
+              QName QN1 = new QName(WSAConstants.NS_WSA1,"ReferenceParameters");
+              QName QN2 = new QName(WSAConstants.NS_WSA2,"ReferenceParameters");
+              QName eeQ = ee.getElementType();
+              if ( QN1.equals(eeQ) || QN2.equals(eeQ) ) {
                 try {
-                  EndpointReference epr = 
-                    EndpointReference.fromDOM( ee.getElement() );
-                  call.setTo( epr );
+                  call.setTo( call.getTargetEndpointAddress() );
+                  call.getTo().addReferenceParameters( ee.getElement() );
+                  call.getTo().setWSAVersion( eeQ.getNamespaceURI() );
                 }
                 catch(Exception exp) {
                   throw new ServiceException(

Modified: webservices/axis/trunk/java/src/org/apache/axis/wsa/EndpointReference.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/src/org/apache/axis/wsa/EndpointReference.java?rev=394073&r1=394072&r2=394073&view=diff
==============================================================================
--- webservices/axis/trunk/java/src/org/apache/axis/wsa/EndpointReference.java (original)
+++ webservices/axis/trunk/java/src/org/apache/axis/wsa/EndpointReference.java Fri Apr 14
05:46:43 2006
@@ -153,34 +153,50 @@
        }
 
        nl = el.getElementsByTagNameNS(ns, "ReferenceProperties");
-       if (nl.item(0)!=null) {
-         nl = nl.item(0).getChildNodes();
-    
-         for ( int i = 0 ; nl != null && i < nl.getLength() ; i++ ) {
-           Node n = nl.item(i);
-           if ( n.getNodeType() != Node.ELEMENT_NODE ) continue ;
-           n = n.cloneNode(true);
-           er.addReferenceProperty( XMLUtils.ElementToString((Element) n) );
-         }
-       }
+       if (nl.item(0)!=null) 
+         er.addReferenceProperties( (Element) nl.item(0) );
 
        nl = el.getElementsByTagNameNS(ns, "ReferenceParameters");
-       if (nl.item(0)!=null) {
-         nl = nl.item(0).getChildNodes();
-    
-         for ( int i = 0 ; nl != null && i < nl.getLength() ; i++ ) {
-           Node n = nl.item(i);
-           if ( n.getNodeType() != Node.ELEMENT_NODE ) continue ;
-           n = n.cloneNode(true);
-           er.addReferenceParameter( XMLUtils.ElementToString((Element) n) );
-         }
-       }
+       if (nl.item(0)!=null) 
+         er.addReferenceParameters( (Element) nl.item(0) );
      }
      if ( er.getAddress() == null ) {
        String tmp = "Missing Address in EPR: " + XMLUtils.ElementToString(el);
        throw new Exception( tmp );
      }
      return er ;
+  }
+
+  /**
+   * Passing in a wsa:ReferenceParameter element this will add all children
+   * add references parameters to the EPR
+   * @param refp The DOM element of the wsa:ReferenceParameter
+   */
+  public void addReferenceParameters(Element refp) {
+    NodeList nl = refp.getChildNodes();
+
+    for ( int i = 0 ; nl != null && i < nl.getLength() ; i++ ) {
+      Node n = nl.item(i);
+      if ( n.getNodeType() != Node.ELEMENT_NODE ) continue ;
+      n = n.cloneNode(true);
+      this.addReferenceParameter( XMLUtils.ElementToString((Element) n ));
+    }
+  }
+
+  /**
+   * Passing in a wsa:ReferenceProperties element this will add all children
+   * add references properties to the EPR
+   * @param refp The DOM element of the wsa:ReferenceProperties
+   */
+  public void addReferenceProperties(Element refp) {
+    NodeList nl = refp.getChildNodes();
+
+    for ( int i = 0 ; nl != null && i < nl.getLength() ; i++ ) {
+      Node n = nl.item(i);
+      if ( n.getNodeType() != Node.ELEMENT_NODE ) continue ;
+      n = n.cloneNode(true);
+      this.addReferenceProperty( XMLUtils.ElementToString((Element) n ));
+    }
   }
 
 /**



Mime
View raw message