Tammy,
Sound like a bug to me...

Can you test whether this behaviour shows even for a simple scenerio..
Also AFAIKS I do not seee you are using any MTOM specific features in
your implementation... Hope you have not mistaken
javax.activation.DataSource to OMDataSource...

Thanks,
Thilina

On 6/21/07, Tammy Dugan <[EMAIL PROTECTED]> wrote:
Here is what the response message from by Axis2 service looks like with
MTOM disabled:

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";><soapenv:Body><r:queryDatasetReturnResponse
xmlns:r="http://spin.regenstrief.org/query";>...</rawData></r:queryDatasetReturnResponse></soapenv:Body></soapenv:Envelope>

This is what the message looks like with MTOM enabled:

--MIMEBoundaryurn_uuid_2BE039143DB2744D651182431292012
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.urn:uuid:[EMAIL PROTECTED]>

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";><soapenv:Body><r:queryDatasetReturnResponse
xmlns:r="http://spin.regenstrief.org/query";>...</rawData>
--MIMEBoundaryurn_uuid_2BE039143DB2744D651182431292012----MIMEBoundaryurn_uuid_2BE039143DB2744D651182431292012
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.urn:uuid:[EMAIL PROTECTED]>

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";><soapenv:Body><r:queryDatasetReturnResponse
xmlns:r="http://spin.regenstrief.org/query";>...</rawData></r:queryDatasetReturnResponse></soapenv:Body></soapenv:Envelope>
--MIMEBoundaryurn_uuid_2BE039143DB2744D651182431292012--

As you can see, almost the entire message is repeated twice. The first
time the end of the message is truncated. This really looks like a bug
to me. Any thoughts? I am running the latest released version of Axis2.
Here is the code I am running to make this message:

        OMFactory fact = OMAbstractFactory.getOMFactory();
        OMNamespace ns =
fact.createOMNamespace("http://spin.regenstrief.org/query";, "r");
        OMElement resultXML =
fact.createOMElement("queryDatasetReturnResponse", ns);
        Connection con = db.openConnection(); // create a dedicated
connection for streaming from database
        OMElement datasetElement = null;

        InputStream inputStream = readDataSetXMLToInputStream(con, 1,
"VARIABLE_DATA_SET"); //string of xml from database

        if (inputStream != null)
        {
            ns = new OMNamespaceImpl("", "");
            OMDataSource dataSource = new CustomDataSource(inputStream);
            datasetElement = new OMSourcedElementImpl("rawData", ns,
fact, dataSource);
        }

        resultXML.addChild(datasetElement);

class CustomDataSource implements OMDataSource
    {
        private final InputStream data;

        public CustomDataSource(InputStream data)
        {
            this.data = data;
        }

        public void serialize(XMLStreamWriter xmlWriter) throws
XMLStreamException
        {
            XMLStreamReader reader = null;

            try
            {
                StreamingOMSerializer serializer = new
StreamingOMSerializer();
                reader = getReader();
                serializer.serialize(reader, xmlWriter);
                xmlWriter.flush();
            } catch (Throwable e)
            {
            }
        }

        public XMLStreamReader getReader() throws XMLStreamException
        {
            XMLStreamReader reader = null;

            try
            {
                reader = StAXUtils.createXMLStreamReader(this.data);
            } catch (Exception e)
            {
            }

            return reader;
        }
        ...
    }


Tammy

--
Tammy Dugan
Computer Programmer

Regenstrief Institute, Inc.
Medical Informatics
Health Information and Translational Sciences (HITS) Building
410 West 10th Street, Suite 2000
Indianapolis, IN 46202
Main: 317.423.5500
Fax: 317.423.5695
IU campus mail address: HS, 2000

(317) 423 - 5541

Confidentiality Notice: The contents of this message and any files transmitted 
with it may contain confidential and/or privileged information and are intended 
solely for the use of the named addressee(s). Additionally, the information 
contained herein may have been disclosed to you from medical records with 
confidentiality protected by federal and state laws. Federal regulations and 
State laws prohibit you from making further disclosure of such information 
without the specific written consent of the person to whom the information 
pertains or as otherwise permitted by such regulations. A general authorization 
for the release of medical or other information is not sufficient for this 
purpose.

If you have received this message in error, please notify the sender by return 
e-mail and delete the original message. Any retention, disclosure, copying, 
distribution or use of this information by anyone other than the intended 
recipient is strictly prohibited.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Thilina Gunarathne  -  http://www.wso2.com - http://thilinag.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to