axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "skudx (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AXIS2-3245) mtom - (axis 1.3 vs jax-ws ri JAX-WS RI 2.1.2)
Date Tue, 09 Oct 2007 21:45:51 GMT

    [ https://issues.apache.org/jira/browse/AXIS2-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533524
] 

skudx commented on AXIS2-3245:
------------------------------

duh, someone seen this before...

Pl chk http://www.nabble.com/-Axis2-1.2--Axis2-attachment-interoperability----tf3906797.html#a11094058

Axis2 developers state that start parameter is recommended & it is optional. However,
both axis-2 & jax-ws-ri seem to force it as "must"/ "must not" resp.

> mtom - (axis 1.3 vs jax-ws ri JAX-WS RI 2.1.2)
> ----------------------------------------------
>
>                 Key: AXIS2-3245
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3245
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.3
>         Environment: windows xp/ java 1.4 (axis) & java 1.5.0_06 (+jax-ws ri 2.1.2)
>            Reporter: skudx
>
> Used the followng wsdl to generate a jax-ws ri-based server. The server is launched using
endpoint.publish.
> <wsdl:definitions xmlns:tns="http://ws.apache.org/axis2/mtomsample/"
>         xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
>         xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
>         xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
>         xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
>         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>         xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>         xmlns="http://schemas.xmlsoap.org/wsdl/"
>         targetNamespace="http://ws.apache.org/axis2/mtomsample/">
>         <wsdl:types>
>                 <xsd:schema xmlns="http://schemas.xmlsoap.org/wsdl/"
>                         attributeFormDefault="qualified" elementFormDefault="qualified"
>                         targetNamespace="http://ws.apache.org/axis2/mtomsample/">
>                         <xsd:import namespace="http://www.w3.org/2005/05/xmlmime"
>                                 schemaLocation="http://www.w3.org/2005/05/xmlmime" />
>                         <xsd:complexType name="AttachmentType">
>                                 <xsd:sequence>
>                                         <xsd:element minOccurs="0" name="fileName"
>                                                 type="xsd:string" />
>                                         <xsd:element minOccurs="0" name="binaryData"

>                                                 xmime:expectedContentTypes="*/*" type="xsd:base64Binary"
/>
>                                 </xsd:sequence>
>                         </xsd:complexType>
>                         <xsd:element name="AttachmentRequest" type="tns:AttachmentType"
/>
>                         <xsd:element name="AttachmentResponse" type="tns:AttachmentType"
/>
>                 </xsd:schema>
>         </wsdl:types>
>         <wsdl:message name="AttachmentRequest">
>                 <wsdl:part name="part1" element="tns:AttachmentRequest" />
>         </wsdl:message>
>         <wsdl:message name="AttachmentResponse">
>                 <wsdl:part name="part1" element="tns:AttachmentResponse" />
>         </wsdl:message>
>         <wsdl:portType name="MTOMServicePortType">
>                 <wsdl:operation name="attachment">
>                         <wsdl:input message="tns:AttachmentRequest"
>                                 wsaw:Action="attachment" />
>                         <wsdl:output message="tns:AttachmentResponse"
>                                 wsaw:Action="http://schemas.xmlsoap.org/wsdl/MTOMServicePortType/AttachmentResponse"
/>
>                 </wsdl:operation>
>         </wsdl:portType>
>         <wsdl:binding name="MTOMServiceSOAP11Binding"
>                 type="tns:MTOMServicePortType">
>                 <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
>                         style="document" />
>                 <wsdl:operation name="attachment">
>                         <soap:operation soapAction="attachment" style="document" />
>                         <wsdl:input>
>                                 <soap:body use="literal" />
>                         </wsdl:input>
>                         <wsdl:output>
>                                 <soap:body use="literal" />
>                         </wsdl:output>
>                 </wsdl:operation>
>         </wsdl:binding>
>         <wsdl:service name="MTOMSample">
>                 <wsdl:port name="MTOMSampleSOAP11port_http"
>                         binding="tns:MTOMServiceSOAP11Binding">
>                         <soap:address
>                                 location="http://localhost:8080/axis2/services/MTOMSample"
/>
>                 </wsdl:port>
>         </wsdl:service>
> </wsdl:definitions>
> Generated axis client using options: -s -p axisc -ssi -uri http://localhost:2000/coo?wsdl.
> package axisc;
> import java.io.ByteArrayInputStream;
> import java.io.ByteArrayOutputStream;
> import java.io.IOException;
> import java.io.InputStream;
> import java.io.OutputStream;
> import javax.activation.DataHandler;
> import javax.activation.DataSource;
> import org.apache.axis2.Constants;
> import org.apache.axis2.client.Options;
> import axisc.DemoServerServiceStub.AttachmentRequest;
> import axisc.DemoServerServiceStub.AttachmentResponse;
> import axisc.DemoServerServiceStub.AttachmentType;
> public class AxisDhC {
>     /**
>      * @param args
>      * @throws IOException 
>      */
>     public static void main(String[] args) throws IOException {
>         // TODO Auto-generated method stub
>         DemoServerServiceStub dhd = new DemoServerServiceStub();
>         Options options = new Options();
>         options.setProperty(  Constants.Configuration.TRANSPORT_URL, "http://localhost:8001/coo");
>         options.setProperty(Constants.Configuration.ENABLE_MTOM, "true");      
>         dhd._getServiceClient().setOverrideOptions(options);
>         DataHandler dh1 = new DataHandler(new DataSource(){
>             public String getContentType() {
>                 // TODO Auto-generated method stub
>                 return "text/xml";
>             }
>             public InputStream getInputStream() throws IOException {
>                 ByteArrayInputStream bais =
>                     new ByteArrayInputStream("<xml><ax>b</ax></xml>".getBytes());
>                 return bais;
>             }
>             public String getName() {
>                 return "sample.xml";
>             }
>             public OutputStream getOutputStream() throws IOException {
>                 // TODO Auto-generated method stub
>                 return null;
>             }});
>         
>         AttachmentType dw = new AttachmentType();
>         dw.setBinaryData(dh1);
>         
>         AttachmentRequest ar = new AttachmentRequest();
>         ar.setAttachmentRequest(dw);
>         AttachmentResponse dwr = dhd.attachment(ar);
>         dump(dwr.getAttachmentResponse().getBinaryData());        
>     }
>     private static void dump(DataHandler dh2) throws IOException {
>         System.out.println("type: " + dh2.getContentType());
>         System.out.println("name: " + dh2.getName());
>         System.out.println("content: " + dh2.getContent()); 
>         System.out.println("ds: " + dh2.getDataSource());         
>         ByteArrayOutputStream baos = new ByteArrayOutputStream();
>         InputStream is = dh2.getInputStream();
>         int ch = -1;
>         while((ch = is.read()) != -1) {
>             baos.write(ch);
>         }
>         baos.flush();
>         baos.close();
>         is.close();
>         System.out.println("content: " + baos.toString());
>     }
> }
> If I enable mtom, the jax-ws server reports the following error:
> java.lang.NullPointerException
> 	at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:322)
> 	at com.sun.xml.ws.encoding.MimeCodec.decode(MimeCodec.java:116)
> 	at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:272)
> 	at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:262)
> 	at com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:79)
> 	at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:418)
> 	at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:230)
> 	at com.sun.xml.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:92)
> 	at com.sun.xml.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:77)
> 	at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> 	at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
> 	at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
> 	at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:575)
> 	at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> 	at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:547)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> 	at java.lang.Thread.run(Thread.java:595)
> java.lang.NullPointerException
> 	at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:322)
> 	at com.sun.xml.ws.encoding.MimeCodec.decode(MimeCodec.java:116)
> 	at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:272)
> 	at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:262)
> 	at com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:79)
> 	at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:418)
> 	at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:230)
> 	at com.sun.xml.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:92)
> 	at com.sun.xml.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:77)
> 	at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> 	at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
> 	at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
> 	at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:575)
> 	at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> 	at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:547)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> 	at java.lang.Thread.run(Thread.java:595)
> java.lang.NullPointerException
> 	at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:322)
> 	at com.sun.xml.ws.encoding.MimeCodec.decode(MimeCodec.java:116)
> 	at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:272)
> 	at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:262)
> 	at com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:79)
> 	at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:418)
> 	at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:230)
> 	at com.sun.xml.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:92)
> 	at com.sun.xml.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:77)
> 	at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> 	at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
> 	at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
> 	at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:575)
> 	at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> 	at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:547)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> 	at java.lang.Thread.run(Thread.java:595)
> java.lang.NullPointerException
> 	at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:322)
> 	at com.sun.xml.ws.encoding.MimeCodec.decode(MimeCodec.java:116)
> 	at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:272)
> 	at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:262)
> 	at com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:79)
> 	at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:418)
> 	at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:230)
> 	at com.sun.xml.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:92)
> 	at com.sun.xml.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:77)
> 	at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> 	at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
> 	at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
> 	at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:575)
> 	at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
> 	at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:547)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> 	at java.lang.Thread.run(Thread.java:595)
> & the client reports a fault..
> org.apache.axis2.AxisFault: The server localhost failed to respond
> 	at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
> ....
> Works fine, if I disable MTOM on axis 2 client. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message