Author: scheu Date: Wed Jan 9 12:34:02 2008 New Revision: 610550 URL: http://svn.apache.org/viewvc?rev=610550&view=rev Log: AXIS2-3434 Contributor:Rich Scheuerle Corrected error finding MTOM Attachment during JAXB Unmarshalling.
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentUnmarshaller.java webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/attachments/JAXBAttachmentUnmarshaller.java webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentUnmarshaller.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentUnmarshaller.java?rev=610550&r1=610549&r2=610550&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentUnmarshaller.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentUnmarshaller.java Wed Jan 9 12:34:02 2008 @@ -149,8 +149,13 @@ } protected DataHandler getDataHandler(String cid) { + String blobcid = cid; + if (blobcid.startsWith("cid:")) { + blobcid = blobcid.substring(4); + } + // Get the attachment from the messagecontext using the blob cid if (msgContext != null) { - return msgContext.getAttachment(cid); + return msgContext.getAttachment(blobcid); } return null; } Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/attachments/JAXBAttachmentUnmarshaller.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/attachments/JAXBAttachmentUnmarshaller.java?rev=610550&r1=610549&r2=610550&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/attachments/JAXBAttachmentUnmarshaller.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/attachments/JAXBAttachmentUnmarshaller.java Wed Jan 9 12:34:02 2008 @@ -19,8 +19,6 @@ package org.apache.axis2.jaxws.message.attachments; import org.apache.axis2.jaxws.message.Message; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import javax.activation.DataHandler; @@ -40,8 +38,10 @@ } protected DataHandler getDataHandler(String cid) { + + // Get the attachment from the message using the cid if (message != null) { - return super.getDataHandler(cid); + return message.getDataHandler(cid); } return null; } Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java?rev=610550&r1=610549&r2=610550&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java Wed Jan 9 12:34:02 2008 @@ -87,10 +87,12 @@ this.message = message; } + @Override protected AttachmentMarshaller createAttachmentMarshaller(XMLStreamWriter writer) { return new JAXBAttachmentMarshaller(getMessage(), writer); } + @Override protected AttachmentUnmarshaller createAttachmentUnmarshaller() { return new JAXBAttachmentUnmarshaller(getMessage()); } Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java?rev=610550&r1=610549&r2=610550&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java (original) +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java Wed Jan 9 12:34:02 2008 @@ -1626,7 +1626,7 @@ * if SOAP with Attachments is enabled. * * @param contentID : - * will be the content ID of the MIME part + * will be the content ID of the MIME part (without the "cid:" prefix) * @param dataHandler */ public void addAttachment(String contentID, DataHandler dataHandler) { @@ -1656,7 +1656,7 @@ * content ID. Returns "NULL" if a attachment cannot be found by the given content ID. * * @param contentID : - * Content ID of the MIME attachment + * Content ID of the MIME attachment (without the "cid:" prefix) * @return Data handler of the attachment */ public DataHandler getAttachment(String contentID) { @@ -1670,7 +1670,7 @@ * Removes the attachment with the given content ID from the Attachments Map * Do nothing if a attachment cannot be found by the given content ID. * - * @param contentID of the attachment + * @param contentID of the attachment (without the "cid:" prefix) */ public void removeAttachment(String contentID) { if (attachments != null) { Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties?rev=610550&r1=610549&r2=610550&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties (original) +++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties Wed Jan 9 12:34:02 2008 @@ -281,4 +281,4 @@ pDescrErr=Null Descriptor. PropertyDescriptor not found. pDescrErr2=No read Method found to read property Value from jaxbObject: {0} restWithSOAPErr=Expected an XML over HTTP message, but the message appears to be a SOAP message. The namespace is {0} -noDataHandler=A data handler was not found for content id {0} +noDataHandler=A data handler was not found for content id {0} \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]