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 Jim Collins <ja...@blueyonder.co.uk> on 2006/05/27 09:01:24 UTC

MTOM Problem With generated code

Hi,

I used WSDL2Java to generate server and client code and deployed the server. 
I have sent an attachment to the server using the AXIS2 APIs but when I try 
and send one using the generated Stub I get a Data Binding error. I looked 
at what was being sent using TCP monitior and with the AXIS2 APIs everything 
is as expectted but when using the Stub the attachment data is sent in the 
SOAP Body and not outside of this as it should be.

Does anyone have any sample code they could send using MTOM but using 
generated code and not the AXIS2 APIs?

Below is the WSDL I used in case this helps.

Regards

Jim

<?xml version="1.0" encoding="utf-8"?>

<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" 
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
targetNamespace="http://tempuri.org/" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

<wsdl:types>

<s:schema elementFormDefault="qualified" 
targetNamespace="http://tempuri.org/">

<s:element name="GetLumpOfBinary">

<s:complexType>

<s:sequence>

<s:element minOccurs="0" maxOccurs="1" name="fileName" type="s:string" />

</s:sequence>

</s:complexType>

</s:element>

<s:element name="GetLumpOfBinaryResponse">

<s:complexType>

<s:sequence>

<s:element minOccurs="0" maxOccurs="1" name="GetLumpOfBinaryResult" 
type="s:base64Binary" />

</s:sequence>

</s:complexType>

</s:element>

<s:element name="SetLumpOfBinary">

<s:complexType>

<s:sequence>

<s:element minOccurs="0" maxOccurs="1" name="data" type="s:base64Binary" />

<s:element minOccurs="0" maxOccurs="1" name="fileName" type="s:string" />

</s:sequence>

</s:complexType>

</s:element>

<s:element name="SetLumpOfBinaryResponse">

<s:complexType>

<s:sequence>

<s:element minOccurs="1" maxOccurs="1" name="SetLumpOfBinaryResult" 
type="s:int" />

</s:sequence>

</s:complexType>

</s:element>

</s:schema>

</wsdl:types>

<wsdl:message name="GetLumpOfBinarySoapIn">

<wsdl:part name="parameters" element="tns:GetLumpOfBinary" />

</wsdl:message>

<wsdl:message name="GetLumpOfBinarySoapOut">

<wsdl:part name="parameters" element="tns:GetLumpOfBinaryResponse" />

</wsdl:message>

<wsdl:message name="SetLumpOfBinarySoapIn">

<wsdl:part name="parameters" element="tns:SetLumpOfBinary" />

</wsdl:message>

<wsdl:message name="SetLumpOfBinarySoapOut">

<wsdl:part name="parameters" element="tns:SetLumpOfBinaryResponse" />

</wsdl:message>

<wsdl:portType name="BinarySoap">

<wsdl:operation name="GetLumpOfBinary">

<wsdl:input message="tns:GetLumpOfBinarySoapIn" />

<wsdl:output message="tns:GetLumpOfBinarySoapOut" />

</wsdl:operation>

<wsdl:operation name="SetLumpOfBinary">

<wsdl:input message="tns:SetLumpOfBinarySoapIn" />

<wsdl:output message="tns:SetLumpOfBinarySoapOut" />

</wsdl:operation>

</wsdl:portType>

<wsdl:binding name="BinarySoap" type="tns:BinarySoap">

<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />

<wsdl:operation name="GetLumpOfBinary">

<soap:operation soapAction="http://tempuri.org/GetLumpOfBinary" 
style="document" />

<wsdl:input>

<soap:body use="literal" />

</wsdl:input>

<wsdl:output>

<soap:body use="literal" />

</wsdl:output>

</wsdl:operation>

<wsdl:operation name="SetLumpOfBinary">

<soap:operation soapAction="http://tempuri.org/SetLumpOfBinary" 
style="document" />

<wsdl:input>

<soap:body use="literal" />

</wsdl:input>

<wsdl:output>

<soap:body use="literal" />

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:binding name="BinarySoap12" type="tns:BinarySoap">

<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />

<wsdl:operation name="GetLumpOfBinary">

<soap12:operation soapAction="http://tempuri.org/GetLumpOfBinary" 
style="document" />

<wsdl:input>

<soap12:body use="literal" />

</wsdl:input>

<wsdl:output>

<soap12:body use="literal" />

</wsdl:output>

</wsdl:operation>

<wsdl:operation name="SetLumpOfBinary">

<soap12:operation soapAction="http://tempuri.org/SetLumpOfBinary" 
style="document" />

<wsdl:input>

<soap12:body use="literal" />

</wsdl:input>

<wsdl:output>

<soap12:body use="literal" />

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:service name="DocumentumService">

<wsdl:port name="BinarySoap" binding="tns:BinarySoap">

<soap:address location="http://localhost:3718/BinaryService/Binary.asmx" />

</wsdl:port>

<wsdl:port name="BinarySoap12" binding="tns:BinarySoap12">

<soap12:address location="http://localhost:3718/BinaryService/Binary.asmx" 
/>

</wsdl:port>

</wsdl:service>

</wsdl:definitions>




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


Re: MTOM Problem With generated code

Posted by Jim Collins <ja...@blueyonder.co.uk>.
Hi Deepal,

I am not sure if it is a bug. I am able to send attachments using hand 
crafted client and server code and a .NET client was able to create a proxy 
from the WSDL and send attachments. My problem is when I try and send an 
attachment using the generated stub is send the attachment inline in the 
body. I would like an example if anyone has one of a simple WSDL file and a 
client that can send an attachment using the generated stub.

Many thanks

Jim
----- Original Message ----- 
From: "Deepal Jayasinghe" <de...@opensource.lk>
To: <ax...@ws.apache.org>
Sent: Tuesday, May 30, 2006 6:04 AM
Subject: Re: MTOM Problem With generated code


> Hi Jim;
> Can you please create JIRA.
>
> Jim Collins wrote:
>
>> Hi,
>>
>> I used WSDL2Java to generate server and client code and deployed the
>> server. I have sent an attachment to the server using the AXIS2 APIs
>> but when I try and send one using the generated Stub I get a Data
>> Binding error. I looked at what was being sent using TCP monitior and
>> with the AXIS2 APIs everything is as expectted but when using the Stub
>> the attachment data is sent in the SOAP Body and not outside of this
>> as it should be.
>>
>> Does anyone have any sample code they could send using MTOM but using
>> generated code and not the AXIS2 APIs?
>>
>> Below is the WSDL I used in case this helps.
>>
>> Regards
>>
>> Jim
>>
>> <?xml version="1.0" encoding="utf-8"?>
>>
>> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>> xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
>> xmlns:tns="http://tempuri.org/"
>> xmlns:s="http://www.w3.org/2001/XMLSchema"
>> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
>> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
>> targetNamespace="http://tempuri.org/"
>> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
>>
>> <wsdl:types>
>>
>> <s:schema elementFormDefault="qualified"
>> targetNamespace="http://tempuri.org/">
>>
>> <s:element name="GetLumpOfBinary">
>>
>> <s:complexType>
>>
>> <s:sequence>
>>
>> <s:element minOccurs="0" maxOccurs="1" name="fileName" type="s:string" />
>>
>> </s:sequence>
>>
>> </s:complexType>
>>
>> </s:element>
>>
>> <s:element name="GetLumpOfBinaryResponse">
>>
>> <s:complexType>
>>
>> <s:sequence>
>>
>> <s:element minOccurs="0" maxOccurs="1" name="GetLumpOfBinaryResult"
>> type="s:base64Binary" />
>>
>> </s:sequence>
>>
>> </s:complexType>
>>
>> </s:element>
>>
>> <s:element name="SetLumpOfBinary">
>>
>> <s:complexType>
>>
>> <s:sequence>
>>
>> <s:element minOccurs="0" maxOccurs="1" name="data"
>> type="s:base64Binary" />
>>
>> <s:element minOccurs="0" maxOccurs="1" name="fileName" type="s:string" />
>>
>> </s:sequence>
>>
>> </s:complexType>
>>
>> </s:element>
>>
>> <s:element name="SetLumpOfBinaryResponse">
>>
>> <s:complexType>
>>
>> <s:sequence>
>>
>> <s:element minOccurs="1" maxOccurs="1" name="SetLumpOfBinaryResult"
>> type="s:int" />
>>
>> </s:sequence>
>>
>> </s:complexType>
>>
>> </s:element>
>>
>> </s:schema>
>>
>> </wsdl:types>
>>
>> <wsdl:message name="GetLumpOfBinarySoapIn">
>>
>> <wsdl:part name="parameters" element="tns:GetLumpOfBinary" />
>>
>> </wsdl:message>
>>
>> <wsdl:message name="GetLumpOfBinarySoapOut">
>>
>> <wsdl:part name="parameters" element="tns:GetLumpOfBinaryResponse" />
>>
>> </wsdl:message>
>>
>> <wsdl:message name="SetLumpOfBinarySoapIn">
>>
>> <wsdl:part name="parameters" element="tns:SetLumpOfBinary" />
>>
>> </wsdl:message>
>>
>> <wsdl:message name="SetLumpOfBinarySoapOut">
>>
>> <wsdl:part name="parameters" element="tns:SetLumpOfBinaryResponse" />
>>
>> </wsdl:message>
>>
>> <wsdl:portType name="BinarySoap">
>>
>> <wsdl:operation name="GetLumpOfBinary">
>>
>> <wsdl:input message="tns:GetLumpOfBinarySoapIn" />
>>
>> <wsdl:output message="tns:GetLumpOfBinarySoapOut" />
>>
>> </wsdl:operation>
>>
>> <wsdl:operation name="SetLumpOfBinary">
>>
>> <wsdl:input message="tns:SetLumpOfBinarySoapIn" />
>>
>> <wsdl:output message="tns:SetLumpOfBinarySoapOut" />
>>
>> </wsdl:operation>
>>
>> </wsdl:portType>
>>
>> <wsdl:binding name="BinarySoap" type="tns:BinarySoap">
>>
>> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
>>
>> <wsdl:operation name="GetLumpOfBinary">
>>
>> <soap:operation soapAction="http://tempuri.org/GetLumpOfBinary"
>> style="document" />
>>
>> <wsdl:input>
>>
>> <soap:body use="literal" />
>>
>> </wsdl:input>
>>
>> <wsdl:output>
>>
>> <soap:body use="literal" />
>>
>> </wsdl:output>
>>
>> </wsdl:operation>
>>
>> <wsdl:operation name="SetLumpOfBinary">
>>
>> <soap:operation soapAction="http://tempuri.org/SetLumpOfBinary"
>> style="document" />
>>
>> <wsdl:input>
>>
>> <soap:body use="literal" />
>>
>> </wsdl:input>
>>
>> <wsdl:output>
>>
>> <soap:body use="literal" />
>>
>> </wsdl:output>
>>
>> </wsdl:operation>
>>
>> </wsdl:binding>
>>
>> <wsdl:binding name="BinarySoap12" type="tns:BinarySoap">
>>
>> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
>>
>> <wsdl:operation name="GetLumpOfBinary">
>>
>> <soap12:operation soapAction="http://tempuri.org/GetLumpOfBinary"
>> style="document" />
>>
>> <wsdl:input>
>>
>> <soap12:body use="literal" />
>>
>> </wsdl:input>
>>
>> <wsdl:output>
>>
>> <soap12:body use="literal" />
>>
>> </wsdl:output>
>>
>> </wsdl:operation>
>>
>> <wsdl:operation name="SetLumpOfBinary">
>>
>> <soap12:operation soapAction="http://tempuri.org/SetLumpOfBinary"
>> style="document" />
>>
>> <wsdl:input>
>>
>> <soap12:body use="literal" />
>>
>> </wsdl:input>
>>
>> <wsdl:output>
>>
>> <soap12:body use="literal" />
>>
>> </wsdl:output>
>>
>> </wsdl:operation>
>>
>> </wsdl:binding>
>>
>> <wsdl:service name="DocumentumService">
>>
>> <wsdl:port name="BinarySoap" binding="tns:BinarySoap">
>>
>> <soap:address
>> location="http://localhost:3718/BinaryService/Binary.asmx" />
>>
>> </wsdl:port>
>>
>> <wsdl:port name="BinarySoap12" binding="tns:BinarySoap12">
>>
>> <soap12:address
>> location="http://localhost:3718/BinaryService/Binary.asmx" />
>>
>> </wsdl:port>
>>
>> </wsdl:service>
>>
>> </wsdl:definitions>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>>
>
> -- 
> Thanks,
> Deepal
> ................................................................
> ~Future is Open~
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
> 




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


Re: MTOM Problem With generated code

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Jim;
Can you please create JIRA.

Jim Collins wrote:

> Hi,
>
> I used WSDL2Java to generate server and client code and deployed the
> server. I have sent an attachment to the server using the AXIS2 APIs
> but when I try and send one using the generated Stub I get a Data
> Binding error. I looked at what was being sent using TCP monitior and
> with the AXIS2 APIs everything is as expectted but when using the Stub
> the attachment data is sent in the SOAP Body and not outside of this
> as it should be.
>
> Does anyone have any sample code they could send using MTOM but using
> generated code and not the AXIS2 APIs?
>
> Below is the WSDL I used in case this helps.
>
> Regards
>
> Jim
>
> <?xml version="1.0" encoding="utf-8"?>
>
> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> xmlns:tns="http://tempuri.org/"
> xmlns:s="http://www.w3.org/2001/XMLSchema"
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> targetNamespace="http://tempuri.org/"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
>
> <wsdl:types>
>
> <s:schema elementFormDefault="qualified"
> targetNamespace="http://tempuri.org/">
>
> <s:element name="GetLumpOfBinary">
>
> <s:complexType>
>
> <s:sequence>
>
> <s:element minOccurs="0" maxOccurs="1" name="fileName" type="s:string" />
>
> </s:sequence>
>
> </s:complexType>
>
> </s:element>
>
> <s:element name="GetLumpOfBinaryResponse">
>
> <s:complexType>
>
> <s:sequence>
>
> <s:element minOccurs="0" maxOccurs="1" name="GetLumpOfBinaryResult"
> type="s:base64Binary" />
>
> </s:sequence>
>
> </s:complexType>
>
> </s:element>
>
> <s:element name="SetLumpOfBinary">
>
> <s:complexType>
>
> <s:sequence>
>
> <s:element minOccurs="0" maxOccurs="1" name="data"
> type="s:base64Binary" />
>
> <s:element minOccurs="0" maxOccurs="1" name="fileName" type="s:string" />
>
> </s:sequence>
>
> </s:complexType>
>
> </s:element>
>
> <s:element name="SetLumpOfBinaryResponse">
>
> <s:complexType>
>
> <s:sequence>
>
> <s:element minOccurs="1" maxOccurs="1" name="SetLumpOfBinaryResult"
> type="s:int" />
>
> </s:sequence>
>
> </s:complexType>
>
> </s:element>
>
> </s:schema>
>
> </wsdl:types>
>
> <wsdl:message name="GetLumpOfBinarySoapIn">
>
> <wsdl:part name="parameters" element="tns:GetLumpOfBinary" />
>
> </wsdl:message>
>
> <wsdl:message name="GetLumpOfBinarySoapOut">
>
> <wsdl:part name="parameters" element="tns:GetLumpOfBinaryResponse" />
>
> </wsdl:message>
>
> <wsdl:message name="SetLumpOfBinarySoapIn">
>
> <wsdl:part name="parameters" element="tns:SetLumpOfBinary" />
>
> </wsdl:message>
>
> <wsdl:message name="SetLumpOfBinarySoapOut">
>
> <wsdl:part name="parameters" element="tns:SetLumpOfBinaryResponse" />
>
> </wsdl:message>
>
> <wsdl:portType name="BinarySoap">
>
> <wsdl:operation name="GetLumpOfBinary">
>
> <wsdl:input message="tns:GetLumpOfBinarySoapIn" />
>
> <wsdl:output message="tns:GetLumpOfBinarySoapOut" />
>
> </wsdl:operation>
>
> <wsdl:operation name="SetLumpOfBinary">
>
> <wsdl:input message="tns:SetLumpOfBinarySoapIn" />
>
> <wsdl:output message="tns:SetLumpOfBinarySoapOut" />
>
> </wsdl:operation>
>
> </wsdl:portType>
>
> <wsdl:binding name="BinarySoap" type="tns:BinarySoap">
>
> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
>
> <wsdl:operation name="GetLumpOfBinary">
>
> <soap:operation soapAction="http://tempuri.org/GetLumpOfBinary"
> style="document" />
>
> <wsdl:input>
>
> <soap:body use="literal" />
>
> </wsdl:input>
>
> <wsdl:output>
>
> <soap:body use="literal" />
>
> </wsdl:output>
>
> </wsdl:operation>
>
> <wsdl:operation name="SetLumpOfBinary">
>
> <soap:operation soapAction="http://tempuri.org/SetLumpOfBinary"
> style="document" />
>
> <wsdl:input>
>
> <soap:body use="literal" />
>
> </wsdl:input>
>
> <wsdl:output>
>
> <soap:body use="literal" />
>
> </wsdl:output>
>
> </wsdl:operation>
>
> </wsdl:binding>
>
> <wsdl:binding name="BinarySoap12" type="tns:BinarySoap">
>
> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
>
> <wsdl:operation name="GetLumpOfBinary">
>
> <soap12:operation soapAction="http://tempuri.org/GetLumpOfBinary"
> style="document" />
>
> <wsdl:input>
>
> <soap12:body use="literal" />
>
> </wsdl:input>
>
> <wsdl:output>
>
> <soap12:body use="literal" />
>
> </wsdl:output>
>
> </wsdl:operation>
>
> <wsdl:operation name="SetLumpOfBinary">
>
> <soap12:operation soapAction="http://tempuri.org/SetLumpOfBinary"
> style="document" />
>
> <wsdl:input>
>
> <soap12:body use="literal" />
>
> </wsdl:input>
>
> <wsdl:output>
>
> <soap12:body use="literal" />
>
> </wsdl:output>
>
> </wsdl:operation>
>
> </wsdl:binding>
>
> <wsdl:service name="DocumentumService">
>
> <wsdl:port name="BinarySoap" binding="tns:BinarySoap">
>
> <soap:address
> location="http://localhost:3718/BinaryService/Binary.asmx" />
>
> </wsdl:port>
>
> <wsdl:port name="BinarySoap12" binding="tns:BinarySoap12">
>
> <soap12:address
> location="http://localhost:3718/BinaryService/Binary.asmx" />
>
> </wsdl:port>
>
> </wsdl:service>
>
> </wsdl:definitions>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>

-- 
Thanks,
Deepal
................................................................
~Future is Open~ 



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