Petals SE JSR181

JAXWS-style attachment handling does not work

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Won't Fix
  • Affects Version/s: 1.1.4
  • Fix Version/s: 1.3.0
  • Component/s: None
  • Security Level: Public
  • Description:
    Hide

    When trying to pass a DataHandler as an argument to a WebMethod (see below), the DataHandler does not point to valid data (if redirected to a file, the file content is irrelevant).

    Workaround: use Petals attachments (with CDK APIs). The same code works fine, then.

    //JSR181 main class
    //...
    @WebMethod( operationName="display" )
    public void display(@WebParam( name="image" ) ImageData image) { ... }
    
    // ImageData.java
    //...
    @XmlType
    public class ImageData {
      private DataHandler fileContent;
      @XmlMimeType("application/octet-stream")
      public DataHandler getFileContent() {
          return this.fileContent;
      }
    
      public void setFileContent(DataHandler fileContent) {
          this.fileContent = fileContent;
      }
    }
    Show
    When trying to pass a DataHandler as an argument to a WebMethod (see below), the DataHandler does not point to valid data (if redirected to a file, the file content is irrelevant). Workaround: use Petals attachments (with CDK APIs). The same code works fine, then.
    //JSR181 main class
    //...
    @WebMethod( operationName="display" )
    public void display(@WebParam( name="image" ) ImageData image) { ... }
    
    // ImageData.java
    //...
    @XmlType
    public class ImageData {
      private DataHandler fileContent;
      @XmlMimeType("application/octet-stream")
      public DataHandler getFileContent() {
          return this.fileContent;
      }
    
      public void setFileContent(DataHandler fileContent) {
          this.fileContent = fileContent;
      }
    }
  • Environment:
    Petals 4.

Activity

Hide
Vincent Zurczak added a comment - Tue, 10 Apr 2012 - 18:37:36 +0200 - edited

Actually, this use case works fine.
Checked with SoapUI (the cid property is in fact defined by the part column and not the contentID one). You can also specify SoapUI to use MTOM in the request properties.

Some log entries have been added in the code and will be committed.
In addition, a new example will be added to the JSR-181 use cases.

Show
Vincent Zurczak added a comment - Tue, 10 Apr 2012 - 18:37:36 +0200 - edited Actually, this use case works fine. Checked with SoapUI (the cid property is in fact defined by the part column and not the contentID one). You can also specify SoapUI to use MTOM in the request properties. Some log entries have been added in the code and will be committed. In addition, a new example will be added to the JSR-181 use cases.
Vincent Zurczak made changes - Tue, 10 Apr 2012 - 18:37:36 +0200
Field Original Value New Value
Resolution Won't Fix [ 2 ]
Status New [ 10000 ] Resolved [ 10004 ]
Vincent Zurczak made changes - Tue, 10 Apr 2012 - 18:38:00 +0200
Priority Blocker [ 1 ]
Description When trying to pass a DataHandler as an argument to a WebMethod (see below), the DataHandler does not point to valid data (if redirected to a file, the file content is irrelevant).

Workaround: use Petals attachments (with CDK APIs). The same code works fine, then.

//JSR181 main class
//...
@WebMethod( operationName="display" )
public void display(@WebParam( name="image" ) ImageData image) { ... }

// ImageData.java
//...
@XmlType
public class ImageData {
  private DataHandler fileContent;
  @XmlMimeType("application/octet-stream")
  public DataHandler getFileContent() {
      return this.fileContent;
  }

  public void setFileContent(DataHandler fileContent) {
      this.fileContent = fileContent;
  }
}
When trying to pass a DataHandler as an argument to a WebMethod (see below), the DataHandler does not point to valid data (if redirected to a file, the file content is irrelevant).

Workaround: use Petals attachments (with CDK APIs). The same code works fine, then.

{code}
//JSR181 main class
//...
@WebMethod( operationName="display" )
public void display(@WebParam( name="image" ) ImageData image) { ... }

// ImageData.java
//...
@XmlType
public class ImageData {
  private DataHandler fileContent;
  @XmlMimeType("application/octet-stream")
  public DataHandler getFileContent() {
      return this.fileContent;
  }

  public void setFileContent(DataHandler fileContent) {
      this.fileContent = fileContent;
  }
}
{code}
Vincent Zurczak made changes - Tue, 10 Apr 2012 - 19:21:04 +0200
Status Resolved [ 10004 ] Closed [ 10005 ]
Fix Version/s 1.3.0 [ 10346 ]
Transition Status Change Time Execution Times Last Executer Last Execution Date
New New Resolved Resolved
33d 40m
1
Vincent Zurczak
Tue, 10 Apr 2012 - 18:37:36 +0200
Resolved Resolved Closed Closed
43m 28s
1
Vincent Zurczak
Tue, 10 Apr 2012 - 19:21:04 +0200



People

Dates

  • Created:
    Thu, 8 Mar 2012 - 16:57:04 +0100
    Updated:
    Wed, 11 Apr 2012 - 10:48:46 +0200
    Resolved:
    Tue, 10 Apr 2012 - 18:37:36 +0200