Hi

i also had a problem with downloading file in JSF-Context. Downgrading CXF2.2.3 to CXF2.2.2 fixes the problem in my case.

In my case uploading worked fine. Downloading fails with receiving empty attachments. I think its a problem with default ininterceptors.

The funny or not funny aspect is that its working with 2.2.3 in junit-testcases outside of the servlet-context.

Regards Jakob

@Daniel Kulp: Sry that I'm a little to busy these days to create a small testcase for you.

Michael Albrecht schrieb:
I've got no running testcase without installing inubit suite as a web service server.

But I can send you the wsdl and the soap response to compare it to your running examples.

I hope you can give me a small hint what I have to consider.
Be aware that this all is running for small files.

Michael

WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
targetNamespace="http://my.server.de:8000/ibis/ws/1250689804680/MyProject-downloadMyDocument";>
   <wsdl:documentation>IBIS Web Service</wsdl:documentation>

   <wsdl:types>

      <schema attributeFormDefault="unqualified"
         elementFormDefault="unqualified"
targetNamespace="http://my.server.de:8000/ibis/ws/1250689804680/MyProject-downloadMyDocument";>

         <element name="downloadMyDocument">

            <complexType>

               <sequence>

                  <element name="fileRequest">

                     <complexType>

                        <sequence>
                           <element name="filename" type="xs:string" />
                           <element name="dir" type="xs:string" />
                           <element name="filesize" type="xs:integer" />
                        </sequence>
                     </complexType>
                  </element>
               </sequence>
            </complexType>
         </element>

         <element name="downloadMyDocumentResponse">

            <complexType>

               <sequence>
                  <element minOccurs="0" name="report"
                     type="xmime:base64Binary" />
               </sequence>
            </complexType>
         </element>
      </schema>

      <xsd:schema attributeFormDefault="unqualified"
elementFormDefault="unqualified" targetNamespace="http://www.w3.org/2005/05/xmlmime";>

         <xsd:attribute name="contentType">

            <xsd:simpleType>

               <xsd:restriction base="xs:string">
                  <xsd:minLength value="3" />
               </xsd:restriction>
            </xsd:simpleType>
         </xsd:attribute>
         <xsd:attribute name="expectedContentTypes" type="xs:string" />

         <xsd:complexType name="base64Binary">

            <xsd:simpleContent>

               <xsd:extension base="xs:base64Binary">
                  <xsd:attribute ref="xmime:contentType" />
               </xsd:extension>
            </xsd:simpleContent>
         </xsd:complexType>

         <xsd:complexType name="hexBinary">

            <xsd:simpleContent>

               <xsd:extension base="xs:hexBinary">
                  <xsd:attribute ref="xmime:contentType" />
               </xsd:extension>
            </xsd:simpleContent>
         </xsd:complexType>
      </xsd:schema>
   </wsdl:types>

   <wsdl:message name="downloadMyDocument">
      <wsdl:part name="part1" element="wsc:downloadMyDocument" />
   </wsdl:message>

   <wsdl:message name="downloadMyDocumentResponse">
      <wsdl:part name="part1" element="wsc:downloadMyDocumentResponse" />
   </wsdl:message>

   <wsdl:portType name="MyProject-downloadMyDocumentPortType">

      <wsdl:operation name="downloadMyDocument">
         <wsdl:input message="wsc:downloadMyDocument"
            wsaw:Action="downloadMyDocument" />
         <wsdl:output message="wsc:downloadMyDocumentResponse"
wsaw:Action="http://my.server.de:8000/ibis/ws/1250689804680/MyProject-downloadMyDocument/MyProject-downloadMyDocumentPortType/downloadMyDocumentResponse"; />
      </wsdl:operation>
   </wsdl:portType>

   <wsdl:binding name="MyProject-downloadMyDocumentSOAP11Binding"
      type="wsc:MyProject-downloadMyDocumentPortType">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http";
         style="document" />

      <wsdl:operation name="downloadMyDocument">
         <soap:operation soapAction="downloadMyDocument"
            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="MyProject-downloadMyDocumentSOAP12Binding"
      type="wsc:MyProject-downloadMyDocumentPortType">
      <soap12:binding transport="http://schemas.xmlsoap.org/soap/http";
         style="document" />

      <wsdl:operation name="downloadMyDocument">
         <soap12:operation soapAction="downloadMyDocument"
            style="document" />

         <wsdl:input>
            <soap12:body use="literal" />
         </wsdl:input>

         <wsdl:output>
            <soap12:body use="literal" />
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>

   <wsdl:binding name="MyProject-downloadMyDocumentHttpBinding"
      type="wsc:MyProject-downloadMyDocumentPortType">
      <http:binding verb="POST" />

      <wsdl:operation name="downloadMyDocument">
         <http:operation location="downloadMyDocument" />

         <wsdl:input>
            <mime:content type="text/xml" />
         </wsdl:input>

         <wsdl:output>
            <mime:content type="text/xml" />
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>

   <wsdl:service name="MyProject-downloadMyDocument">

      <wsdl:port name="MyProject-downloadMyDocumentSOAP11port_http"
         binding="wsc:MyProject-downloadMyDocumentSOAP11Binding">
         <soap:address
location="http://my.server.de:8000/ibis/services/MyProject-downloadMyDocument"; />
      </wsdl:port>

      <wsdl:port name="MyProject-downloadMyDocumentSOAP12port_http"
         binding="wsc:MyProject-downloadMyDocumentSOAP12Binding">
         <soap12:address
location="http://my.server.de:8000/ibis/services/MyProject-downloadMyDocument"; />
      </wsdl:port>

      <wsdl:port name="MyProject-downloadMyDocumentHttpport1"
         binding="wsc:MyProject-downloadMyDocumentHttpBinding">
         <http:address
location="http://my.server.de:8000/ibis/rest/MyProject-downloadMyDocument"; />
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>

SOAP Response:
HTTP/1.1 200 OK
X-Powered-By: Servlet 2.4; JBoss-4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)/Tomcat-5.5 Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_AF9B8A94BBAD4DC7FE1252999286320; type="application/xop+xml"; start="<0.urn:uuid:[email protected]>"; start-info="text/xml";charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 15 Sep 2009 07:21:26 GMT
Server: Apache

--MIMEBoundaryurn_uuid_AF9B8A94BBAD4DC7FE1252999286320
content-type: application/xop+xml; charset=UTF-8; type="text/xml";
content-transfer-encoding: binary
content-id: <0.urn:uuid:[email protected]>

<?xml version='1.0' encoding='UTF-8'?>
<isns:Envelope
   xmlns:xmime="http://www.w3.org/2005/05/xmlmime";
xmlns:wsc="http://my.server.de:8000/ibis/ws/1250689804680/MyProject-downloadSlmReport";
   xmlns:isns="http://schemas.xmlsoap.org/soap/envelope/";>
   <isns:Header
      xmlns:isns="http://schemas.xmlsoap.org/soap/envelope/"; />
   <isns:Body xmlns:isns="http://schemas.xmlsoap.org/soap/envelope/";>
<wsc:downloadSlmReportResponse xmlns:wsc="http://my.server.de:8000/ibis/ws/1250689804680/MyProject-downloadSlmReport";> <report xmlns:xmime="http://www.w3.org/2005/05/xmlmime"; xmime:contentType="application/octet-stream"> <xop:Include href="cid:1.urn:uuid:[email protected]" xmlns:xop="http://www.w3.org/2004/08/xop/include"; />
         </report>
      </wsc:downloadSlmReportResponse>
   </isns:Body>
</isns:Envelope>
--MIMEBoundaryurn_uuid_AF9B8A94BBAD4DC7FE1252999286320
content-type: application/octet-stream
content-transfer-encoding: binary
content-id: <1.urn:uuid:[email protected]>

%PDF-1.4
***
2 0 obj
<</Length 3 0 R/Filter/FlateDecode>>
stream
***



Zitat von Daniel Kulp <[email protected]>:


Any chance you can create a small testcase that shows this? We definitely
have several tests that echo rather large attachments back and forth and
everything seems OK.  (at least with CXF 2.2.3, might try upgrading)

Dan


On Mon September 14 2009 10:13:53 am Michael Albrecht wrote:
Hi @all!

I've got a single web service routine (implemented with the BPM Suite
inubit 5.*) which is sending a PDF file as a mtom attachment of the ws
call.

If I test this method with soap UI everything is ok. I can read the
PDF file as a soap attachment.

If I test this method with my JSF application using CFX my client
method returns all PDF file lower some kilo bytes (~20kB). Bigger
attachments will be cut. I don't know why?!

Does anyone know why this method call is limited?!

Here are my environment parameter:
- multi-module project built by Maven
Apache Maven 2.2.0
Java version: 1.6.0_13

- generation of the WebService stubs:
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<executions>
    <execution>
       <id>wsimport myService</id>
       <goals>
       <goal>wsimport</goal>
       </goals>
       <configuration>
       ...
    </execution>
    ...
<executions>

<dependencies>
          <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-frontend-jaxws</artifactId>
             <version>2.2.3</version>
             <exclusions>
                <!--

http://www.jroller.com/melix/entry/apache_cxf_maven_javamail_awful
                -->
                <exclusion>
                   <groupId>org.apache.geronimo.specs</groupId>
                   <artifactId>geronimo-javamail_1.4_spec</artifactId>
                </exclusion>
                <exclusion>
                   <groupId>org.apache.geronimo.specs</groupId>
                   <artifactId>geronimo-activation_1.1_spec</artifactId>
                </exclusion>
             </exclusions>
          </dependency>
          <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-transports-http</artifactId>
             <version>2.2.3</version>
          </dependency>
          <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-databinding-aegis</artifactId>
             <version>2.2.3</version>
          </dependency>
          <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-codegen-plugin</artifactId>
             <version>2.2.3</version>
          </dependency>
</dependencies>

Can anyone help me?
Did I ignore some wellknown facts?

BTW uploading files to the inubit server as a web service client works
as well as sending the list of uploaded files. But downloading is
limited.

Thanks in advance.

Michael


--
Daniel Kulp
[email protected]
http://www.dankulp.com/blog






Reply via email to