Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need Help in passing a string Array as a attachment

Tony Evans
Ranch Hand
Posts: 598
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to pass a String Array as a Soap attachment, but am slightly confused over the way to do it.

The javax.activation.DataHandler constructor takes one of three constructors:

public DataHandler(DataSource ds)
Creates a DataHandler instance with the specified DataSource.

public DataHandler(java.lang.Object obj,
java.lang.String mimeType)

public DataHandler( url)
url - a URL object

I two I am interested in is DataHandler(DataSource ds) and
DataHandler(java.lang.Object obj, java.lang.String mimeType)

Would I be right in saying that forthe second, I could only pass, an image, a string MimeMultiPart and a transform source since they are the only four with MIME type counterparts. If I am wrong does a Array of String have a MIME type counterpart.

Or do I have to convert my Array of String into a datasource, and if so are there any examples of this. The only examples I have seen use readymafe datasourses such as fileDataSourse and ByteArrayDataSource.

Thanks for any help

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic