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 Bram Biesbrouck <b...@beligum.org> on 2006/01/13 01:36:47 UTC
MTOM, XOP and WSDL
Hi all,
I'm struggling with this for a few days now, and can't seem to find a
solution. Please help me out.
How do I design a schema in my wsdl file that uses mtom/xop to transfer a
(large) file to my webservice? My latest schema looks like this:
<types>
<schema targetNamespace="http://ws.bpower2.com/screenkast/xsd"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
xmlns:xop="http://www.w3.org/2004/08/xop/include"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
<import namespace="http://www.w3.org/2004/08/xop/include"/>
<import namespace="http://www.w3.org/2004/11/xmlmime"/>
<import namespace="http://www.w3.org/2003/05/soap-encoding"/>
<element name="recordingRequest">
<complexType>
<sequence>
<element ref="xop:Include" minOccurs="1" maxOccurs="1"
nillable="false"/>
</sequence>
<attribute ref="xmlmime:contentType" use="optional"/>
</complexType>
</element>
<element name="recordingResponse">
<complexType>
<sequence>
<element name="errorCode" type="xsd:int"/>
</sequence>
</complexType>
</element>
</schema>
</types>
I get NullpointerExceptions though (axis2-0.94).
My experience so far with binary embedded data is troublesome. I never seem to
get it right. Call me a quitter, but I'm seriously thinking about switching
to Web-Service-controlled FTP-uploads to do the same trick.
What are your experiences with attachments?
regards,
Bram
Re: MTOM, XOP and WSDL
Posted by Davanum Srinivas <da...@gmail.com>.
Bram,
all u need is a schema construct that has a base64Binary in it. then
you use the switches to switch on mtom.
thanks,
-- dims
On 1/12/06, Bram Biesbrouck <b...@beligum.org> wrote:
> Hi all,
>
> I'm struggling with this for a few days now, and can't seem to find a
> solution. Please help me out.
> How do I design a schema in my wsdl file that uses mtom/xop to transfer a
> (large) file to my webservice? My latest schema looks like this:
>
> <types>
> <schema targetNamespace="http://ws.bpower2.com/screenkast/xsd"
> xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
> xmlns:xop="http://www.w3.org/2004/08/xop/include"
> elementFormDefault="unqualified"
> attributeFormDefault="unqualified">
>
> <import namespace="http://www.w3.org/2004/08/xop/include"/>
> <import namespace="http://www.w3.org/2004/11/xmlmime"/>
> <import namespace="http://www.w3.org/2003/05/soap-encoding"/>
>
> <element name="recordingRequest">
> <complexType>
> <sequence>
> <element ref="xop:Include" minOccurs="1" maxOccurs="1"
> nillable="false"/>
> </sequence>
> <attribute ref="xmlmime:contentType" use="optional"/>
> </complexType>
> </element>
>
> <element name="recordingResponse">
> <complexType>
> <sequence>
> <element name="errorCode" type="xsd:int"/>
> </sequence>
> </complexType>
> </element>
>
> </schema>
> </types>
>
> I get NullpointerExceptions though (axis2-0.94).
>
> My experience so far with binary embedded data is troublesome. I never seem to
> get it right. Call me a quitter, but I'm seriously thinking about switching
> to Web-Service-controlled FTP-uploads to do the same trick.
> What are your experiences with attachments?
>
> regards,
>
> Bram
>
--
Davanum Srinivas : http://wso2.com/blogs/
Re: MTOM, XOP and WSDL
Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
Hi ... you're doing this the wrong way. You appear to be attempting to
write a schema for what XOP packaging of an optimizable envelope looks
like. That's wrong - all you need to do is to have some optimizable
content (base64 typed field as Dims said) then MTOM and XOP will take
over and replace that on the wire with something similar to what you
wrote.
Sanjiva.
On Fri, 2006-01-13 at 01:36 +0100, Bram Biesbrouck wrote:
> Hi all,
>
> I'm struggling with this for a few days now, and can't seem to find a
> solution. Please help me out.
> How do I design a schema in my wsdl file that uses mtom/xop to transfer a
> (large) file to my webservice? My latest schema looks like this:
>
> <types>
> <schema targetNamespace="http://ws.bpower2.com/screenkast/xsd"
> xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime"
> xmlns:xop="http://www.w3.org/2004/08/xop/include"
> elementFormDefault="unqualified"
> attributeFormDefault="unqualified">
>
> <import namespace="http://www.w3.org/2004/08/xop/include"/>
> <import namespace="http://www.w3.org/2004/11/xmlmime"/>
> <import namespace="http://www.w3.org/2003/05/soap-encoding"/>
>
> <element name="recordingRequest">
> <complexType>
> <sequence>
> <element ref="xop:Include" minOccurs="1" maxOccurs="1"
> nillable="false"/>
> </sequence>
> <attribute ref="xmlmime:contentType" use="optional"/>
> </complexType>
> </element>
>
> <element name="recordingResponse">
> <complexType>
> <sequence>
> <element name="errorCode" type="xsd:int"/>
> </sequence>
> </complexType>
> </element>
>
> </schema>
> </types>
>
> I get NullpointerExceptions though (axis2-0.94).
>
> My experience so far with binary embedded data is troublesome. I never seem to
> get it right. Call me a quitter, but I'm seriously thinking about switching
> to Web-Service-controlled FTP-uploads to do the same trick.
> What are your experiences with attachments?
>
> regards,
>
> Bram