users@jax-ws.java.net

Re: JWSDP 2.0 mtom soap 1.2 interoperability issue -SOAP traffic

From: Vivek Pandey <Vivek.Pandey_at_Sun.COM>
Date: Fri, 03 Mar 2006 11:31:00 -0800

I looked further on this thread I notice you're using it from wsa+jaxws
jars in jwsdp 2.0, because the message trace I see WS-Addreing headers.

-------
Dear all:

I'm writing a Java client using JWSDP 2.0 with MTOM SOAP 1.2 to invoke a
remote .NET service, which provides binary file download using MTOM SOAP
1.2. The Java client fetches a binary file (e.g. a jpg file) and writes
a copy to the local c:\tmp. I encounter some problems in JAX-WS client
to interpret the MTOM payload. The MTOM client complains a HTTP 400
error, which I suspect from the error messages that the MTOM client
cannot read the MTOM encoded content (which is a jpg file in this example).
----
I am adding Arun Gupta he can throw some light if the addressing header 
is ok for the .net client which is based on WSE.
-vivek.
Vivek Pandey wrote:
> This is helpful.
>
> Ah I see you ahve WS-Addressing too! I guess you're using the 
> rearch-2005 branch builds. In my earlier mail I assumed you were using 
> the main trunk so ignore my earlier evaluation. Using this build I am 
> able to interop with indigo mtom endpoints.
>
> Do you have equivalent .net client that can invoke this service and is 
> it possible to capture that data using tcpSpy? This would be good 
> comparison to see whats going wrong. I dont see anything wrong here.
>
> I see that the wsa:ReplyTo the namespace URI is from the w3c version. 
> Is .NET service setup for that - maybe the're expecting the member 
> submission version?
>
> -vivek.
>
> so the message looks good to me.
> POST /WebSite2/Service.asmx HTTP/1.1
> Content-Length: 843
> Content-Type: Multipart/Related; 
> action="http://tempuri.org/ServiceSoap/GetFileBinaryRequest"; 
> type="application/xop+xml"; 
> boundary="----=_Part_0_25378506.1141338090359"; 
> start-info="application/soap+xml"
> Accept: application/soap+xml, application/xop+xml, text/html, 
> image/gif, image/jpeg, *; q=.2, */*; q=.2
> User-Agent: Java/1.5.0_06
> Host: localhost:4891
> Connection: keep-alive
>
> socket (6360) sending data synchronously [len=843]
> socket (6360) sent 843 bytes of data (Incomplete last line)
> ------=_Part_0_25378506.1141338090359
> Content-Type: application/xop+xml; type="application/soap+xml"; 
> charset=utf-8
>
> <?xml version="1.0" ?><soapenv:Envelope 
> xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:ns1="http://tempuri.org/"><soapenv:Header 
> xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:To>http://localhost:4891/WebSite2/Service.asmx</wsa:To><wsa:MessageID>ebdb46a9-a9c4-478c-9c9d-06f8b02f575c</wsa:MessageID><wsa:ReplyTo><wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address></wsa:ReplyTo><wsa:Action>http://tempuri.org/ServiceSoap/GetFileBinaryRequest</wsa:Action></soapenv:Header><soapenv:Body><ns1:GetFileBinary><ns1:fileName>Home.jpg</ns1:fileName></ns1:GetFileBinary></soapenv:Body></soapenv:Envelope> 
>
> ------=_Part_0_25378506.1141338090359--
> socket (6360) receiving data synchronously [len=8192]
> socket (6360) received 125 bytes of data
> HTTP/1.1 100 Continue
> Server: ASP.NET Development Server/8.0.0.0
> Date: Thu, 02 Mar 2006 22:21:30 GMT
> Content-Length: 0
>
> socket (6360) receiving data synchronously [len=8067]
> socket (6360) received 206 bytes of data
> HTTP/1.1 400 Bad Request
>
> Ray Lai wrote:
>> Vivek:
>>
>> In addition to the issue I report about adding the threshold value to 
>> the Java client, I use TCPspy to catpure the SOAP traffic for your 
>> diagnosis.
>>
>> thanks.
>> rgds, ray
>>
>> the next process to start and make a socket call will be spyed
>> process attached, command line='"C:\Program 
>> Files\Java\jdk1.5.0_06\jre\bin\java.exe" -classpath 
>> C:\tools\jwsdp\jwsdp-shared\lib\activation.jar;C:\tools\jwsdp\jwsdp-shared\lib\jaas.jar;C:\tools\jwsdp\jwsdp-shared\lib\jta-spec1_0_1.jar;C:\tools\jwsdp\jwsdp-shared\lib\mail.jar;C:\tools\jwsdp\jwsdp-shared\lib\relaxngDatatype.jar;C:\tools\jwsdp\jwsdp-shared\lib\resolver.jar;C:\tools\jwsdp\jwsdp-shared\lib\xmlsec.jar;C:\tools\jwsdp\jwsdp-shared\lib\xsdlib.jar;C:\tools\jwsdp\jaxws\lib\jaxws-api.jar;C:\tools\jwsdp\jaxws\lib\jaxws-rt.jar;C:\tools\jwsdp\jaxws\lib\jaxws-tools.jar;C:\tools\jwsdp\jaxws\lib\jsr181-api.jar;C:\tools\jwsdp\jaxws\lib\jsr250-api.jar;C:\tools\jwsdp\jaxwsa\lib\jaxwsa-api.jar;C:\tools\jwsdp\jaxwsa\lib\jaxwsa-ri.jar;C:\tools\jwsdp\saaj\lib\saaj-api.jar;C:\tools\jwsdp\saaj\lib\saaj-impl.jar;C:\tools\jwsdp\sjsxp\lib\jsr173_api.jar;C:\tools\jwsdp\sjsxp\lib\sjsxp.jar;C:\tools\jwsdp\xmldsig\lib\xmldsig.jar;C:\tools\jwsdp\xws-security\lib\keyexport.jar;C:\tools\jwsdp\xws-security\lib\pkcs12import.jar;C:\tools\jwsdp\xws-security\lib\security-plugin.jar;C:\tools\!
 jws 
>>
>> dp\xws-security\lib\wss-provider-update.jar;C:\tools\jwsdp\xws-security\lib\xws-security.jar;C:\tools\jwsdp\xws-security\lib\xws-security_jaxrpc.jar;C:\tools\jwsdp\jaxb\lib\jaxb-api.jar;C:\tools\jwsdp\jaxb\lib\jaxb-impl.jar;C:\tools\jwsdp\jaxb\lib\jaxb-xjc.jar;C:\tools\jwsdp\jaxb\lib\jaxb1-impl.jar;C:\tools\jwsdp\fastinfoset\lib\FastInfoset.jar;C:\tools\jwsdp\jaxp\lib\jaxp-api.jar;C:\tools\jwsdp\jaxr\lib\jaxr-api.jar;C:\tools\jwsdp\jaxr\lib\jaxr-impl.jar;C:\tools\jwsdp\jaxrpc\lib\jaxrpc-api.jar;C:\tools\jwsdp\jaxrpc\lib\jaxrpc-impl.jar;C:\tools\jwsdp\jaxrpc\lib\jaxrpc-spi.jar;C:\dev\DotNetWSClient2\build\classes 
>> com.javadotnet.interop.DotNetWSClient'
>> socket (6580) created [family=AF_INET, type=SOCK_STREAM, 
>> protocol=IPPROTO_IP, dwFlags=WSA_FLAG_OVERLAPPED]
>> socket (6580) connecting synchronously [name=127.0.0.1:4891]
>> socket (6580) connected
>> socket (6580) determined its local name [name=127.0.0.1:1149]
>> socket (6580) set one of its options [level=IPPROTO_TCP, optname=1]
>> socket (6580) sending data synchronously [len=228]
>> socket (6580) sent 228 bytes of data
>> GET /WebSite2/Service.asmx?wsdl HTTP/1.1
>> User-Agent: Java/1.5.0_06
>> Host: localhost:4891
>> Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
>> Connection: keep-alive
>> Content-type: application/x-www-form-urlencoded
>>
>> socket (6580) receiving data synchronously [len=8192]
>> socket (6580) received 3275 bytes of data (Incomplete last line)
>> HTTP/1.1 200 OK
>> Server: ASP.NET Development Server/8.0.0.0
>> Date: Thu, 02 Mar 2006 22:21:29 GMT
>> X-AspNet-Version: 2.0.50727
>> Cache-Control: private, max-age=0
>> Content-Type: text/xml; charset=utf-8
>> Content-Length: 3031
>> Connection: Close
>>
>> <?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="GetFileBinary">
>>         <s:complexType>
>>           <s:sequence>
>>             <s:element minOccurs="0" maxOccurs="1" name="fileName" 
>> type="s:string" />
>>           </s:sequence>
>>         </s:complexType>
>>       </s:element>
>>       <s:element name="GetFileBinaryResponse">
>>         <s:complexType>
>>           <s:sequence>
>>             <s:element minOccurs="0" maxOccurs="1" 
>> name="GetFileBinaryResult" type="s:base64Binary" />
>>           </s:sequence>
>>         </s:complexType>
>>       </s:element>
>>     </s:schema>
>>   </wsdl:types>
>>   <wsdl:message name="GetFileBinarySoapIn">
>>     <wsdl:part name="parameters" element="tns:GetFileBinary" />
>>   </wsdl:message>
>>   <wsdl:message name="GetFileBinarySoapOut">
>>     <wsdl:part name="parameters" element="tns:GetFileBinaryResponse" />
>>   </wsdl:message>
>>   <wsdl:portType name="ServiceSoap">
>>     <wsdl:operation name="GetFileBinary">
>>       <wsdl:input message="tns:GetFileBinarySoapIn" />
>>       <wsdl:output message="tns:GetFileBinarySoapOut" />
>>     </wsdl:operation>
>>   </wsdl:portType>
>>   <wsdl:binding name="ServiceSoap" type="tns:ServiceSoap">
>>     <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
>>     <wsdl:operation name="GetFileBinary">
>>       <soap:operation soapAction="http://tempuri.org/GetFileBinary" 
>> 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="ServiceSoap12" type="tns:ServiceSoap">
>>     <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
>>     <wsdl:operation name="GetFileBinary">
>>       <soap12:operation soapAction="http://tempuri.org/GetFileBinary" 
>> 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="Service">
>>     <wsdl:port name="ServiceSoap" binding="tns:ServiceSoap">
>>       <soap:address 
>> location="http://localhost:4891/WebSite2/Service.asmx" />
>>     </wsdl:port>
>>     <wsdl:port name="ServiceSoap12" binding="tns:ServiceSoap12">
>>       <soap12:address 
>> location="http://localhost:4891/WebSite2/Service.asmx" />
>>     </wsdl:port>
>>   </wsdl:service>
>> </wsdl:definitions>
>> socket (6580) can receive 0 bytes atomically
>> socket (6580) retrieved one of its options [level=SOL_SOCKET, 
>> optname=SO_LINGER, l_onoff=0, l_linger=0]
>> socket (6580) closed; bytes received=3275, bytes sent=228
>> socket (6360) created [family=AF_INET, type=SOCK_STREAM, 
>> protocol=IPPROTO_IP, dwFlags=WSA_FLAG_OVERLAPPED]
>> socket (6360) connecting synchronously [name=127.0.0.1:4891]
>> socket (6360) connected
>> socket (6360) determined its local name [name=127.0.0.1:1150]
>> socket (6360) set one of its options [level=IPPROTO_TCP, optname=1]
>> socket (6360) sending data synchronously [len=445]
>> socket (6360) sent 445 bytes of data
>> POST /WebSite2/Service.asmx HTTP/1.1
>> Content-Length: 843
>> Content-Type: Multipart/Related; 
>> action="http://tempuri.org/ServiceSoap/GetFileBinaryRequest"; 
>> type="application/xop+xml"; 
>> boundary="----=_Part_0_25378506.1141338090359"; 
>> start-info="application/soap+xml"
>> Accept: application/soap+xml, application/xop+xml, text/html, 
>> image/gif, image/jpeg, *; q=.2, */*; q=.2
>> User-Agent: Java/1.5.0_06
>> Host: localhost:4891
>> Connection: keep-alive
>>
>> socket (6360) sending data synchronously [len=843]
>> socket (6360) sent 843 bytes of data (Incomplete last line)
>> ------=_Part_0_25378506.1141338090359
>> Content-Type: application/xop+xml; type="application/soap+xml"; 
>> charset=utf-8
>>
>> <?xml version="1.0" ?><soapenv:Envelope 
>> xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" 
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
>> xmlns:ns1="http://tempuri.org/"><soapenv:Header 
>> xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:To>http://localhost:4891/WebSite2/Service.asmx</wsa:To><wsa:MessageID>ebdb46a9-a9c4-478c-9c9d-06f8b02f575c</wsa:MessageID><wsa:ReplyTo><wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address></wsa:ReplyTo><wsa:Action>http://tempuri.org/ServiceSoap/GetFileBinaryRequest</wsa:Action></soapenv:Header><soapenv:Body><ns1:GetFileBinary><ns1:fileName>Home.jpg</ns1:fileName></ns1:GetFileBinary></soapenv:Body></soapenv:Envelope> 
>>
>> ------=_Part_0_25378506.1141338090359--
>> socket (6360) receiving data synchronously [len=8192]
>> socket (6360) received 125 bytes of data
>> HTTP/1.1 100 Continue
>> Server: ASP.NET Development Server/8.0.0.0
>> Date: Thu, 02 Mar 2006 22:21:30 GMT
>> Content-Length: 0
>>
>> socket (6360) receiving data synchronously [len=8067]
>> socket (6360) received 206 bytes of data
>> HTTP/1.1 400 Bad Request
>> Server: ASP.NET Development Server/8.0.0.0
>> Date: Thu, 02 Mar 2006 22:21:31 GMT
>> X-AspNet-Version: 2.0.50727
>> Cache-Control: private
>> Content-Type: text/html
>> Connection: Close
>>
>> detaching from process, socket (6360) closed; bytes received=331, 
>> bytes sent=1288
>> process detached
>> the next process to start and make a socket call will be spyed
>>
>>
>>
>> Vivek Pandey wrote:
>>
>>> [moved to users_at_jax-ws.dev.java.net]
>>>
>>>  From the stack trace it appears that .NET server doesnt like the 
>>> jaxws client REQUEST. Its because .net service once configured for 
>>> MTOM throws 400 Bad Request. This happens because unlike .NET JAXWS 
>>> applies MTOM encoding only when binary optimization is applied on 
>>> the message.
>>>
>>> This happesn if the message payload/header has binary data in it 
>>> (xs:base64Binary) and the data is > 1KB. 1KB size is modifiable. You 
>>> can change it to lets say 0KB in that case all the request/response 
>>> will be MTOM encoded provided they have binary data in it.
>>>
>>> see 
>>> https://jax-ws.dev.java.net/jax-ws-ea3/docs/mtom-swaref.html#2.3_Attach_vs_In-line 
>>> which describes how to change the threshold.
>>>
>>> for example:
>>>
>>>
>>>      
>>> |bindingProvider.getRequestContext().put(JAXWSProperties.MTOM_THRESHOLD_VALUE, 
>>>
>>>      0);|
>>>
>>> will change the default threashold form 1KB to 0.
>>>
>>> If it doesnt fix your problem please send the HTTP traffic, you may 
>>> use HttpSpy or Ethereal.
>>>
>>>
>>> -vivek.
>>>
>>>
>>> Ray Lai wrote:
>>>
>>>> Dear all:
>>>>
>>>> I'm writing a Java client using JWSDP 2.0 with MTOM SOAP 1.2 to 
>>>> invoke a remote .NET service, which provides binary file download 
>>>> using MTOM SOAP 1.2.  The Java client fetches a binary file (e.g. a 
>>>> jpg file) and writes a copy to the local c:\tmp. I encounter some 
>>>> problems in JAX-WS client to interpret the MTOM payload. The MTOM 
>>>> client complains a HTTP 400 error, which I suspect from the error 
>>>> messages that the MTOM client cannot read the MTOM encoded content 
>>>> (which is a jpg file in this example).
>>>>
>>>> I can test the SOAP message (in base64 encoded message, see the 
>>>> details below) provided by the WSDL. In other words, the .NET 
>>>> service should be working OK.  The Java client compiles OK, but has 
>>>> runtime error (refer to the error messages below).
>>>>
>>>> Do you have any suggestion which may go wrong? Did I miss anything 
>>>> in the Java client configuration? Any pointer or suggestion will be 
>>>> helpful.
>>>>
>>>> Thanks.
>>>> rgds, ray
>>>>
>>>> =====================
>>>> Mtom with SOAP 1.2 getFileBinary Service from .NET Server:
>>>>
>>>> WSDL: http://localhost:4891/WebSite2/Service.asmx?wsdl
>>>>
>>>> <?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="GetFileBinary">
>>>>         <s:complexType>
>>>>           <s:sequence>
>>>>             <s:element minOccurs="0" maxOccurs="1" name="fileName" 
>>>> type="s:string" />
>>>>           </s:sequence>
>>>>         </s:complexType>
>>>>       </s:element>
>>>>       <s:element name="GetFileBinaryResponse">
>>>>         <s:complexType>
>>>>           <s:sequence>
>>>>             <s:element minOccurs="0" maxOccurs="1" 
>>>> name="GetFileBinaryResult" type="s:base64Binary" />
>>>>           </s:sequence>
>>>>         </s:complexType>
>>>>       </s:element>
>>>>     </s:schema>
>>>>   </wsdl:types>
>>>>   <wsdl:message name="GetFileBinarySoapIn">
>>>>     <wsdl:part name="parameters" element="tns:GetFileBinary" />
>>>>   </wsdl:message>
>>>>   <wsdl:message name="GetFileBinarySoapOut">
>>>>     <wsdl:part name="parameters" 
>>>> element="tns:GetFileBinaryResponse" />
>>>>   </wsdl:message>
>>>>   <wsdl:portType name="ServiceSoap">
>>>>     <wsdl:operation name="GetFileBinary">
>>>>       <wsdl:input message="tns:GetFileBinarySoapIn" />
>>>>       <wsdl:output message="tns:GetFileBinarySoapOut" />
>>>>     </wsdl:operation>
>>>>   </wsdl:portType>
>>>>   <wsdl:binding name="ServiceSoap" type="tns:ServiceSoap">
>>>>     <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
>>>>     <wsdl:operation name="GetFileBinary">
>>>>       <soap:operation soapAction="http://tempuri.org/GetFileBinary" 
>>>> 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="ServiceSoap12" type="tns:ServiceSoap">
>>>>     <soap12:binding 
>>>> transport="http://schemas.xmlsoap.org/soap/http" />
>>>>     <wsdl:operation name="GetFileBinary">
>>>>       <soap12:operation 
>>>> soapAction="http://tempuri.org/GetFileBinary" 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="Service">
>>>>     <wsdl:port name="ServiceSoap" binding="tns:ServiceSoap">
>>>>       <soap:address 
>>>> location="http://localhost:4891/WebSite2/Service.asmx" />
>>>>     </wsdl:port>
>>>>     <wsdl:port name="ServiceSoap12" binding="tns:ServiceSoap12">
>>>>       <soap12:address 
>>>> location="http://localhost:4891/WebSite2/Service.asmx" />
>>>>     </wsdl:port>
>>>>   </wsdl:service>
>>>> </wsdl:definitions>
>>>>
>>>> Invoking the URL 
>>>> http://localhost:4891/WebSite2/Service.asmx/GetFileBinary will 
>>>> return the following SOAP message:
>>>>
>>>> <?xml version="1.0" encoding="utf-8" ?>
>>>> <base64Binary 
>>>> xmlns="http://tempuri.org/">/9j/4AAQSkZJRgABAgEASABIAAD/5PxZumk4zHanByR1ZqDqzVkjMKSY5jtTgRJyK 
>>>>
>>>> ...
>>>> drjD9D2N3cEdQMRCROki2n3Ypeq3de0Y6gSGIYZL89Qr9ScYfaAG2CbEBfFIQfbio45oYXe6+IQg+3CrS1Sam+S+GQg//9k=</base64Binary> 
>>>>
>>>>
>>>> =====================
>>>> Java client source code:
>>>>
>>>> import com.javadotnet.interop.generated.*;
>>>> import java.io.FileOutputStream;
>>>> import java.io.IOException;
>>>> import javax.xml.ws.BindingProvider;
>>>> import javax.xml.ws.soap.SOAPBinding;
>>>>
>>>> public class DotNetWSClient {
>>>>
>>>>     /** Creates a new instance of DotNetWSClient */
>>>>     public DotNetWSClient() {
>>>>
>>>>         ServiceSoap port = new Service().getServiceSoap12();
>>>>
>>>>         SOAPBinding binding = 
>>>> (SOAPBinding)((BindingProvider)port).getBinding();
>>>>         binding.setMTOMEnabled(true);
>>>>
>>>>
>>>>         try {
>>>>             byte[] fileData = port.getFileBinary("Home.jpg");
>>>>
>>>>             FileOutputStream fos = new 
>>>> FileOutputStream("C:\\tmp\\Home.jpg");
>>>>             fos.write(fileData);
>>>>             fos.flush();
>>>>             fos.close();
>>>>         } catch (IOException ex) {
>>>>             ex.printStackTrace();
>>>>         }
>>>>     }
>>>>
>>>>     public static void main(String args[]) {
>>>>         new DotNetWSClient();
>>>>     }
>>>>
>>>> }
>>>>
>>>> ===================
>>>>
>>>>
>>>> Running from Command Prompt:
>>>>
>>>> C:\dev\DotNetWSClient2\dist>java -cp 
>>>> ./DotNetWSClient2.jar;C:\tools\jaxws\lib\ja
>>>> xws-api.jar;C:\tools\jaxws\lib\jaxws-rt.jar;C:\tools\jaxws\lib\jaxws-tools.jar 
>>>> c
>>>> om.javadotnet.interop.DotNetWSClient
>>>> Exception in thread "main" javax.xml.ws.WebServiceException: 
>>>> unexpected XML read
>>>> er state. expected: END_ELEMENT but found: CHARACTERS
>>>>         at 
>>>> com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toInternalMessage(
>>>> SOAPXMLDecoder.java:263)
>>>>         at 
>>>> com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.receive(SOA
>>>> PMessageDispatcher.java:529)
>>>>         at 
>>>> com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doSend(SOAP
>>>> MessageDispatcher.java:253)
>>>>         at 
>>>> com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.send(SOAPMe
>>>> ssageDispatcher.java:112)
>>>>         at 
>>>> com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.
>>>> java:84)
>>>>         at 
>>>> com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod(
>>>> EndpointIFInvocationHandler.java:171)
>>>>         at 
>>>> com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFIn
>>>> vocationHandler.java:105)
>>>>         at $Proxy18.getFileBinary(Unknown Source)
>>>>         at 
>>>> com.javadotnet.interop.DotNetWSClient.<init>(DotNetWSClient.java:38)
>>>>         at 
>>>> com.javadotnet.interop.DotNetWSClient.main(DotNetWSClient.java:56)
>>>> Caused by: unexpected XML reader state. expected: END_ELEMENT but 
>>>> found: CHARACT
>>>> ERS
>>>>         at 
>>>> com.sun.xml.ws.streaming.XMLStreamReaderUtil.verifyReaderState(XMLStr
>>>> eamReaderUtil.java:193)
>>>>         at 
>>>> com.sun.xml.ws.encoding.soap.client.SOAP12XMLDecoder.readFaultReasonT
>>>> exts(SOAP12XMLDecoder.java:214)
>>>>         at 
>>>> com.sun.xml.ws.encoding.soap.client.SOAP12XMLDecoder.readFaultReason(
>>>> SOAP12XMLDecoder.java:185)
>>>>         at 
>>>> com.sun.xml.ws.encoding.soap.client.SOAP12XMLDecoder.decodeFault(SOAP
>>>> 12XMLDecoder.java:104)
>>>>         at 
>>>> com.sun.xml.ws.encoding.soap.SOAPDecoder.decodeBodyContent(SOAPDecode
>>>> r.java:340)
>>>>         at 
>>>> com.sun.xml.ws.encoding.soap.SOAPDecoder.decodeBody(SOAPDecoder.java:
>>>> 325)
>>>>         at 
>>>> com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.decodeBody(SOAPXML
>>>> Decoder.java:188)
>>>>         at 
>>>> com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.decodeEnvelope(SOA
>>>> PXMLDecoder.java:139)
>>>>         at 
>>>> com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toInternalMessage(
>>>> SOAPXMLDecoder.java:256)
>>>>         ... 9 more
>>>>
>>>>
>>>> Running from NetBeans 5.0 IDE:
>>>>
>>>> init:
>>>> deps-jar:
>>>> running wsimport
>>>> warning: SOAP port "ServiceSoap12": uses a non-standard SOAP 1.2 
>>>> binding.
>>>>
>>>> compile:
>>>> run:
>>>> HTTP Status-Code 400: Bad Request
>>>>         at 
>>>> com.sun.xml.ws.transport.http.client.HttpClientTransport.checkResponseCode(HttpClientTransport.java:300) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.transport.http.client.HttpClientTransport.getHeaders(HttpClientTransport.java:153) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPConnectionUtil.java:58) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toSOAPMessage(SOAPXMLDecoder.java:97) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:459) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:291) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.send(SOAPMessageDispatcher.java:157) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.java:85) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:177) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:105) 
>>>>
>>>>         at $Proxy24.getFileBinary(Unknown Source)
>>>>         at 
>>>> com.javadotnet.interop.DotNetWSClient.<init>(DotNetWSClient.java:38)
>>>>         at 
>>>> com.javadotnet.interop.DotNetWSClient.main(DotNetWSClient.java:56)
>>>> Exception in thread "main" javax.xml.ws.WebServiceException: HTTP 
>>>> Status-Code 400: Bad Request
>>>>         at 
>>>> com.sun.xml.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPConnectionUtil.java:82) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toSOAPMessage(SOAPXMLDecoder.java:97) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:459) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:291) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.send(SOAPMessageDispatcher.java:157) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.java:85) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:177) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:105) 
>>>>
>>>>         at $Proxy24.getFileBinary(Unknown Source)
>>>>         at 
>>>> com.javadotnet.interop.DotNetWSClient.<init>(DotNetWSClient.java:38)
>>>>         at 
>>>> com.javadotnet.interop.DotNetWSClient.main(DotNetWSClient.java:56)
>>>> Caused by: HTTP Status-Code 400: Bad Request
>>>>         at 
>>>> com.sun.xml.ws.transport.http.client.HttpClientTransport.checkResponseCode(HttpClientTransport.java:300) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.transport.http.client.HttpClientTransport.getHeaders(HttpClientTransport.java:153) 
>>>>
>>>>         at 
>>>> com.sun.xml.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPConnectionUtil.java:58) 
>>>>
>>>>         ... 10 more
>>>> Java Result: 1
>>>> BUILD SUCCESSFUL (total time: 7 seconds)
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe_at_jwsdp.dev.java.net
>>>> For additional commands, e-mail: users-help_at_jwsdp.dev.java.net
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
>> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>>
>
-- 
Vivek Pandey
Web Services Standards and Technologies
Sun Microsystems Inc.