You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ashish Arya <As...@sos.sungard.com> on 2007/08/20 13:42:41 UTC
Problem with MTOM
Hi All,
I am new to AXIS 2 and trying to implement a small web service
application which uses MTOM attachment. In my simple web service
application, I have an operation called 'echoText()' which expects a
text file as MTOM attachment as request parameter to this operation. In
return this method simply echo the text contained in the attached file.
public interface ServiceInreface {
String echoText(String name);
}
My question is: how can I inform the <Java2wsld> ant task that the
string request parameter to my web service operation expects a MTOM
attachment inside it. Thus the WSDL generated should have an entry like
this
<wsdl:types>
<xs:schema attributeFormDefault="qualified"
xmlns:xs=http://www.w3.org/2001/XMLSchema ..................>
<xs:import namespace="http://www.w3.org/2005/05/xmlmime"
schemaLocation="xsd0.xsd"/> <!-This I have taken from MTOM sample
folder-->
<xs:element name="echoText">
<xs:complexType>
<xs:sequence>
<xs:element name="param0" nillable="true"
type="xs:string"/>
<xs:element minOccurs="0" name="binaryData"
type="xmime:base64Binary"/>
</xs:sequence>
....................................
Instead of
<wsdl:types>
<xs:schema attributeFormDefault="qualified"
xmlns:xs=http://www.w3.org/2001/XMLSchema .... ..... .... ... ... ...
... ... ... ..>
<xs:import namespace="http://www.w3.org/2005/05/xmlmime"
schemaLocation="xsd0.xsd"/>
<xs:element name="echoText">
<xs:complexType>
<xs:sequence>
<xs:element name="param0" nillable="true"
type="xs:string"/>
</xs:sequence>
....................................
Please help me to understand this.
Thanks and Regards,
Ashish
RE: Problem with MTOM
Posted by Ashish Arya <As...@sos.sungard.com>.
Hi All,
Let me re-phrase my question to make it simpler.
Can we use <java2wsdl> ant task to generate the WSDL file especially
when MTOM attachments are expected in Request or Response?
I noticed that inside the axis2/samples/mtom folder, the build file
doesn't contain task to generate WSDL file from a java file.
How should we automate the process of generation of WSDL for MTOM
attachments?
Thanks and 1Regards,
Ashish Arya,
Sungard Offshore Services (India) <http://www.sungard.com/sos>
________________________________
From: Ashish Arya [mailto:Ashish.Arya@sos.sungard.com]
Sent: Monday, August 20, 2007 5:13 PM
To: axis-user@ws.apache.org
Subject: Problem with MTOM
Hi All,
I am new to AXIS 2 and trying to implement a small web service
application which uses MTOM attachment. In my simple web service
application, I have an operation called 'echoText()' which expects a
text file as MTOM attachment as request parameter to this operation. In
return this method simply echo the text contained in the attached file.
public interface ServiceInreface {
String echoText(String name);
}
My question is: how can I inform the <Java2wsld> ant task that the
string request parameter to my web service operation expects a MTOM
attachment inside it. Thus the WSDL generated should have an entry like
this
<wsdl:types>
<xs:schema attributeFormDefault="qualified"
xmlns:xs=http://www.w3.org/2001/XMLSchema ..................>
<xs:import namespace="http://www.w3.org/2005/05/xmlmime"
schemaLocation="xsd0.xsd"/> <!-This I have taken from MTOM sample
folder-->
<xs:element name="echoText">
<xs:complexType>
<xs:sequence>
<xs:element name="param0" nillable="true"
type="xs:string"/>
<xs:element minOccurs="0" name="binaryData"
type="xmime:base64Binary"/>
</xs:sequence>
....................................
Instead of
<wsdl:types>
<xs:schema attributeFormDefault="qualified"
xmlns:xs=http://www.w3.org/2001/XMLSchema .... ..... .... ... ... ...
... ... ... ..>
<xs:import namespace="http://www.w3.org/2005/05/xmlmime"
schemaLocation="xsd0.xsd"/>
<xs:element name="echoText">
<xs:complexType>
<xs:sequence>
<xs:element name="param0" nillable="true"
type="xs:string"/>
</xs:sequence>
....................................
Please help me to understand this.
Thanks and Regards,
Ashish
Re: Problem with MTOM
Posted by Thilina Gunarathne <cs...@gmail.com>.
> public interface ServiceInreface {
>
> String echoText(String name);
Change the above as follows..
String echoText(String name, DataHandler fileData
thanks,
Thilina
>
> }
>
>
>
> My question is: how can I inform the <Java2wsld> ant task that the string
> request parameter to my web service operation expects a MTOM attachment
> inside it. Thus the WSDL generated should have an entry like this
>
> <wsdl:types>
>
> <xs:schema attributeFormDefault="qualified"
> xmlns:xs=http://www.w3.org/2001/XMLSchema ………………>
>
> <xs:import
> namespace="http://www.w3.org/2005/05/xmlmime"
> schemaLocation="xsd0.xsd"/> <!—This I have taken from MTOM sample folderà
>
> <xs:element name="echoText">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element name="param0" nillable="true"
> type="xs:string"/>
>
> <xs:element minOccurs="0" name="binaryData"
> type="xmime:base64Binary"/>
>
> </xs:sequence>
>
> ………………………………
>
>
>
> Instead of
>
>
>
> <wsdl:types>
>
> <xs:schema attributeFormDefault="qualified"
> xmlns:xs=http://www.w3.org/2001/XMLSchema …. ….. …. … … … …
> … … ..>
>
> <xs:import
> namespace="http://www.w3.org/2005/05/xmlmime"
> schemaLocation="xsd0.xsd"/>
>
> <xs:element name="echoText">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element name="param0" nillable="true"
> type="xs:string"/>
>
> </xs:sequence>
>
> ………………………………
>
>
>
> Please help me to understand this.
>
>
>
> Thanks and Regards,
>
>
>
> Ashish
>
>
>
>
>
>
>
>
--
Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org