Thanks for the help, Thilina. Here's a little clarification of my situation:
* I'm creating both the client and server side functionality from my WSDL, so I don't really have to worry about someone else reading or writing to the field. * My use case is basically to use the xs:base64Binary field to pass a long string that holds space-delimited integers ("0 23 532 12"). The field is contained in some of my WSDL messages. Inside my server-side code, I'm trying to create sample datasets which include the xs:base64Binary object. Unfortunately, I'm not quite able to figure out how to use the DataHandler class and DataSource interface. So, the simplest code fragment to show what I'd like to do is: public DataHandler convertStringToBase64Binary (String myString) { // Example myString value = "0 23 532 12"; DataHandler myBase64BinaryField; // Constructor for DataHandler... // Insert miracle here, where myString data is sent // to the dataHandler object and turned into // base64 data. return myBase64BinaryField; } It would be interesting to see the other direction (i.e. DataHandler to String) as well. * As I mentioned in my previous message, the easy solution is to just send the data as an xs:string, which works for me since I'm creating both the client- and the server-sides of the web service. That said, I am still interested in understanding the mechanics of DataHandler. Thanks again, Matt Fadoul My3D, LLC -----Original Message----- From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] Sent: Thursday, February 28, 2008 9:45 AM To: axis-user@ws.apache.org Subject: Re: Problem with xs:base64Binary Hi, > 2) The code examples that I found for DataHandler generally involve things > like files, etc. Yep... It can even be a byte[].. base64Binary data type stands for base64 encoded binary data.. Hence everything that involves Datahandlers work in binary(byte) level.. > For example: > http://ws.apache.org/axis2/1_2/mtom-guide.html#21 > (Note: It seems that the lines of code with OMText aren't complete). ouch... Please use the newest version.. It seems to be complete.. http://ws.apache.org/axis2/1_3/mtom-guide.html#21 > 3) In my case, my data is much simpler. For example, if I could populate > the field with a string (e.g. "0 23 532 12"), that would be sufficient. What's your exact use case.. What are you trying to send in that field.. Do you already have a base64 encoded string with you?? > My quick solution is to just change this field's type to xs:string. The > reason I'd like to keep it xs:base64binary is because it's someone else's > schema, so I wanted to stay faithful to their data types. Please find out what kind of data (semantics) is he expecting, whether it's image or a signature etc... It's ok to change it to string.. But you would need to make sure to set the content to a base64 encoded string of the expected type.. thanks, Thilina > > Thanks! > > Matt Fadoul > > My3D, LLC --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]