axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Nieweglowski (JIRA)" <>
Subject [jira] Commented: (AXIS2-2541) MTOM not using references for array of DataHandlers
Date Fri, 12 Feb 2010 14:22:27 GMT


Lukasz Nieweglowski commented on AXIS2-2541:

I've spent some time investigating this issue and I've found how to send and array of DataHandlers
using MTOM. 

There is a difference for Axis2 engine how you define your array of binary types in WSDL file.
When I used:

      <xsd:complexType name="BinaryItemArrayType">
          <xsd:element name="BinaryData" maxOccurs="1" minOccurs="1" type="xsd:base64Binary"/>

then Axis2 was able to sent data using MTOM but when I tried to do it this way:
      <xsd:element name="BinaryData"  type="xsd:base64Binary"/>      

      <xsd:complexType name="BinaryItemArrayType">
          <xsd:element  maxOccurs="1" minOccurs="1"  ref="BinaryData"/>            

then all my data was sent inside SOAP message using standard base64 encoding. 

It is visible nicely when you mix these two approaches. To do that just put this type into
WSDL file and us it to send multiple DataHandlers assigned to BinaryData and InternalBinaryData:

      <xsd:element name="BinaryData"  type="xsd:base64Binary"/>      

      <xsd:complexType name="BinaryItemArrayType">
           <xsd:element name="InternalBinaryData" maxOccurs="1" minOccurs="1" type="xsd:base64Binary"/>
           <xsd:element  maxOccurs="1" minOccurs="1"  ref="BinaryData"/>           

>From my point of view this is still a bug. We have two ways of defining data type in WSDL
file which are logically equal but behavior is different.

Tested on Linux, Apache Tomcat 5.5.27, Axis2 1.5.1.

> MTOM not using references for array of DataHandlers
> ---------------------------------------------------
>                 Key: AXIS2-2541
>                 URL:
>             Project: Axis2
>          Issue Type: Bug
>          Components: transports
>    Affects Versions: 1.1.1
>         Environment: Client is written in java and running on Windows XP
>            Reporter: Valerie Masin
>            Assignee: Thilina Gunarathne
>         Attachments: composite.wsdl,, file123-1.txt, file123-2.txt
> One of my datatypes is an array of DataHandlers (DataHandler[]). (I got the wsdl to generate
this by setting my base64Binary's maxOccurs to unbounded)
> When I set the client to use MTOM I had expected to see each of these base64Binary objects
as separate references to entities outside the soap message. However, when viewing the soap
message with tcpmon, they are being sent 'by value'. If I don't use an array then the binary
data is sent correctly outside the soap message.
> Here is what I see (reformatted for clarity). Under <ns1:documents> the document
(which is only 8 bytes) is embedded in the message rather than referencing outside. 
> POST /webservices2_0e/services/DocHarborServices HTTP/1.1
> SOAPAction: "urn:compositeCreateDocument"
> User-Agent: Axis2
> Host:
> Content-Length: 691
> Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_FA25913A7339BC61F81176744499225;
type="application/xop+xml"; start="<>";
start-info="text/xml"; charset=UTF-8
> --MIMEBoundaryurn_uuid_FA25913A7339BC61F81176744499225
> content-type: application/xop+xml; charset=UTF-8; type="text/xml";
> content-transfer-encoding: binary
> content-id: <>
> <?xml version='1.0' encoding='UTF-8'?>
> <soapenv:Envelope xmlns:soapenv=""><soapenv:Header
> <soapenv:Body>
>     <ns1:compositeCreateDocument xmlns:ns1="">
>         <ns1:user>idsuser</ns1:user>
>         <ns1:documents>MTIzLS0tLTENCg==</ns1:documents>
>         <ns1:documents>MTIzLS0tLTINCg==</ns1:documents>
>     </ns1:compositeCreateDocument>
> </soapenv:Body>
> </soapenv:Envelope>
> --MIMEBoundaryurn_uuid_FA25913A7339BC61F81176744499225--

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message