You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Michael Meire (JIRA)" <ji...@apache.org> on 2006/03/24 14:35:16 UTC

[jira] Created: (AXIS2-513) wsdl2java, MTOM and user-defined types

wsdl2java, MTOM and user-defined types
--------------------------------------

         Key: AXIS2-513
         URL: http://issues.apache.org/jira/browse/AXIS2-513
     Project: Apache Axis 2.0 (Axis2)
        Type: Bug
  Components: databinding, wsdl  
    Versions: 0.94    
    Reporter: Michael Meire


When trying to extend a user-defined type and adding an element that contains an xsd:base64Binary type element, the wsdl2java-generated code does not support/use MTOM.

This bug report is the result of an email conversation on the axis2 axis-user mailing list.
Below, I include the most important excerpts of that conversation

----------------------------------- begin ----------------------------------------

PROBLEM STATEMENT:
----------------------------------

The problem I'm facing is the following: I am creating a webservice, starting from a WSDL file. I need file attachments, and therefore I want to use MTOM.
I also need some kind of "inheritance" and therefore I'm creating complex types that are extensions of other types. Concretely I include something like the following:

    <xsd:complexType name="abc">
        <xsd:complexContent>
            <xsd:extension base="xyz">
                <xsd:sequence>
                    <xsd:element name="loFileZipped" type="xsd:base64Binary"/>

                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>


My experiences so far with Axis2 v0.94 are the following:

    * when using wsdl2java using ADB, the abc-type is not taken into account ==> no java class corresponding to this type is generated

# when using wsdl2java using xmlbeans, an abc-javaclass is generated, including a variable byte[] getLoFileZipped()
So this option seems to do the trick for me. However, in this case, I can't get MTOM working. The byte array is sent as inline xml within the SOAP message.
I have (as far as I know) followed the instructions for using MTOM. I also successfully tested the MTOM sample that is included in the Axis2 distribution.

I think basically my question comes down to:
how can I use extension-complextypes in my wsdl, and still be able to use MTOM...


SUGGESTED ANSWERS:
-----------------------------------

1. (robert lazarski)
Maybe this will help - anne wrote this a while back and gives an example that uses mtom and extension base: 
http://marc.theaimsgroup.com/?l=axis-user&m=114123711724485&w=2

2. (Ajith Ranabahu)
Hi,
I was actually going to write a long explanation for this but I see
Anne has done it (quite completely I should say) some time back.
Thanks Robert for pulling it out from the archives.
in the Axis2 setting, If you use XMLBeans, it'll actually correctly
mark the OM elements for optimization. So if you've codegned for the
optimized schema you should automatically get the optimized wire
message.

3. (Anne Thomas Manes)
Actually, I don't think my previous posting directly answers Michael's question. My post indicated how to extend the xsd:base64Binary type to indicate content type. In this case, Michael is trying to extend a user-defined type and add an element that contains an xsd:base64Binary type element.

Michael, you might try defining your loFileZipped element as type="xmime:base64Binary". If that doesn't work, then I suggest you file a bug report.


----------------------------------- end ----------------------------------------


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (AXIS2-513) wsdl2java, MTOM and user-defined types

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2-513?page=all ]

Davanum Srinivas resolved AXIS2-513.
------------------------------------

    Resolution: Fixed

i think this is fixed. Please try latest nightly.

-- dims

> wsdl2java, MTOM and user-defined types
> --------------------------------------
>
>                 Key: AXIS2-513
>                 URL: http://issues.apache.org/jira/browse/AXIS2-513
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: databinding, wsdl
>    Affects Versions: 0.94
>            Reporter: Michael Meire
>
> When trying to extend a user-defined type and adding an element that contains an xsd:base64Binary type element, the wsdl2java-generated code does not support/use MTOM.
> This bug report is the result of an email conversation on the axis2 axis-user mailing list.
> Below, I include the most important excerpts of that conversation
> ----------------------------------- begin ----------------------------------------
> PROBLEM STATEMENT:
> ----------------------------------
> The problem I'm facing is the following: I am creating a webservice, starting from a WSDL file. I need file attachments, and therefore I want to use MTOM.
> I also need some kind of "inheritance" and therefore I'm creating complex types that are extensions of other types. Concretely I include something like the following:
>     <xsd:complexType name="abc">
>         <xsd:complexContent>
>             <xsd:extension base="xyz">
>                 <xsd:sequence>
>                     <xsd:element name="loFileZipped" type="xsd:base64Binary"/>
>                 </xsd:sequence>
>             </xsd:extension>
>         </xsd:complexContent>
>     </xsd:complexType>
> My experiences so far with Axis2 v0.94 are the following:
>     * when using wsdl2java using ADB, the abc-type is not taken into account ==> no java class corresponding to this type is generated
> # when using wsdl2java using xmlbeans, an abc-javaclass is generated, including a variable byte[] getLoFileZipped()
> So this option seems to do the trick for me. However, in this case, I can't get MTOM working. The byte array is sent as inline xml within the SOAP message.
> I have (as far as I know) followed the instructions for using MTOM. I also successfully tested the MTOM sample that is included in the Axis2 distribution.
> I think basically my question comes down to:
> how can I use extension-complextypes in my wsdl, and still be able to use MTOM...
> SUGGESTED ANSWERS:
> -----------------------------------
> 1. (robert lazarski)
> Maybe this will help - anne wrote this a while back and gives an example that uses mtom and extension base: 
> http://marc.theaimsgroup.com/?l=axis-user&m=114123711724485&w=2
> 2. (Ajith Ranabahu)
> Hi,
> I was actually going to write a long explanation for this but I see
> Anne has done it (quite completely I should say) some time back.
> Thanks Robert for pulling it out from the archives.
> in the Axis2 setting, If you use XMLBeans, it'll actually correctly
> mark the OM elements for optimization. So if you've codegned for the
> optimized schema you should automatically get the optimized wire
> message.
> 3. (Anne Thomas Manes)
> Actually, I don't think my previous posting directly answers Michael's question. My post indicated how to extend the xsd:base64Binary type to indicate content type. In this case, Michael is trying to extend a user-defined type and add an element that contains an xsd:base64Binary type element.
> Michael, you might try defining your loFileZipped element as type="xmime:base64Binary". If that doesn't work, then I suggest you file a bug report.
> ----------------------------------- end ----------------------------------------

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org