[jboss-svn-commits] JBL Code SVN: r20228 - in labs/jbosstm/workspace/adinn/wsbrew: src/org/jboss/ws/extensions/addressing/soap and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri May 30 06:25:53 EDT 2008


Author: adinn
Date: 2008-05-30 06:25:53 -0400 (Fri, 30 May 2008)
New Revision: 20228

Added:
   labs/jbosstm/workspace/adinn/wsbrew/release.diff
Modified:
   labs/jbosstm/workspace/adinn/wsbrew/src/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java
Log:
fixed some diffs from the 3.0.1 native release and added a diff file against that version to show hos this has been derived from it

Added: labs/jbosstm/workspace/adinn/wsbrew/release.diff
===================================================================
--- labs/jbosstm/workspace/adinn/wsbrew/release.diff	                        (rev 0)
+++ labs/jbosstm/workspace/adinn/wsbrew/release.diff	2008-05-30 10:25:53 UTC (rev 20228)
@@ -0,0 +1,635 @@
+# created by 
+# diff -r src/org/jboss/ws/extensions/addressing/ ~/jboss/jbossws/jbossws-3.0.1-native-2.0.4.GA/jbossws-3.0.1-native-2.0.4.GA-src/src/main/java/org/jboss/ws/extensions/addressing/ > release.diff
+
+diff -r src/org/jboss/ws/extensions/addressing/AddressingConstantsImpl.java /home/adinn/jboss/jbossws/jbossws-3.0.1-native-2.0.4.GA/jbossws-3.0.1-native-2.0.4.GA-src/src/main/java/org/jboss/ws/extensions/addressing/AddressingConstantsImpl.java
+29c29,30
+< import org.jboss.ws.extensions.addressing.util.NotImplementedException;
+---
+> import org.jboss.util.NotImplementedException;
+> import org.jboss.ws.Constants;
+41,42d41
+<    static final String NS_WSDL11 = "http://schemas.xmlsoap.org/wsdl/";
+<     static final String PREFIX_WSDL = "wsdl";
+56c55
+<       return NS_WSDL11;
+---
+>       return Constants.NS_WSDL11;
+61c60
+<       return PREFIX_WSDL;
+---
+>       return Constants.PREFIX_WSDL;
+149c148
+<    public String getIsReferenceParameterName() throws Exception
+---
+>    public String getIsReferenceParameterName()
+diff -r src/org/jboss/ws/extensions/addressing/EndpointReferenceImpl.java /home/adinn/jboss/jbossws/jbossws-3.0.1-native-2.0.4.GA/jbossws-3.0.1-native-2.0.4.GA-src/src/main/java/org/jboss/ws/extensions/addressing/EndpointReferenceImpl.java
+42c42
+< import org.jboss.ws.extensions.addressing.util.WSException;
+---
+> import org.jboss.ws.WSException;
+44,45c44,45
+< import org.jboss.ws.extensions.addressing.util.DOMUtils;
+< import org.jboss.ws.extensions.addressing.util.DOMWriter;
+---
+> import org.jboss.wsf.common.DOMUtils;
+> import org.jboss.wsf.common.DOMWriter;
+Only in /home/adinn/jboss/jbossws/jbossws-3.0.1-native-2.0.4.GA/jbossws-3.0.1-native-2.0.4.GA-src/src/main/java/org/jboss/ws/extensions/addressing/: jaxrpc
+Only in src/org/jboss/ws/extensions/addressing/jaxws: .svn
+diff -r src/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java /home/adinn/jboss/jbossws/jbossws-3.0.1-native-2.0.4.GA/jbossws-3.0.1-native-2.0.4.GA-src/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
+23a24
+> import org.jboss.logging.Logger;
+25a27,29
+> import org.jboss.ws.metadata.umdm.OperationMetaData;
+> import org.jboss.ws.core.CommonMessageContext;
+> import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
+37d40
+< import javax.xml.ws.handler.soap.SOAPHandler;
+39,40c42,43
+< import java.io.OutputStream;
+< import java.io.StringWriter;
+---
+> 
+> import java.net.URISyntaxException;
+44,45d46
+< import java.util.logging.Level;
+< import java.util.logging.Logger;
+55c56
+< public class WSAddressingClientHandler implements SOAPHandler<SOAPMessageContext>
+---
+> public class WSAddressingClientHandler extends GenericSOAPHandler
+58c59
+< 	private static Logger log = Logger.getLogger(WSAddressingClientHandler.class.getCanonicalName());
+---
+> 	private static Logger log = Logger.getLogger(WSAddressingClientHandler.class);
+78,96c79
+<     public boolean handleMessage(SOAPMessageContext msgContext)
+<     {
+<         Boolean outbound = (Boolean)msgContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+<         if (outbound == null)
+<             throw new IllegalStateException("Cannot obtain required property: " + MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+< 
+<         return outbound ? handleOutbound(msgContext) : handleInbound(msgContext);
+<     }
+< 
+<     public boolean handleFault(SOAPMessageContext msgContext)
+<     {
+<         return true;
+<     }
+< 
+<     public void close(MessageContext context)
+<     {
+<     }
+< 
+<     protected boolean handleOutbound(SOAPMessageContext msgContext)
+---
+> 	protected boolean handleOutbound(MessageContext msgContext)
+98c81
+< 		log.log(Level.INFO, "handleOutbound");
+---
+> 		log.debug("handleOutbound");
+100,117c83,113
+<         SOAPAddressingProperties addrProps = (SOAPAddressingProperties)msgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+< 		if (addrProps != null)
+< 		{
+< 			SOAPMessage soapMessage = msgContext.getMessage();
+<             addrProps.writeHeaders(soapMessage);
+< 
+<             try {
+<                 soapMessage.writeTo(System.out);
+<             } catch (Exception e) {
+<             }
+<         }
+< 		else
+< 		{
+< 			// supply default addressing properties
+< 			addrProps = (SOAPAddressingPropertiesImpl)ADDR_BUILDER.newAddressingProperties();
+< 			msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addrProps);
+< 			msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, Scope.APPLICATION);
+< 		}
+---
+>       SOAPAddressingProperties addrProps = (SOAPAddressingProperties)msgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES);
+>       if (addrProps != null)
+>       {
+>          msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addrProps);
+>          msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, Scope.APPLICATION);
+>       }
+>       
+>       addrProps = (SOAPAddressingProperties)msgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+>       if (addrProps == null)
+>       {
+>          // supply default addressing properties
+>          addrProps = (SOAPAddressingPropertiesImpl)ADDR_BUILDER.newAddressingProperties();
+>          msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addrProps);
+>          msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, Scope.APPLICATION);
+>       }
+>       
+>       if (addrProps.getAction() == null)
+>       {
+>          try
+>          {
+>             OperationMetaData opMetaData = ((CommonMessageContext)msgContext).getOperationMetaData();
+>             addrProps.setAction(ADDR_BUILDER.newURI(opMetaData.getJavaName()));
+>          }
+>          catch (URISyntaxException ex)
+>          {
+>             // ignore
+>          }
+>       }
+>       
+> 		SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+> 		addrProps.writeHeaders(soapMessage);
+122c118
+< 	protected boolean handleInbound(SOAPMessageContext msgContext)
+---
+> 	protected boolean handleInbound(MessageContext msgContext)
+124c120
+< 		log.log(Level.INFO, "handleInbound");
+---
+> 		log.debug("handleInbound");
+128c124
+< 			SOAPMessage soapMessage = msgContext.getMessage();
+---
+> 			SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+134,135c130,133
+< 				msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND, addrProps);
+< 				msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND, Scope.APPLICATION);
+---
+>             msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addrProps);
+>             msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, Scope.APPLICATION);
+>             msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND, addrProps);
+>             msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND, Scope.APPLICATION);
+145,146c143
+< 
+< }
+---
+> }
+\ No newline at end of file
+diff -r src/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java /home/adinn/jboss/jbossws/jbossws-3.0.1-native-2.0.4.GA/jbossws-3.0.1-native-2.0.4.GA-src/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
+23a24,26
+> import org.jboss.logging.Logger;
+> import org.jboss.ws.core.CommonMessageContext;
+> import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
+24a28,29
+> import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
+> import org.jboss.ws.metadata.umdm.OperationMetaData;
+28d32
+< import javax.xml.ws.BindingProvider;
+30d33
+< import javax.xml.ws.addressing.AttributedURI;
+36d38
+< import javax.xml.ws.handler.soap.SOAPHandler;
+37a40
+> import java.net.URISyntaxException;
+41,42d43
+< import java.util.logging.Level;
+< import java.util.logging.Logger;
+52c53
+< public class WSAddressingServerHandler implements SOAPHandler<SOAPMessageContext>
+---
+> public class WSAddressingServerHandler extends GenericSOAPHandler
+55c56
+< 	private static Logger log = Logger.getLogger(WSAddressingServerHandler.class.getCanonicalName());
+---
+> 	private static Logger log = Logger.getLogger(WSAddressingServerHandler.class);
+75,88c76
+<     public boolean handleMessage(SOAPMessageContext msgContext)
+<     {
+<         Boolean outbound = (Boolean)msgContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+<         if (outbound == null)
+<             throw new IllegalStateException("Cannot obtain required property: " + MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+< 
+<         return outbound ? handleOutbound(msgContext) : handleInbound(msgContext);
+<     }
+< 
+<     public void close(MessageContext context)
+<     {
+<     }
+< 
+< 	protected boolean handleInbound(SOAPMessageContext msgContext)
+---
+> 	protected boolean handleInbound(MessageContext msgContext)
+90c78
+< 		log.log(Level.INFO, "handleInbound");
+---
+> 		if(log.isDebugEnabled()) log.debug("handleInbound");
+93c81
+< 		SOAPMessage soapMessage = msgContext.getMessage();
+---
+> 		SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+97,104c85,86
+<         // use any supplied action as the value for the context's soap action property
+<         // TODO do we realy need to do this?
+<         AttributedURI action = addrProps.getAction();
+<         if (action != null) {
+<             msgContext.put(BindingProvider.SOAPACTION_USE_PROPERTY, new Boolean("true"));
+<             msgContext.put(BindingProvider.SOAPACTION_URI_PROPERTY, action.getURI().toString());
+<         }
+<         return true;
+---
+> 
+> 		return true;
+107c89
+< 	protected boolean handleOutbound(SOAPMessageContext msgContext)
+---
+> 	protected boolean handleOutbound(MessageContext msgContext)
+109c91
+< 		log.log(Level.INFO, "handleOutbound");
+---
+> 		if(log.isDebugEnabled()) log.debug("handleOutbound");
+118c100
+< 	public boolean handleFault(SOAPMessageContext msgContext)
+---
+> 	public boolean handleFault(MessageContext msgContext)
+120c102
+< 		log.log(Level.INFO, "handleFault");
+---
+> 		if(log.isDebugEnabled()) log.debug("handleFault");
+125c107
+< 	private void handleResponseOrFault(SOAPMessageContext msgContext, boolean isFault)
+---
+> 	private void handleResponseOrFault(MessageContext msgContext, boolean isFault)
+128c110
+< 		SOAPMessage soapMessage = msgContext.getMessage();
+---
+> 		SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+143,149d124
+< 
+<         try {
+<             soapMessage.writeTo(System.out);
+<         } catch (Exception e) {
+<         }
+<         /*
+<          * cannot do this bit but we don't care
+155d129
+<             msgContext.
+157c131
+<             if (!isFault && !opMetaData.isOneWay())
+---
+> 			if (!isFault && !opMetaData.isOneWay())
+181d154
+<          */
+183,184c156
+<         // don't need to do this for glassfish
+<         // outProps.writeHeaders(soapMessage);
+---
+> 		outProps.writeHeaders(soapMessage);
+diff -r src/org/jboss/ws/extensions/addressing/metadata/AddressingOpMetaExt.java /home/adinn/jboss/jbossws/jbossws-3.0.1-native-2.0.4.GA/jbossws-3.0.1-native-2.0.4.GA-src/src/main/java/org/jboss/ws/extensions/addressing/metadata/AddressingOpMetaExt.java
+26c26
+< import org.jboss.ws.extensions.addressing.util.MetaDataExtension;
+---
+> import org.jboss.ws.metadata.umdm.MetaDataExtension;
+Only in src/org/jboss/ws/extensions/addressing/metadata: .svn
+diff -r src/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java /home/adinn/jboss/jbossws/jbossws-3.0.1-native-2.0.4.GA/jbossws-3.0.1-native-2.0.4.GA-src/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java
+24c24
+< //$Id: SOAPAddressingPropertiesImpl.java 3959 2007-07-20 14:44:19Z heiko.braun at jboss.com $
+---
+> //$Id: SOAPAddressingPropertiesImpl.java 5985 2008-03-17 14:40:05Z thomas.diesler at jboss.com $
+26,36d25
+< import javax.xml.soap.*;
+< import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
+< import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
+< import org.jboss.ws.extensions.addressing.EndpointReferenceImpl;
+< import org.jboss.ws.extensions.addressing.util.DOMUtils;
+< import org.w3c.dom.Element;
+< 
+< import javax.xml.namespace.QName;
+< import javax.xml.ws.addressing.*;
+< import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
+< import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
+44a34,59
+> import javax.xml.namespace.QName;
+> import javax.xml.soap.SOAPElement;
+> import javax.xml.soap.SOAPException;
+> import javax.xml.soap.SOAPFactory;
+> import javax.xml.soap.SOAPHeader;
+> import javax.xml.soap.SOAPHeaderElement;
+> import javax.xml.soap.SOAPMessage;
+> import javax.xml.ws.addressing.AddressingConstants;
+> import javax.xml.ws.addressing.AddressingException;
+> import javax.xml.ws.addressing.AttributedURI;
+> import javax.xml.ws.addressing.ReferenceParameters;
+> import javax.xml.ws.addressing.Relationship;
+> import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
+> import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
+> 
+> import org.jboss.ws.core.soap.NameImpl;
+> import org.jboss.ws.core.soap.SOAPFactoryImpl;
+> import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
+> import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
+> import org.jboss.ws.extensions.addressing.EndpointReferenceImpl;
+> import org.jboss.wsf.common.DOMUtils;
+> import org.jboss.xb.binding.NamespaceRegistry;
+> import org.w3c.dom.Attr;
+> import org.w3c.dom.Element;
+> import org.w3c.dom.NamedNodeMap;
+> 
+58a74
+> 	private NamespaceRegistry nsRegistry = new NamespaceRegistry();
+91a108
+> 			registerNamespaces(ADDR, soapHeader);		
+182a200,219
+> 	private void registerNamespaces(AddressingConstants ADDR, SOAPHeader soapHeader)
+> 	{
+> 		// Register wsa namespace
+> 		nsRegistry.registerURI(ADDR.getNamespaceURI(), ADDR.getNamespacePrefix());
+> 
+> 		// Register namespaces
+> 		NamedNodeMap attribs = soapHeader.getAttributes();
+> 		for (int i = 0; i < attribs.getLength(); i++)
+> 		{
+> 			Attr attr = (Attr)attribs.item(i);
+> 			String attrName = attr.getName();
+> 			String attrValue = attr.getValue();
+> 			if (attrName.startsWith("xmlns:"))
+> 			{
+> 				String prefix = attrName.substring(6);
+> 				nsRegistry.registerURI(attrValue, prefix);
+> 			}
+> 		}
+> 	}
+> 
+187,194c224,227
+< 			SOAPFactory factory = (SOAPFactory)SOAPFactory.newInstance();
+< 			SOAPHeader soapHeader = message.getSOAPHeader();
+< 
+<             if (soapHeader == null) {
+<                 soapHeader = message.getSOAPPart().getEnvelope().addHeader();
+<             }
+< 
+<             // Add the xmlns:wsa declaration
+---
+> 			SOAPFactoryImpl factory = (SOAPFactoryImpl)SOAPFactory.newInstance();
+> 			SOAPHeader soapHeader = message.getSOAPHeader();					
+> 			
+> 			// Add the xmlns:wsa declaration
+196,199c229,230
+< 
+<             Iterator iter;
+< 
+<             // Write wsa:To
+---
+> 						
+> 			// Write wsa:To
+202,214c233,235
+<                 // To header may already be present -- ensure it is the same
+<                 iter = soapHeader.getChildElements(ADDR.getToQName());
+<                 if (iter.hasNext()) {
+<                     String toAddress = getTo().getURI().toString();
+<                     SOAPElement element =(SOAPElement)iter.next();
+<                     if (!element.getTextContent().equals(toAddress)) {
+<                         throw new AddressingException("Invalid To: header in addressing properties : " + toAddress);
+<                     }
+<                 } else {
+<                     SOAPElement element = soapHeader.addChildElement(ADDR.getToQName());
+<                     element.addTextNode(getTo().getURI().toString());
+<                 }
+<             }
+---
+> 				SOAPElement element = soapHeader.addChildElement(new NameImpl(ADDR.getToQName()));
+> 				element.addTextNode(getTo().getURI().toString());
+> 			}
+219,234c240,245
+<                 // From header may already be present -- ensure it is the same
+<                 iter = soapHeader.getChildElements(ADDR.getFromQName());
+<                 if (iter.hasNext()) {
+<                     String fromAddress = getFrom().getAddress().getURI().toString();
+<                     SOAPElement element =(SOAPElement)iter.next();
+<                     if (!element.getTextContent().equals(fromAddress)) {
+<                         throw new AddressingException("Invalid From: header in addressing properties : " + fromAddress);
+<                     }
+<                 } else {
+<                     EndpointReferenceImpl epr = (EndpointReferenceImpl)getFrom();
+<                     epr.setRootQName(ADDR.getFromQName());
+<                     SOAPElement soapElement = factory.createElement(epr.toElement());
+<                     soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
+<                     soapHeader.addChildElement(soapElement);
+<                 }
+<             }
+---
+> 				EndpointReferenceImpl epr = (EndpointReferenceImpl)getFrom();
+> 				epr.setRootQName(ADDR.getFromQName());
+> 				SOAPElement soapElement = factory.createElement(epr.toElement());
+> 				soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
+> 				soapHeader.addChildElement(soapElement);
+> 			}
+236c247
+<             // Write wsa:ReplyTo
+---
+> 			// Write wsa:ReplyTo
+239,254c250,255
+<                 // ReplyTo header may already be present -- ensure it is the same
+<                 iter = soapHeader.getChildElements(ADDR.getReplyToQName());
+<                 if (iter.hasNext()) {
+<                     String replyToAddress = getReplyTo().getAddress().getURI().toString();
+<                     SOAPElement element =(SOAPElement)iter.next();
+<                     if (!element.getTextContent().equals(replyToAddress)) {
+<                         throw new AddressingException("Invalid ReplyTo: header in addressing properties : " + replyToAddress);
+<                     }
+<                 } else {
+<                     EndpointReferenceImpl epr = (EndpointReferenceImpl)getReplyTo();
+<                     epr.setRootQName(ADDR.getReplyToQName());
+<                     SOAPElement soapElement = factory.createElement(epr.toElement());
+<                     soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
+<                     soapHeader.addChildElement(soapElement);
+<                 }
+<             }
+---
+> 				EndpointReferenceImpl epr = (EndpointReferenceImpl)getReplyTo();
+> 				epr.setRootQName(ADDR.getReplyToQName());
+> 				SOAPElement soapElement = factory.createElement(epr.toElement());
+> 				soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
+> 				soapHeader.addChildElement(soapElement);
+> 			}
+256c257
+<             // Write wsa:FaultTo
+---
+> 			// Write wsa:FaultTo
+259,286c260,265
+<                 // FaultTo header may already be present -- ensure it is the same
+<                 iter = soapHeader.getChildElements(ADDR.getFaultToQName());
+<                 if (iter.hasNext()) {
+<                     String faultToAddress = getReplyTo().getAddress().getURI().toString();
+<                     SOAPElement element =(SOAPElement)iter.next();
+<                     if (!element.getTextContent().equals(faultToAddress)) {
+<                         throw new AddressingException("Invalid FaultTo: header in addressing properties : " + faultToAddress);
+<                     }
+<                 } else {
+<                     EndpointReferenceImpl epr = (EndpointReferenceImpl)getFaultTo();
+<                     epr.setRootQName(ADDR.getFaultToQName());
+<                     SOAPElement soapElement = factory.createElement(epr.toElement());
+<                     soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
+<                     soapHeader.addChildElement(soapElement);
+<                 }
+<             }
+< 
+<             // Action header may already be present -- ensure it is the same
+< 			iter = soapHeader.getChildElements(ADDR.getActionQName());
+<             if (iter.hasNext()) {
+<                 String action = getAction().getURI().toString();
+<                 SOAPElement element =(SOAPElement)iter.next();
+<                 if (!element.getTextContent().equals(action)) {
+<                     throw new AddressingException("Invalid Action: header in addressing properties : " + action);
+<                 }
+<             } else {
+<                 appendRequiredHeader(soapHeader, ADDR.getActionQName(), getAction());
+<             }
+---
+> 				EndpointReferenceImpl epr = (EndpointReferenceImpl)getFaultTo();
+> 				epr.setRootQName(ADDR.getFaultToQName());
+> 				SOAPElement soapElement = factory.createElement(epr.toElement());
+> 				soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
+> 				soapHeader.addChildElement(soapElement);
+> 			}
+288c267,269
+<             // Write wsa:MessageID
+---
+> 			appendRequiredHeader(soapHeader, ADDR.getActionQName(), getAction());
+> 			
+> 			// Write wsa:MessageID
+295,303c276
+<                 // messageID header may already be present -- if so override it using the one supplied in the
+<                 // addressing properties -- we need to be able to wait on the reply using our rather than the
+<                 // one supplied by the Glassfish WS Addressing code
+<                 iter = soapHeader.getChildElements(ADDR.getMessageIDQName());
+<                 if (iter.hasNext()) {
+<                     SOAPElement element =(SOAPElement)iter.next();
+<                     soapHeader.removeChild(element);
+<                 }
+< 				SOAPElement wsaMessageId = soapHeader.addChildElement(ADDR.getMessageIDQName());
+---
+> 				SOAPElement wsaMessageId = soapHeader.addChildElement(new NameImpl(ADDR.getMessageIDQName()));
+310,343c283,292
+<                 // relatesTo header may already be present -- if so only add relationships which are not already present
+<                 for (Relationship rel : getRelatesTo())
+<                 {
+<                     boolean present = false;
+<                     String idString = rel.getID().toString();
+<                     QName type = rel.getType();
+<                     String typeName = (type == null ? "" : getQualifedName(type));
+< 
+<                     iter = soapHeader.getChildElements(ADDR.getRelatesToQName());
+<                     while (!present && iter.hasNext()) {
+<                         SOAPElement wsaRelatesTo = (SOAPElement)iter.next();
+<                         // are the relationship types are both the same
+<                         String typeName2 = wsaRelatesTo.getAttribute(ADDR.getRelationshipTypeName());
+<                         if (typeName.equals(typeName2)) {
+<                             // are the relationsip text values the same
+<                             String idString2 = wsaRelatesTo.getTextContent();
+<                             if (idString.equals(idString2)) {
+<                                 present = true;
+<                             } else {
+<                                 // duplicated type qwith different value!
+<                                 throw new AddressingException("Invalid RelatesTo:" + typeName + " header in addressing properties : " + idString);
+<                             }
+<                         }
+<                     }
+<                     if (!present) {
+<                         SOAPElement wsaRelatesTo = soapHeader.addChildElement(ADDR.getRelatesToQName());
+<                         if (type != null)
+<                         {
+<                             wsaRelatesTo.setAttribute(ADDR.getRelationshipTypeName(), getQualifedName(rel.getType()));
+<                         }
+<                         wsaRelatesTo.addTextNode(idString);
+<                     }
+<                 }
+<             }
+---
+> 				for (Relationship rel : getRelatesTo())
+> 				{
+> 					SOAPElement wsaRelatesTo = soapHeader.addChildElement(new NameImpl(ADDR.getRelatesToQName()));
+> 					if (rel.getType() != null)
+> 					{
+> 						wsaRelatesTo.setAttribute(ADDR.getRelationshipTypeName(), getQualifiedName(rel.getType()));
+> 					}
+> 					wsaRelatesTo.addTextNode(rel.getID().toString());
+> 				}
+> 			}
+346,351c295,296
+< 
+<             // hmm, we probably need to worry about duplicates here from client code but we are not using this
+<             // for the XTS code so ignore it for now
+< 
+<             ReferenceParameters refParams = getReferenceParameters();
+< 			if (refParams.getElements().size() > 0 || refParams.getAttributes().size() > 0)
+---
+> 			ReferenceParameters refParams = getReferenceParameters();
+> 			if (refParams.getElements().size() > 0)
+353,355c298,303
+< 				SOAPElement wsaRefParams = soapHeader.addChildElement(ADDR.getReferenceParametersQName());
+< 				appendAttributes(wsaRefParams, refParams.getAttributes());
+< 				appendElements(wsaRefParams, refParams.getElements());
+---
+>             for (Object obj : refParams.getElements())
+>             {
+>                SOAPElement refElement = appendElement(soapHeader, obj);
+>                QName refQName = new QName(ADDR.getNamespaceURI(), "IsReferenceParameter", ADDR.getNamespacePrefix());
+>                refElement.addAttribute(refQName, "true");
+>             }
+371c319
+< 		SOAPElement element = soapHeader.addChildElement(name);
+---
+> 		SOAPElement element = soapHeader.addChildElement(new NameImpl(name));
+392c340
+< 			String qualname = getQualifedName(qname);
+---
+> 			String qualname = getQualifiedName(qname);
+402d349
+< 			SOAPFactory factory = (SOAPFactory)SOAPFactory.newInstance();
+405,419c352
+< 				if (obj instanceof Element)
+< 				{
+< 					SOAPElement child = factory.createElement((Element)obj);
+< 					soapElement.addChildElement(child);
+< 				}
+< 				else if (obj instanceof String)
+< 				{
+< 					Element el = DOMUtils.parse((String)obj);
+< 					SOAPElement child = factory.createElement(el);
+< 					soapElement.addChildElement(child);
+< 				}
+< 				else
+< 				{
+< 					throw new AddressingException("Unsupported element: " + obj.getClass().getName());
+< 				}
+---
+> 				appendElement(soapElement, obj);
+432c365,398
+<     private String getQualifedName(QName qname)
+---
+>    private SOAPElement appendElement(SOAPElement soapElement, Object obj) 
+>    {
+>       SOAPElement child = null;
+>       try
+>       {
+>          SOAPFactoryImpl factory = (SOAPFactoryImpl)SOAPFactory.newInstance();
+>          if (obj instanceof Element)
+>          {
+>             child = factory.createElement((Element)obj);
+>             soapElement.addChildElement(child);
+>          }
+>          else if (obj instanceof String)
+>          {
+>             Element el = DOMUtils.parse((String)obj);
+>             child = factory.createElement(el);
+>             soapElement.addChildElement(child);
+>          }
+>          else
+>          {
+>             throw new AddressingException("Unsupported element: " + obj.getClass().getName());
+>          }
+>          return child;
+>       }
+>       catch (RuntimeException rte)
+>       {
+>          throw rte;
+>       }
+>       catch (Exception ex)
+>       {
+>          throw new AddressingException("Cannot append elements", ex);
+>       }
+>    }
+> 
+> 	private String getQualifiedName(QName qname)
+Only in src/org/jboss/ws/extensions/addressing/soap: .svn
+Only in src/org/jboss/ws/extensions/addressing/: .svn
+Only in src/org/jboss/ws/extensions/addressing/: util

Modified: labs/jbosstm/workspace/adinn/wsbrew/src/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/wsbrew/src/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java	2008-05-30 09:39:20 UTC (rev 20227)
+++ labs/jbosstm/workspace/adinn/wsbrew/src/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java	2008-05-30 10:25:53 UTC (rev 20228)
@@ -28,9 +28,7 @@
 import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
 import org.jboss.ws.extensions.addressing.EndpointReferenceImpl;
 import org.jboss.ws.extensions.addressing.util.DOMUtils;
-import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
 
 import javax.xml.namespace.QName;
 import javax.xml.ws.addressing.*;
@@ -106,7 +104,7 @@
 			if (wsaFrom != null)
 			{
 				EndpointReferenceImpl ref = new EndpointReferenceImpl(wsaFrom);
-				setReplyTo(ref);
+				setFrom(ref);
 			}
 
 			// Read wsa:ReplyTo
@@ -315,7 +313,7 @@
                     boolean present = false;
                     String idString = rel.getID().toString();
                     QName type = rel.getType();
-                    String typeName = (type == null ? "" : getPrefixedName(type));
+                    String typeName = (type == null ? "" : getQualifedName(type));
 
                     iter = soapHeader.getChildElements(ADDR.getRelatesToQName());
                     while (!present && iter.hasNext()) {
@@ -337,7 +335,7 @@
                         SOAPElement wsaRelatesTo = soapHeader.addChildElement(ADDR.getRelatesToQName());
                         if (type != null)
                         {
-                            wsaRelatesTo.setAttribute(ADDR.getRelationshipTypeName(), getPrefixedName(rel.getType()));
+                            wsaRelatesTo.setAttribute(ADDR.getRelationshipTypeName(), getQualifedName(rel.getType()));
                         }
                         wsaRelatesTo.addTextNode(idString);
                     }
@@ -391,7 +389,7 @@
 	{
 		for (QName qname : attributes.keySet())
 		{
-			String qualname = getPrefixedName(qname);
+			String qualname = getQualifedName(qname);
 			String value = attributes.get(qname);
 			soapElement.setAttribute(qualname, value);
 		}
@@ -431,7 +429,7 @@
 		}
 	}
 
-	private String getPrefixedName(QName qname)
+    private String getQualifedName(QName qname)
 	{
 		String prefix = qname.getPrefix();
 		String localPart = qname.getLocalPart();




More information about the jboss-svn-commits mailing list