You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by du...@apache.org on 2006/03/16 04:02:37 UTC
svn commit: r386245 - in /webservices/axis/trunk/proposals/dug/java:
src/org/apache/axis/wsa/ test/functional/
Author: dug
Date: Wed Mar 15 19:02:36 2006
New Revision: 386245
URL: http://svn.apache.org/viewcvs?rev=386245&view=rev
Log:
First pass at w3c version of WS-Addr
Modified:
webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/AxisEndpointReference.java
webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/EndpointReference.java
webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/MIHeader.java
webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/RelatesToProperty.java
webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/WSAConstants.java
webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/WSAHandler.java
webservices/axis/trunk/proposals/dug/java/test/functional/auto-deploy.wsdd
Modified: webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/AxisEndpointReference.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/AxisEndpointReference.java?rev=386245&r1=386244&r2=386245&view=diff
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/AxisEndpointReference.java (original)
+++ webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/AxisEndpointReference.java Wed Mar 15 19:02:36 2006
@@ -27,22 +27,4 @@
super(epr);
}
-/*
- public javax.xml.rpc.Call createCall() throws java.net.MalformedURLException, javax.xml.parsers.ParserConfigurationException {
- org.apache.axis.client.Call ret = new org.apache.axis.client.Call(address);
-
- addSOAPHeaders(ret);
- return ret;
- }
-
- public void addSOAPHeaders(org.apache.axis.client.Call c) throws javax.xml.parsers.ParserConfigurationException {
-
- for (Iterator i = createWsaHeaderElements().iterator(); i.hasNext();) {
- Element refNode = (Element) i.next();
-
- c.addHeader(new SOAPHeaderElement(refNode));
- }
- }
- */
-
}
Modified: webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/EndpointReference.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/EndpointReference.java?rev=386245&r1=386244&r2=386245&view=diff
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/EndpointReference.java (original)
+++ webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/EndpointReference.java Wed Mar 15 19:02:36 2006
@@ -21,7 +21,9 @@
abstract public class EndpointReference implements Serializable {
+ protected static String staticNS = WSAConstants.NS_WSA ;
+ protected String namespace = staticNS ;
protected String address = null;
protected String portType = null; // QName
protected String serviceName = null; // QName
@@ -29,9 +31,6 @@
protected List referenceProperties = new java.util.LinkedList();
protected List referenceParameters = new java.util.LinkedList();
- private static EndpointReference AnonymousEPR =
- EndpointReference.fromLocation( WSAConstants.Anonymous_Address );
-
EndpointReference( final EndpointReference epr){
this.address = epr.address;
this.portType = epr.portType; //rrfoo still missing from serializers!
@@ -43,6 +42,22 @@
protected EndpointReference() {}
+ public void setWSAVersion( String ns) {
+ namespace = ns ;
+ }
+
+ public String getWSAVersion() {
+ return namespace ;
+ }
+
+ public static void setGlobalWSAVersion(String ns) {
+ staticNS = ns ;
+ }
+
+ public static String getGlobalWSAVersion() {
+ return staticNS ;
+ }
+
public EndpointReference dup() throws Exception {
EndpointReference newObj = (EndpointReference)this.getClass().newInstance();
newObj.setAddress( this.getAddress() );
@@ -77,12 +92,32 @@
return new AxisEndpointReference();
}
+ public static EndpointReference newInstance(String ns) {
+ EndpointReference epr = new AxisEndpointReference();
+ epr.setWSAVersion( ns );
+ return epr ;
+ }
+
public static EndpointReference Anonymous() throws Exception {
- return AnonymousEPR.dup() ;
+ if ( staticNS.equals(WSAConstants.NS_WSA1) )
+ return EndpointReference.fromLocation( staticNS + "/role/anonymous" );
+ return EndpointReference.fromLocation( staticNS + "/anonymous" );
+ }
+
+ public static EndpointReference Anonymous(String ns) throws Exception {
+ if ( ns.equals(WSAConstants.NS_WSA1) )
+ return EndpointReference.fromLocation( ns + "/role/anonymous" );
+ return EndpointReference.fromLocation( ns + "/anonymous" );
}
public boolean isAnonymous() {
- return WSAConstants.Anonymous_Address.equals( this.address );
+ if ( namespace.equals(WSAConstants.NS_WSA1) )
+ return this.address.equals( namespace + "/role/anonymous" );
+ return this.address.equals( namespace + "/anonymous" );
+ }
+
+ public boolean isNone() {
+ return this.address.equals( namespace + "/none" );
}
/**
@@ -95,45 +130,55 @@
*/
public static EndpointReference fromDOM(Element el) throws Exception {
EndpointReference er = new AxisEndpointReference();
- NodeList nl = el.getElementsByTagNameNS(WSAConstants.NS_WSA, "Address");
- if ( nl.getLength() == 0 ) {
- String tmp = "Missing Address in EPR: " + XMLUtils.ElementToString(el);
- throw new Exception( tmp );
- }
- if (nl.item(0)!=null) {
- er.setAddress(Util.getText((Element)nl.item(0)));
- }
- nl = el.getElementsByTagNameNS(WSAConstants.NS_WSA, "PortType");
- if (nl.item(0)!=null) {
- er.setPortType(Util.getText((Element)nl.item(0)));
- }
- nl = el.getElementsByTagNameNS(WSAConstants.NS_WSA, "ServiceName");
- if (nl.item(0)!=null) {
- Element child = (Element)nl.item(0);
- er.setServiceName(Util.getText(child));
- er.setPortName(child.getAttributeNS(WSAConstants.NS_WSA, "PortName"));
- }
- nl = el.getElementsByTagNameNS(WSAConstants.NS_WSA, "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) );
+ String NSs[] = new String[] { WSAConstants.NS_WSA1, WSAConstants.NS_WSA2 };
+
+ for ( int j = 0 ; j < NSs.length ; j++ ) {
+ String ns = NSs[j] ;
+
+ NodeList nl = el.getElementsByTagNameNS(ns, "Address");
+ if ( nl.item(0)!=null ) {
+ er.setAddress(Util.getText((Element)nl.item(0)));
+ er.setWSAVersion( ns );
}
- }
- nl = el.getElementsByTagNameNS(WSAConstants.NS_WSA, "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) );
+
+ nl = el.getElementsByTagNameNS(ns, "PortType");
+ if (nl.item(0)!=null)
+ er.setPortType(Util.getText((Element)nl.item(0)));
+
+ nl = el.getElementsByTagNameNS(ns, "ServiceName");
+ if (nl.item(0)!=null) {
+ Element child = (Element)nl.item(0);
+ er.setServiceName(Util.getText(child));
+ er.setPortName(child.getAttributeNS(ns, "PortName"));
+ }
+
+ 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) );
+ }
}
+
+ 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 ( er.getAddress() == null ) {
+ String tmp = "Missing Address in EPR: " + XMLUtils.ElementToString(el);
+ throw new Exception( tmp );
}
return er ;
}
@@ -148,6 +193,12 @@
return new AxisEndpointReference(location);
}
+ public static EndpointReference fromLocation(final String location,String ns){
+ EndpointReference epr = new AxisEndpointReference(location);
+ epr.setWSAVersion( ns );
+ return epr ;
+ }
+
/**
* Method getAddress returns the address of the Service Endpoint..
* @return String
@@ -196,40 +247,6 @@
portType = pt;
}
- protected java.util.List headers = null;
-
- protected synchronized List createWsaHeaderElements() throws javax.xml.parsers.ParserConfigurationException {
- if (headers != null) return headers;
- headers = new java.util.LinkedList();
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-
- dbf.setNamespaceAware(true);
- dbf.setValidating(false);
-
- DocumentBuilder db = dbf.newDocumentBuilder();
-
- Document ehrDoc = db.newDocument();
- Element child = ehrDoc.createElementNS(WSAConstants.NS_WSA, "To");
-
- child.appendChild(ehrDoc.createTextNode(address));
- headers.add(child);
- if (null != referenceProperties && !referenceProperties.isEmpty()) {
- for (Iterator i = referenceProperties.iterator(); i.hasNext();) {
- Node refNode = (Node) i.next();
-
- headers.add(ehrDoc.importNode(refNode, true));
- }
- }
- if (null != referenceParameters && !referenceParameters.isEmpty()) {
- for (Iterator i = referenceParameters.iterator(); i.hasNext();) {
- Node refNode = (Node) i.next();
-
- headers.add(ehrDoc.importNode(refNode, true));
- }
- }
- return headers;
- }
-
public Element toDOM() throws javax.xml.parsers.ParserConfigurationException {
return toDOM(null, null);
}
@@ -243,7 +260,6 @@
}
public Element toDOM(String prefix, String ns, String name) throws javax.xml.parsers.ParserConfigurationException {
- headers = new java.util.LinkedList();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
@@ -254,7 +270,7 @@
Document ehrDoc = db.newDocument();
Element rootChild = null;
if (ns == null) {
- rootChild = ehrDoc.createElementNS(WSAConstants.NS_WSA, "EndpointReference");
+ rootChild = ehrDoc.createElementNS(namespace, "EndpointReference");
rootChild.setPrefix("wsa");
} else {
rootChild = ehrDoc.createElementNS(ns, name);
@@ -263,14 +279,14 @@
ehrDoc.appendChild( rootChild);
// Address
- Element child = ehrDoc.createElementNS(WSAConstants.NS_WSA, "Address");
+ Element child = ehrDoc.createElementNS(namespace, "Address");
child.setPrefix("wsa");
child.appendChild(ehrDoc.createTextNode(address));
rootChild.appendChild(child);
// PortType
if (portType!=null) {
- Element pt = ehrDoc.createElementNS(WSAConstants.NS_WSA, "PortType");
+ Element pt = ehrDoc.createElementNS(namespace, "PortType");
pt.setPrefix("wsa");
pt.appendChild(ehrDoc.createTextNode(portType));
rootChild.appendChild(pt);
@@ -278,10 +294,10 @@
// ServiceName
if (serviceName!=null) {
- Element sn = ehrDoc.createElementNS(WSAConstants.NS_WSA, "ServiceName");
+ Element sn = ehrDoc.createElementNS(namespace, "ServiceName");
sn.setPrefix("wsa");
if (portName!=null) {
- Attr attr = ehrDoc.createAttributeNS(WSAConstants.NS_WSA, "PortName");
+ Attr attr = ehrDoc.createAttributeNS(namespace, "PortName");
attr.setValue(this.portName);
sn.setAttributeNodeNS(attr);
}
@@ -290,21 +306,23 @@
}
// Reference properties
- if (null != referenceProperties && !referenceProperties.isEmpty()) {
- Element refProp= ehrDoc.createElementNS(WSAConstants.NS_WSA, WSAConstants.EN_ReferenceProperties);
- refProp.setPrefix("wsa");
- for (Iterator i = referenceProperties.iterator(); i.hasNext();) {
- String refStr = (String) i.next();
- Element refNode = XMLUtils.StringToElement( refStr );
-
- refProp.appendChild(ehrDoc.importNode(refNode, true));
- }
- rootChild.appendChild(refProp);
- }
+ if (namespace.equals(WSAConstants.NS_WSA1)) {
+ if (null != referenceProperties && !referenceProperties.isEmpty()) {
+ Element refProp= ehrDoc.createElementNS(namespace, WSAConstants.EN_ReferenceProperties);
+ refProp.setPrefix("wsa");
+ for (Iterator i = referenceProperties.iterator(); i.hasNext();) {
+ String refStr = (String) i.next();
+ Element refNode = XMLUtils.StringToElement( refStr );
+
+ refProp.appendChild(ehrDoc.importNode(refNode, true));
+ }
+ rootChild.appendChild(refProp);
+ }
+ }
// Reference parameters
if (null != referenceParameters && !referenceParameters.isEmpty()) {
- Element refProp= ehrDoc.createElementNS(WSAConstants.NS_WSA, WSAConstants.EN_ReferenceParameters);
+ Element refProp= ehrDoc.createElementNS(namespace, WSAConstants.EN_ReferenceParameters);
refProp.setPrefix("wsa");
for (Iterator i = referenceParameters.iterator(); i.hasNext();) {
String refStr = (String) i.next();
Modified: webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/MIHeader.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/MIHeader.java?rev=386245&r1=386244&r2=386245&view=diff
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/MIHeader.java (original)
+++ webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/MIHeader.java Wed Mar 15 19:02:36 2006
@@ -33,6 +33,7 @@
* create and read these headers to/from a message.
*/
public class MIHeader {
+ String namespace = EndpointReference.staticNS ;
boolean requestMessage = false;
String messageID = null ;
@@ -60,7 +61,8 @@
// but it works.
public String toString() {
- return "{id:" + getMessageID()+ " to:" + getTo() + " from:" + getFrom() +
+ return "{ns: " + getWSAVersion() + " id:" + getMessageID()+
+ " to:" + getTo() + " from:" + getFrom() +
" replyTo:" + getReplyTo() + " faultTo:" + getFaultTo() +
" action:" + getAction() + " toFault:" + getToFault() + "}" ;
}
@@ -96,6 +98,14 @@
setMessageID( "uuid:" + UUIDGenerator.getInstance().getUUID());
}
+ public void setWSAVersion(String ns) {
+ namespace = ns ;
+ }
+
+ public String getWSAVersion() {
+ return namespace ;
+ }
+
public static MIHeader fromCurrentMessage() throws Exception {
if ( MessageContext.getCurrentContext().getPastPivot() )
return fromResponse();
@@ -151,6 +161,7 @@
MIHeader newMIH = new MIHeader();
EndpointReference toEPR = getEffectiveReplyTo();
+ newMIH.setWSAVersion( namespace );
newMIH.setFrom( to );
newMIH.setTo( toEPR );
newMIH.setToFault( faultTo );
@@ -162,78 +173,78 @@
public void fromEnvelope(SOAPEnvelope env) throws Exception {
SOAPHeaderElement header = null ;
+ String NSs[] = { WSAConstants.NS_WSA1, WSAConstants.NS_WSA2 };
- header = env.getHeaderByName(WSAConstants.NS_WSA, "MessageID");
- if ( header != null ) {
- messageID = Util.getText( header.getAsDOM() );
- if ( processedOnGet ) header.setProcessed(true);
- if ( removeOnGet ) env.removeHeader( header );
- }
- else messageID = null ;
-
- header = env.getHeaderByName(WSAConstants.NS_WSA, "To");
- if ( header != null ) {
- to = EndpointReference.fromLocation( Util.getText( header.getAsDOM() ) );
- if ( processedOnGet ) header.setProcessed(true);
- if ( removeOnGet ) env.removeHeader( header );
- }
- else to = null ;
-
- header = env.getHeaderByName(WSAConstants.NS_WSA, "Action");
- if ( header != null ) {
- action = Util.getText( header.getAsDOM() );
- if ( processedOnGet ) header.setProcessed(true);
- if ( removeOnGet ) env.removeHeader( header );
- }
- else action = null ;
-
- header = env.getHeaderByName(WSAConstants.NS_WSA, "From");
- if ( header != null ) {
- from = EndpointReference.fromDOM( header.getAsDOM() );
- if ( processedOnGet ) header.setProcessed(true);
- if ( removeOnGet ) env.removeHeader( header );
- }
- else from = null ;
+ for ( int i = 0 ; i < NSs.length ; i++ ) {
+ String ns = NSs[i];
- header = env.getHeaderByName(WSAConstants.NS_WSA, "ReplyTo");
- if ( header != null ) {
- replyTo = EndpointReference.fromDOM( header.getAsDOM() );
- if ( processedOnGet ) header.setProcessed(true);
- if ( removeOnGet ) env.removeHeader( header );
- }
- else replyTo = null ;
+ header = env.getHeaderByName(ns, "MessageID");
+ if ( header != null ) {
+ messageID = Util.getText( header.getAsDOM() );
+ if ( processedOnGet ) header.setProcessed(true);
+ if ( removeOnGet ) env.removeHeader( header );
+ }
+
+ header = env.getHeaderByName(ns, "To");
+ if ( header != null ) {
+ to = EndpointReference.fromLocation( Util.getText( header.getAsDOM() ),
+ ns);
+ if ( processedOnGet ) header.setProcessed(true);
+ if ( removeOnGet ) env.removeHeader( header );
+ namespace = ns ;
+ }
+
+ header = env.getHeaderByName(ns, "Action");
+ if ( header != null ) {
+ action = Util.getText( header.getAsDOM() );
+ if ( processedOnGet ) header.setProcessed(true);
+ if ( removeOnGet ) env.removeHeader( header );
+ }
+
+ header = env.getHeaderByName(ns, "From");
+ if ( header != null ) {
+ from = EndpointReference.fromDOM( header.getAsDOM() );
+ if ( processedOnGet ) header.setProcessed(true);
+ if ( removeOnGet ) env.removeHeader( header );
+ }
- Enumeration enum = env.getHeadersByName(WSAConstants.NS_WSA, "RelatesTo");
- if ( enum.hasMoreElements() ) {
- relatesTo = new Vector();
- while ( enum.hasMoreElements() ) {
- header = (SOAPHeaderElement) enum.nextElement();
- String type = header.getAttributeValue(new org.apache.axis.message.PrefixedQName("","RelationshipType", ""));
- String uri = header.getValue();
- relatesTo.add(new RelatesToProperty(uri, type));
+ header = env.getHeaderByName(ns, "ReplyTo");
+ if ( header != null ) {
+ replyTo = EndpointReference.fromDOM( header.getAsDOM() );
if ( processedOnGet ) header.setProcessed(true);
if ( removeOnGet ) env.removeHeader( header );
}
- }
- else relatesTo = null ;
+
+ Enumeration enum = env.getHeadersByName(ns, "RelatesTo");
+ if ( enum.hasMoreElements() ) {
+ relatesTo = new Vector();
+ while ( enum.hasMoreElements() ) {
+ header = (SOAPHeaderElement) enum.nextElement();
+ String type = header.getAttributeValue(new org.apache.axis.message.PrefixedQName("","RelationshipType", ""));
+ String uri = header.getValue();
+ relatesTo.add(new RelatesToProperty(uri, type));
+ if ( processedOnGet ) header.setProcessed(true);
+ if ( removeOnGet ) env.removeHeader( header );
+ }
+ }
- header = env.getHeaderByName(WSAConstants.NS_WSA, "FaultTo");
- if ( header != null ) {
- faultTo = EndpointReference.fromDOM( header.getAsDOM() );
- if ( processedOnGet ) header.setProcessed(true);
- if ( removeOnGet ) env.removeHeader( header );
+ header = env.getHeaderByName(ns, "FaultTo");
+ if ( header != null ) {
+ faultTo = EndpointReference.fromDOM( header.getAsDOM() );
+ if ( processedOnGet ) header.setProcessed(true);
+ if ( removeOnGet ) env.removeHeader( header );
+ }
}
- else faultTo = null ;
}
public void toEnvelope(SOAPEnvelope env) throws Exception {
SOAPHeaderElement header = null ;
if ( env.getNamespaceURI("wsa") == null )
- env.addNamespaceDeclaration("wsa", WSAConstants.NS_WSA );
+ env.addNamespaceDeclaration("wsa", namespace );
if ( messageID != null ) {
- header = new SOAPHeaderElement( WSAConstants.NS_WSA, "MessageID" );
+ header = new SOAPHeaderElement( namespace, "MessageID" );
header.setActor( null );
header.addTextNode(messageID);
header.setMustUnderstand(mustUnderstand);
@@ -241,28 +252,34 @@
}
if ( to != null ) {
- header = new SOAPHeaderElement( WSAConstants.NS_WSA, "To" );
+ header = new SOAPHeaderElement( namespace, "To" );
header.setActor( null );
header.addTextNode( to.getAddress() );
header.setMustUnderstand(mustUnderstand);
env.addHeader(header);
- List refProps = to.getReferenceProperties();
- if ( refProps != null ) {
- for ( int i = 0 ; i < refProps.size() ; i++ ) {
- String elem = (String) refProps.get(i);
- SOAPHeaderElement h1 =
- new SOAPHeaderElement(XMLUtils.StringToElement(elem));
- h1.setActor( null );
- h1.setMustUnderstand(mustUnderstand);
- env.addHeader( h1 );
+
+ if ( namespace.equals(WSAConstants.NS_WSA1) ) {
+ List refProps = to.getReferenceProperties();
+ if ( refProps != null ) {
+ for ( int i = 0 ; i < refProps.size() ; i++ ) {
+ String elem = (String) refProps.get(i);
+ SOAPHeaderElement h1 =
+ new SOAPHeaderElement(XMLUtils.StringToElement(elem));
+ h1.setActor( null );
+ h1.setMustUnderstand(mustUnderstand);
+ env.addHeader( h1 );
+ }
}
}
+
List refParams = to.getReferenceParameters();
if ( refParams != null ) {
for ( int i = 0 ; i < refParams.size() ; i++ ) {
String elem = (String) refParams.get(i);
SOAPHeaderElement h1 =
new SOAPHeaderElement(XMLUtils.StringToElement(elem));
+ if ( namespace.equals(WSAConstants.NS_WSA2) )
+ h1.addAttribute(namespace, "IsReferenceParameter", "true");
h1.setActor( null );
h1.setMustUnderstand(mustUnderstand);
env.addHeader( h1 );
@@ -271,7 +288,7 @@
}
if ( action != null ) {
- header = new SOAPHeaderElement( WSAConstants.NS_WSA, "Action" );
+ header = new SOAPHeaderElement( namespace, "Action" );
header.setActor( null );
header.addTextNode( action );
header.setMustUnderstand(mustUnderstand);
@@ -279,14 +296,14 @@
}
if ( from != null ) {
- header = new SOAPHeaderElement(from.toDOM("wsa",WSAConstants.NS_WSA, "From"));
+ header = new SOAPHeaderElement(from.toDOM("wsa",namespace, "From"));
header.setActor( null );
header.setMustUnderstand(mustUnderstand);
env.addHeader(header);
}
if ( replyTo != null ) {
- header = new SOAPHeaderElement(replyTo.toDOM("wsa", WSAConstants.NS_WSA,
+ header = new SOAPHeaderElement(replyTo.toDOM("wsa", namespace,
"ReplyTo"));
header.setActor( null );
header.setMustUnderstand(mustUnderstand);
@@ -296,7 +313,7 @@
if ( relatesTo != null ) {
for ( int i = 0 ; i < relatesTo.size() ; i++ ) {
RelatesToProperty rtp = (RelatesToProperty) relatesTo.get(i);
- header = new SOAPHeaderElement( WSAConstants.NS_WSA, "RelatesTo" );
+ header = new SOAPHeaderElement( namespace, "RelatesTo" );
header.setActor( null );
if ( rtp.getType() != null && !"wsa:Reply".equals(rtp.getType()) ) {
header.setAttribute("", "RelationshipType", rtp.getType() );
@@ -308,7 +325,7 @@
}
if ( faultTo != null ) {
- header = new SOAPHeaderElement(faultTo.toDOM("wsa", WSAConstants.NS_WSA,
+ header = new SOAPHeaderElement(faultTo.toDOM("wsa", namespace,
"FaultTo"));
header.setActor( null );
header.setMustUnderstand(mustUnderstand);
@@ -353,12 +370,10 @@
relatesTo.add( new RelatesToProperty(uri, type) );
}
- /*public void addRelatesToProperty(RelatesToProperty rtp) {
- relatesTo.add(rtp);
- } */
-
public EndpointReference getTo() { return to ; }
- public void setTo(String _to) { to = EndpointReference.fromLocation(_to) ; }
+ public void setTo(String _to) {
+ to = EndpointReference.fromLocation(_to,namespace) ;
+ }
public void setTo(EndpointReference epr) { to = epr ; }
public String getAction() { return action ; }
@@ -376,10 +391,10 @@
public EndpointReference getToFault(){ return toFault ; }
public void setToFault(EndpointReference epr) {this.toFault=epr;}
- public EndpointReference getEffectiveReplyTo() {
+ public EndpointReference getEffectiveReplyTo() throws Exception {
if ( replyTo != null ) return getReplyTo();
if ( from != null ) return getFrom();
- return EndpointReference.fromLocation(WSAConstants.Anonymous_Address);
+ return EndpointReference.Anonymous( namespace );
}
}
Modified: webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/RelatesToProperty.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/RelatesToProperty.java?rev=386245&r1=386244&r2=386245&view=diff
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/RelatesToProperty.java (original)
+++ webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/RelatesToProperty.java Wed Mar 15 19:02:36 2006
@@ -15,9 +15,9 @@
this.type = type;
}
- static RelatesToProperty newInstance(Element el) {
+ static RelatesToProperty newInstance(Element el, String namespace) {
String uri = Util.getText(el);
- String type = el.getAttributeNS(WSAConstants.NS_WSA, "RelationshipType");
+ String type = el.getAttributeNS(namespace, "RelationshipType");
RelatesToProperty rp = new RelatesToProperty(uri, type);
return rp;
}
Modified: webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/WSAConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/WSAConstants.java?rev=386245&r1=386244&r2=386245&view=diff
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/WSAConstants.java (original)
+++ webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/WSAConstants.java Wed Mar 15 19:02:36 2006
@@ -3,30 +3,17 @@
import javax.xml.namespace.QName;
public interface WSAConstants {
- public final String NS_WSA = "http://schemas.xmlsoap.org/ws/2004/08/addressing";
+ public final String NS_WSA1 = "http://schemas.xmlsoap.org/ws/2004/08/addressing";
+ public final String NS_WSA2 = "http://www.w3.org/2005/08/addressing";
+ public final String NS_WSA = NS_WSA1 ;
public final String EN_EndpointReference = "EndpointReference";
- public final QName QN_EndpointReference = new QName(NS_WSA, EN_EndpointReference);
public final String EN_Address = "Address";
- public final QName QN_Address = new QName(NS_WSA, EN_Address);
-
public final String EN_ReferenceProperties = "ReferenceProperties";
- public final QName QN_ReferenceProperties = new QName(NS_WSA, EN_ReferenceProperties);
-
public final String EN_ReferenceParameters = "ReferenceParameters";
- public final QName QN_ReferenceParameters = new QName(NS_WSA, EN_ReferenceParameters);
-
public final String EN_PortType = "PortType";
- public final QName QN_PortType = new QName(NS_WSA, EN_PortType);
-
public final String EN_ServiceName = "ServiceName";
- public final QName QN_ServiceName = new QName(NS_WSA, EN_ServiceName);
-
public final String EN_Policy = "Policy";
- public final QName QN_Policy = new QName(NS_WSA, EN_Policy);
-
- public final String Anonymous_Address = NS_WSA + "/role/anonymous" ;
- public final String Fault_URI = NS_WSA + "/fault" ;
public final String OUTBOUND_MIH = "org.apache.axis.wsa.outboundMIH" ;
public final String INBOUND_MIH = "org.apache.axis.wsa.inboundMIH" ;
Modified: webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/WSAHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/WSAHandler.java?rev=386245&r1=386244&r2=386245&view=diff
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/WSAHandler.java (original)
+++ webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/wsa/WSAHandler.java Wed Mar 15 19:02:36 2006
@@ -167,7 +167,7 @@
msg = msgContext.getResponseMessage();
- if ( msg==null || to==null || to.equals(WSAConstants.Anonymous_Address) )
+ if ( msg==null || to==null || resMIH.getTo().isAnonymous() )
return ;
Vector relates = (Vector) resMIH.getRelatesTo();
@@ -203,8 +203,11 @@
static public void fixAction(MessageContext msgContext) throws Exception {
MIHeader resMI = MIHeader.fromResponse();
- if ( resMI != null )
- resMI.setAction( WSAConstants.Fault_URI );
- msgContext.setSOAPActionURI( WSAConstants.Fault_URI );
+ if ( resMI != null ) {
+ resMI.setAction( resMI.getWSAVersion() + "/fault" );
+ msgContext.setSOAPActionURI( resMI.getAction() );
+ }
+ else
+ msgContext.setSOAPActionURI( EndpointReference.staticNS + "/fault" );
}
}
Modified: webservices/axis/trunk/proposals/dug/java/test/functional/auto-deploy.wsdd
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/proposals/dug/java/test/functional/auto-deploy.wsdd?rev=386245&r1=386244&r2=386245&view=diff
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/test/functional/auto-deploy.wsdd (original)
+++ webservices/axis/trunk/proposals/dug/java/test/functional/auto-deploy.wsdd Wed Mar 15 19:02:36 2006
@@ -5,6 +5,15 @@
<globalConfiguration>
<parameter name="axis.doAutoTypes" value="true"/>
<parameter name="disablePrettyXML" value="true"/>
+ <requestFlow>
+ <handler type="java:org.apache.axis.handlers.JWSHandler">
+ <parameter name="scope" value="session"/>
+ </handler>
+ <handler type="java:org.apache.axis.handlers.JWSHandler">
+ <parameter name="scope" value="request"/>
+ <parameter name="extension" value=".jwr"/>
+ </handler>
+ </requestFlow>
</globalConfiguration>
<transport name="SimpleHTTP">