### Eclipse Workspace Patch 1.0 #P jax-ws-21-ri-cvs Index: rt/src/com/sun/xml/ws/message/AbstractMessageImpl.java =================================================================== RCS file: /cvs/jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/message/Attic/AbstractMessageImpl.java,v retrieving revision 1.1.2.7.2.3 diff -u -r1.1.2.7.2.3 AbstractMessageImpl.java --- rt/src/com/sun/xml/ws/message/AbstractMessageImpl.java 12 Jan 2007 02:12:50 -0000 1.1.2.7.2.3 +++ rt/src/com/sun/xml/ws/message/AbstractMessageImpl.java 12 Jan 2007 05:18:28 -0000 @@ -25,6 +25,7 @@ import com.sun.xml.bind.marshaller.SAX2DOMEx; import com.sun.xml.ws.api.SOAPVersion; import com.sun.xml.ws.api.message.Attachment; +import com.sun.xml.ws.api.message.Header; import com.sun.xml.ws.api.message.HeaderList; import com.sun.xml.ws.api.message.Message; import com.sun.xml.ws.api.message.Packet; @@ -114,8 +115,16 @@ w.writeStartElement("S","Envelope",soapNsUri); w.writeNamespace("S",soapNsUri); if(hasHeaders()) { - w.writeStartElement("S","Header",soapNsUri); HeaderList headers = getHeaders(); + for (Header header : headers) { + if (header.getPrefix() != null && !header.getPrefix().equals("") + && !Util.isPrefixDeclared(w, header.getPrefix(), header.getNamespaceURI())) { + w.setPrefix(header.getPrefix(), header.getNamespaceURI()); + w.writeNamespace(header.getPrefix(),header.getNamespaceURI()); + } + } + + w.writeStartElement("S","Header",soapNsUri); int len = headers.size(); for( int i=0; i attributes; - OutboundReferenceParameterHeader(XMLStreamBuffer infoset, String nsUri, String localName) { + OutboundReferenceParameterHeader(XMLStreamBuffer infoset, String nsUri, String localName, String prefix) { this.infoset = infoset; this.nsUri = nsUri; this.localName = localName; + this.prefix = prefix; } public @NotNull String getNamespaceURI() { @@ -60,6 +61,10 @@ public @NotNull String getLocalPart() { return localName; + } + + public @NotNull String getPrefix() { + return prefix; } public String getAttribute(String nsUri, String localName) { Index: rt/src/com/sun/xml/ws/api/addressing/AddressingVersion.java =================================================================== RCS file: /cvs/jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/api/addressing/Attic/AddressingVersion.java,v retrieving revision 1.1.2.60 diff -u -r1.1.2.60 AddressingVersion.java --- rt/src/com/sun/xml/ws/api/addressing/AddressingVersion.java 4 Jan 2007 19:10:07 -0000 1.1.2.60 +++ rt/src/com/sun/xml/ws/api/addressing/AddressingVersion.java 12 Jan 2007 05:18:27 -0000 @@ -62,7 +62,7 @@ "ServiceName", "EndpointName", "InterfaceName", - new QName("http://www.w3.org/2005/08/addressing","Metadata"), + new QName("http://www.w3.org/2005/08/addressing","Metadata", "wsa"), "ReferenceParameters", null )) { @Override @@ -100,8 +100,8 @@ return "InvalidCardinality"; } - /*package*/ Header createReferenceParameterHeader(XMLStreamBuffer mark, String nsUri, String localName) { - return new OutboundReferenceParameterHeader(mark,nsUri,localName); + /*package*/ Header createReferenceParameterHeader(XMLStreamBuffer mark, String nsUri, String localName, String prefix) { + return new OutboundReferenceParameterHeader(mark,nsUri,localName,prefix); } /*package*/ String getIsReferenceParameterLocalName() { @@ -173,8 +173,8 @@ return getInvalidMapLocalName(); } - /*package*/ Header createReferenceParameterHeader(XMLStreamBuffer mark, String nsUri, String localName) { - return new OutboundStreamHeader(mark,nsUri,localName); + /*package*/ Header createReferenceParameterHeader(XMLStreamBuffer mark, String nsUri, String localName, String prefix) { + return new OutboundStreamHeader(mark,nsUri,localName,prefix); } /*package*/ String getIsReferenceParameterLocalName() { @@ -363,30 +363,30 @@ this.policyNsUri = policyNsUri; this.anonymousUri = anonymousUri; this.noneUri = noneUri; - toTag = new QName(nsUri,"To"); - fromTag = new QName(nsUri,"From"); - replyToTag = new QName(nsUri,"ReplyTo"); - faultToTag = new QName(nsUri,"FaultTo"); - actionTag = new QName(nsUri,"Action"); - messageIDTag = new QName(nsUri,"MessageID"); - relatesToTag = new QName(nsUri,"RelatesTo"); + toTag = new QName(nsUri,"To",getPrefix()); + fromTag = new QName(nsUri,"From",getPrefix()); + replyToTag = new QName(nsUri,"ReplyTo",getPrefix()); + faultToTag = new QName(nsUri,"FaultTo",getPrefix()); + actionTag = new QName(nsUri,"Action",getPrefix()); + messageIDTag = new QName(nsUri,"MessageID",getPrefix()); + relatesToTag = new QName(nsUri,"RelatesTo",getPrefix()); - mapRequiredTag = new QName(nsUri,getMapRequiredLocalName()); - actionNotSupportedTag = new QName(nsUri,"ActionNotSupported"); + mapRequiredTag = new QName(nsUri,getMapRequiredLocalName(),getPrefix()); + actionNotSupportedTag = new QName(nsUri,"ActionNotSupported",getPrefix()); actionNotSupportedText = "The \"%s\" cannot be processed at the receiver"; - invalidMapTag = new QName(nsUri,getInvalidMapLocalName()); - invalidCardinalityTag = new QName(nsUri,getInvalidCardinalityLocalName()); - faultDetailTag = new QName(nsUri,"FaultDetail"); - - problemHeaderQNameTag = new QName(nsUri,"ProblemHeaderQName"); - problemActionTag = new QName(nsUri, "ProblemAction"); - - fault_missingAddressInEpr = new QName(nsUri,"MissingAddressInEPR","wsa"); - isReferenceParameterTag = new QName(nsUri,getIsReferenceParameterLocalName()); - - wsdlActionTag = new QName(wsdlNsUri,"Action"); - wsdlExtensionTag = new QName(wsdlNsUri, "UsingAddressing"); - wsdlAnonymousTag = new QName(wsdlNsUri, getWsdlAnonymousLocalName()); + invalidMapTag = new QName(nsUri,getInvalidMapLocalName(),getPrefix()); + invalidCardinalityTag = new QName(nsUri,getInvalidCardinalityLocalName(),getPrefix()); + faultDetailTag = new QName(nsUri,"FaultDetail",getPrefix()); + + problemHeaderQNameTag = new QName(nsUri,"ProblemHeaderQName",getPrefix()); + problemActionTag = new QName(nsUri, "ProblemAction",getPrefix()); + + fault_missingAddressInEpr = new QName(nsUri,"MissingAddressInEPR",getPrefix()); + isReferenceParameterTag = new QName(nsUri,getIsReferenceParameterLocalName(),getPrefix()); + + wsdlActionTag = new QName(wsdlNsUri,"Action",getWsdlPrefix()); + wsdlExtensionTag = new QName(wsdlNsUri, "UsingAddressing",getWsdlPrefix()); + wsdlAnonymousTag = new QName(wsdlNsUri, getWsdlAnonymousLocalName(),getWsdlPrefix()); // create stock anonymous EPR try { @@ -566,7 +566,7 @@ /** * Creates an outbound {@link Header} from a reference parameter. */ - /*package*/ abstract Header createReferenceParameterHeader(XMLStreamBuffer mark, String nsUri, String localName); + /*package*/ abstract Header createReferenceParameterHeader(XMLStreamBuffer mark, String nsUri, String localName, String prefix); /** * Gets the local name for wsa:IsReferenceParameter. This method will return a valid Index: rt/src/com/sun/xml/ws/addressing/W3CAddressingConstants.java =================================================================== RCS file: /cvs/jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/addressing/Attic/W3CAddressingConstants.java,v retrieving revision 1.1.2.6 diff -u -r1.1.2.6 W3CAddressingConstants.java --- rt/src/com/sun/xml/ws/addressing/W3CAddressingConstants.java 26 Oct 2006 22:35:43 -0000 1.1.2.6 +++ rt/src/com/sun/xml/ws/addressing/W3CAddressingConstants.java 12 Jan 2007 05:18:26 -0000 @@ -32,6 +32,7 @@ * @author Arun Gupta */ public interface W3CAddressingConstants { + public static final String WSA_PREFIX = "wsa"; public static final String WSA_NAMESPACE_NAME = "http://www.w3.org/2005/08/addressing"; public static final String WSA_NAMESPACE_WSDL_NAME = "http://www.w3.org/2006/05/addressing/wsdl"; @@ -40,16 +41,16 @@ public static final String WSAW_ENDPOINTNAME_NAME = "EndpointName"; public static final String WSA_REFERENCEPROPERTIES_NAME = "ReferenceParameters"; - public static final QName WSA_REFERENCEPROPERTIES_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_REFERENCEPROPERTIES_NAME); + public static final QName WSA_REFERENCEPROPERTIES_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_REFERENCEPROPERTIES_NAME, WSA_PREFIX); public static final String WSA_REFERENCEPARAMETERS_NAME = "ReferenceParameters"; - public static final QName WSA_REFERENCEPARAMETERS_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_REFERENCEPARAMETERS_NAME); + public static final QName WSA_REFERENCEPARAMETERS_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_REFERENCEPARAMETERS_NAME, WSA_PREFIX); public static final String WSA_METADATA_NAME = "Metadata"; - public static final QName WSA_METADATA_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_METADATA_NAME); + public static final QName WSA_METADATA_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_METADATA_NAME, WSA_PREFIX); public static final String WSA_ADDRESS_NAME = "Address"; - public static final QName WSA_ADDRESS_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_ADDRESS_NAME); + public static final QName WSA_ADDRESS_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_ADDRESS_NAME, WSA_PREFIX); public static final String WSA_ANONYMOUS_ADDRESS = WSA_NAMESPACE_NAME + "/anonymous"; public static final String WSA_NONE_ADDRESS = WSA_NAMESPACE_NAME + "/none"; @@ -57,13 +58,13 @@ public static final String WSA_DEFAULT_FAULT_ACTION = WSA_NAMESPACE_NAME + "/fault"; public static final String WSAW_USING_ADDRESSING_NAME = "UsingAddressing"; - public static final QName WSAW_USING_ADDRESSING_QNAME = new QName(WSA_NAMESPACE_WSDL_NAME, WSAW_USING_ADDRESSING_NAME); + public static final QName WSAW_USING_ADDRESSING_QNAME = new QName(WSA_NAMESPACE_WSDL_NAME, WSAW_USING_ADDRESSING_NAME, AddressingVersion.W3C.getWsdlPrefix()); - public static final QName INVALID_MAP_QNAME = new QName(WSA_NAMESPACE_NAME, "InvalidAddressingHeader"); - public static final QName MAP_REQUIRED_QNAME = new QName(WSA_NAMESPACE_NAME, "MessageAddressingHeaderRequired"); - public static final QName DESTINATION_UNREACHABLE_QNAME = new QName(WSA_NAMESPACE_NAME, "DestinationUnreachable"); - public static final QName ACTION_NOT_SUPPORTED_QNAME = new QName(WSA_NAMESPACE_NAME, "ActionNotSupported"); - public static final QName ENDPOINT_UNAVAILABLE_QNAME = new QName(WSA_NAMESPACE_NAME, "EndpointUnavailable"); + public static final QName INVALID_MAP_QNAME = new QName(WSA_NAMESPACE_NAME, "InvalidAddressingHeader", WSA_PREFIX); + public static final QName MAP_REQUIRED_QNAME = new QName(WSA_NAMESPACE_NAME, "MessageAddressingHeaderRequired", WSA_PREFIX); + public static final QName DESTINATION_UNREACHABLE_QNAME = new QName(WSA_NAMESPACE_NAME, "DestinationUnreachable", WSA_PREFIX); + public static final QName ACTION_NOT_SUPPORTED_QNAME = new QName(WSA_NAMESPACE_NAME, "ActionNotSupported", WSA_PREFIX); + public static final QName ENDPOINT_UNAVAILABLE_QNAME = new QName(WSA_NAMESPACE_NAME, "EndpointUnavailable", WSA_PREFIX); public static final String ACTION_NOT_SUPPORTED_TEXT = "The \"%s\" cannot be processed at the receiver"; public static final String DESTINATION_UNREACHABLE_TEXT = "No route can be determined to reach %s"; @@ -71,42 +72,35 @@ public static final String INVALID_MAP_TEXT = "A header representing a Message Addressing Property is not valid and the message cannot be processed"; public static final String MAP_REQUIRED_TEXT = "A required header representing a Message Addressing Property is not present"; - public static final QName PROBLEM_ACTION_QNAME = new QName(WSA_NAMESPACE_NAME, "ProblemAction"); - public static final QName PROBLEM_HEADER_QNAME_QNAME = new QName(WSA_NAMESPACE_NAME, "ProblemHeaderQName"); - public static final QName FAULT_DETAIL_QNAME = new QName(WSA_NAMESPACE_NAME, "FaultDetail"); + public static final QName PROBLEM_ACTION_QNAME = new QName(WSA_NAMESPACE_NAME, "ProblemAction", WSA_PREFIX); + public static final QName PROBLEM_HEADER_QNAME_QNAME = new QName(WSA_NAMESPACE_NAME, "ProblemHeaderQName", WSA_PREFIX); + public static final QName FAULT_DETAIL_QNAME = new QName(WSA_NAMESPACE_NAME, "FaultDetail", WSA_PREFIX); // Fault subsubcode when an invalid address is specified. - public static final QName INVALID_ADDRESS_SUBCODE = new QName(WSA_NAMESPACE_NAME, "InvalidAddress", - AddressingVersion.W3C.getPrefix()); + public static final QName INVALID_ADDRESS_SUBCODE = new QName(WSA_NAMESPACE_NAME, "InvalidAddress", WSA_PREFIX); // Fault subsubcode when an invalid header was expected to be EndpointReference but was not valid. - public static final QName INVALID_EPR = new QName(WSA_NAMESPACE_NAME, "InvalidEPR", AddressingVersion.W3C.getPrefix()); + public static final QName INVALID_EPR = new QName(WSA_NAMESPACE_NAME, "InvalidEPR", WSA_PREFIX); // Fault subsubcode when greater than expected number of the specified header is received. - public static final QName INVALID_CARDINALITY = new QName(WSA_NAMESPACE_NAME, "InvalidCardinality", - AddressingVersion.W3C.getPrefix()); + public static final QName INVALID_CARDINALITY = new QName(WSA_NAMESPACE_NAME, "InvalidCardinality", WSA_PREFIX); // Fault subsubcode when an invalid header was expected to be EndpointReference but did not contain address. - public static final QName MISSING_ADDRESS_IN_EPR = new QName(WSA_NAMESPACE_NAME, "MissingAddressInEPR", - AddressingVersion.W3C.getPrefix()); + public static final QName MISSING_ADDRESS_IN_EPR = new QName(WSA_NAMESPACE_NAME, "MissingAddressInEPR", WSA_PREFIX); // Fault subsubcode when a header contains a message id that was a duplicate of one already received. - public static final QName DUPLICATE_MESSAGEID = new QName(WSA_NAMESPACE_NAME, "DuplicateMessageID", - AddressingVersion.W3C.getPrefix()); + public static final QName DUPLICATE_MESSAGEID = new QName(WSA_NAMESPACE_NAME, "DuplicateMessageID", WSA_PREFIX); // Fault subsubcode when Action and SOAPAction for the mesage did not match. - public static final QName ACTION_MISMATCH = new QName(WSA_NAMESPACE_NAME, "ActionMismatch", - AddressingVersion.W3C.getPrefix()); + public static final QName ACTION_MISMATCH = new QName(WSA_NAMESPACE_NAME, "ActionMismatch", WSA_PREFIX); // Fault subsubcode when the only address supported is the anonymous address. - public static final QName ONLY_ANONYMOUS_ADDRESS_SUPPORTED = new QName(WSA_NAMESPACE_NAME, "OnlyAnonymousAddressSupported", - AddressingVersion.W3C.getPrefix()); + public static final QName ONLY_ANONYMOUS_ADDRESS_SUPPORTED = new QName(WSA_NAMESPACE_NAME, "OnlyAnonymousAddressSupported", WSA_PREFIX); //Fault subsubcode when anonymous address is not supported. - public static final QName ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED = new QName(WSA_NAMESPACE_NAME, "OnlyNonAnonymousAddressSupported", - AddressingVersion.W3C.getPrefix()); + public static final QName ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED = new QName(WSA_NAMESPACE_NAME, "OnlyNonAnonymousAddressSupported", WSA_PREFIX); - public static final String ANONYMOUS_EPR = "\n" + - "
http://www.w3.org/2005/08/addressing/anonymous
\n" + - "
"; + public static final String ANONYMOUS_EPR = "\n" + + " http://www.w3.org/2005/08/addressing/anonymous\n" + + ""; } Index: rt/src/com/sun/xml/ws/addressing/v200408/MemberSubmissionAddressingConstants.java =================================================================== RCS file: /cvs/jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/addressing/v200408/Attic/MemberSubmissionAddressingConstants.java,v retrieving revision 1.1.2.9 diff -u -r1.1.2.9 MemberSubmissionAddressingConstants.java --- rt/src/com/sun/xml/ws/addressing/v200408/MemberSubmissionAddressingConstants.java 3 Nov 2006 03:54:51 -0000 1.1.2.9 +++ rt/src/com/sun/xml/ws/addressing/v200408/MemberSubmissionAddressingConstants.java 12 Jan 2007 05:18:27 -0000 @@ -24,12 +24,15 @@ import javax.xml.namespace.QName; +import com.sun.xml.ws.api.addressing.AddressingVersion; + /** * Constants for Member Submission WS-Addressing version * * @author Arun Gupta */ public interface MemberSubmissionAddressingConstants { + public static final String WSA_PREFIX = "wsa"; public static final String WSA_NAMESPACE_NAME = "http://schemas.xmlsoap.org/ws/2004/08/addressing"; public static final String WSA_NAMESPACE_WSDL_NAME = WSA_NAMESPACE_NAME; public static final String WSA_NAMESPACE_POLICY_NAME = "http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"; @@ -39,18 +42,18 @@ public static final String WSA_PORTNAME_NAME = "PortName"; public static final String WSA_ADDRESS_NAME = "Address"; - public static final QName WSA_ADDRESS_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_ADDRESS_NAME); + public static final QName WSA_ADDRESS_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_ADDRESS_NAME, WSA_PREFIX); public static final String WSA_ANONYMOUS_ADDRESS = WSA_NAMESPACE_NAME + "/role/anonymous"; public static final String WSA_NONE_ADDRESS = ""; public static final String WSA_DEFAULT_FAULT_ACTION = WSA_NAMESPACE_NAME + "/fault"; - public static final QName INVALID_MAP_QNAME = new QName(WSA_NAMESPACE_NAME, "InvalidMessageInformationHeader"); - public static final QName MAP_REQUIRED_QNAME = new QName(WSA_NAMESPACE_NAME, "MessageInformationHeaderRequired"); - public static final QName DESTINATION_UNREACHABLE_QNAME = new QName(WSA_NAMESPACE_NAME, "DestinationUnreachable"); - public static final QName ACTION_NOT_SUPPORTED_QNAME = new QName(WSA_NAMESPACE_NAME, "ActionNotSupported"); - public static final QName ENDPOINT_UNAVAILABLE_QNAME = new QName(WSA_NAMESPACE_NAME, "EndpointUnavailable"); + public static final QName INVALID_MAP_QNAME = new QName(WSA_NAMESPACE_NAME, "InvalidMessageInformationHeader", WSA_PREFIX); + public static final QName MAP_REQUIRED_QNAME = new QName(WSA_NAMESPACE_NAME, "MessageInformationHeaderRequired", WSA_PREFIX); + public static final QName DESTINATION_UNREACHABLE_QNAME = new QName(WSA_NAMESPACE_NAME, "DestinationUnreachable", WSA_PREFIX); + public static final QName ACTION_NOT_SUPPORTED_QNAME = new QName(WSA_NAMESPACE_NAME, "ActionNotSupported", WSA_PREFIX); + public static final QName ENDPOINT_UNAVAILABLE_QNAME = new QName(WSA_NAMESPACE_NAME, "EndpointUnavailable", WSA_PREFIX); public static final String ACTION_NOT_SUPPORTED_TEXT = "The \"%s\" cannot be processed at the receiver."; public static final String DESTINATION_UNREACHABLE_TEXT = "No route can be determined to reach the destination role defined by the WS-Addressing To."; @@ -58,14 +61,14 @@ public static final String INVALID_MAP_TEXT = "A message information header is not valid and the message cannot be processed."; public static final String MAP_REQUIRED_TEXT = "A required message information header, To, MessageID, or Action, is not present."; - public static final QName PROBLEM_ACTION_QNAME = new QName(WSA_NAMESPACE_NAME, "ProblemAction"); - public static final QName PROBLEM_HEADER_QNAME_QNAME = new QName(WSA_NAMESPACE_NAME, "ProblemHeaderQName"); - public static final QName FAULT_DETAIL_QNAME = new QName(WSA_NAMESPACE_NAME, "FaultDetail"); + public static final QName PROBLEM_ACTION_QNAME = new QName(WSA_NAMESPACE_NAME, "ProblemAction", WSA_PREFIX); + public static final QName PROBLEM_HEADER_QNAME_QNAME = new QName(WSA_NAMESPACE_NAME, "ProblemHeaderQName", WSA_PREFIX); + public static final QName FAULT_DETAIL_QNAME = new QName(WSA_NAMESPACE_NAME, "FaultDetail", WSA_PREFIX); public - static final String ANONYMOUS_EPR = "\n"+ - "
http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
\n"+ - "
"; + static final String ANONYMOUS_EPR = "\n"+ + " http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous\n"+ + ""; public static final QName MEX_METADATA = new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "Metadata","mex"); public static final QName MEX_METADATA_SECTION = new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "MetadataSection","mex"); Index: rt/src/com/sun/xml/ws/api/message/Header.java =================================================================== RCS file: /cvs/jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/api/message/Attic/Header.java,v retrieving revision 1.1.2.8.2.9 diff -u -r1.1.2.8.2.9 Header.java --- rt/src/com/sun/xml/ws/api/message/Header.java 11 Jan 2007 02:25:06 -0000 1.1.2.8.2.9 +++ rt/src/com/sun/xml/ws/api/message/Header.java 12 Jan 2007 05:18:28 -0000 @@ -172,6 +172,14 @@ * this string must be interned. */ public @NotNull String getLocalPart(); + + /** + * Gets the prefix of this header element. + * + * @return + * this string must be interned. + */ + public String getPrefix(); /** * Gets the attribute value on the header element. Index: rt/src/com/sun/xml/ws/message/stream/OutboundStreamHeader.java =================================================================== RCS file: /cvs/jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/message/stream/Attic/OutboundStreamHeader.java,v retrieving revision 1.1.2.3 diff -u -r1.1.2.3 OutboundStreamHeader.java --- rt/src/com/sun/xml/ws/message/stream/OutboundStreamHeader.java 11 Jan 2007 01:12:29 -0000 1.1.2.3 +++ rt/src/com/sun/xml/ws/message/stream/OutboundStreamHeader.java 12 Jan 2007 05:18:28 -0000 @@ -28,7 +28,7 @@ */ public final class OutboundStreamHeader extends AbstractHeaderImpl { private final XMLStreamBuffer infoset; - private final String nsUri,localName; + private final String nsUri,localName,prefix; /** * The attributes on the header element. @@ -37,10 +37,11 @@ */ private FinalArrayList attributes; - public OutboundStreamHeader(XMLStreamBuffer infoset, String nsUri, String localName) { + public OutboundStreamHeader(XMLStreamBuffer infoset, String nsUri, String localName, String prefix) { this.infoset = infoset; this.nsUri = nsUri; this.localName = localName; + this.prefix = prefix; } public @NotNull String getNamespaceURI() { @@ -49,6 +50,10 @@ public @NotNull String getLocalPart() { return localName; + } + + public @NotNull String getPrefix() { + return prefix; } public String getAttribute(String nsUri, String localName) { Index: rt/src/com/sun/xml/ws/message/stream/StreamHeader.java =================================================================== RCS file: /cvs/jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/message/stream/Attic/StreamHeader.java,v retrieving revision 1.1.2.2.2.7 diff -u -r1.1.2.2.2.7 StreamHeader.java --- rt/src/com/sun/xml/ws/message/stream/StreamHeader.java 5 Dec 2006 20:34:55 -0000 1.1.2.2.2.7 +++ rt/src/com/sun/xml/ws/message/stream/StreamHeader.java 12 Jan 2007 05:18:28 -0000 @@ -68,6 +68,8 @@ protected String _namespaceURI; + protected String _prefix; + /** * Keep the information about an attribute on the header element. * @@ -112,6 +114,7 @@ _mark = mark; _localName = reader.getLocalName(); _namespaceURI = reader.getNamespaceURI(); + _prefix = reader.getPrefix(); attributes = processHeaderAttributes(reader); } @@ -157,6 +160,10 @@ public @NotNull String getLocalPart() { return _localName; + } + + public @NotNull String getPrefix() { + return _prefix; } public String getAttribute(String nsUri, String localName) { Index: rt/src/com/sun/xml/ws/message/jaxb/JAXBHeader.java =================================================================== RCS file: /cvs/jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/message/jaxb/Attic/JAXBHeader.java,v retrieving revision 1.1.2.2.2.1 diff -u -r1.1.2.2.2.1 JAXBHeader.java --- rt/src/com/sun/xml/ws/message/jaxb/JAXBHeader.java 16 Oct 2006 23:04:43 -0000 1.1.2.2.2.1 +++ rt/src/com/sun/xml/ws/message/jaxb/JAXBHeader.java 12 Jan 2007 05:18:28 -0000 @@ -66,6 +66,7 @@ // information about this header. lazily obtained. private String nsUri; private String localName; + private String prefix; private Attributes atts; /** @@ -82,6 +83,7 @@ JAXBElement e = (JAXBElement) jaxbObject; this.nsUri = e.getName().getNamespaceURI(); this.localName = e.getName().getLocalPart(); + this.prefix = e.getName().getPrefix(); } } @@ -92,6 +94,7 @@ QName tagName = bridge.getTypeReference().tagName; this.nsUri = tagName.getNamespaceURI(); this.localName = tagName.getLocalPart(); + this.prefix = tagName.getPrefix(); } /** @@ -110,6 +113,10 @@ // an error right now. nsUri = sniffer.getNsUri(); localName = sniffer.getLocalName(); + if (sniffer.getQName() != null && sniffer.getQName().indexOf(":") > 0) { + String qName = sniffer.getQName(); + prefix = qName.substring(0, qName.indexOf(":")); + } atts = sniffer.getAttributes(); } } @@ -125,6 +132,12 @@ if(localName==null) parse(); return localName; + } + + public String getPrefix() { + if(prefix==null) + parse(); + return prefix; } public String getAttribute(String nsUri, String localName) {