This should not be too hard.
Let's take 5 to 10 minutes to get it to work.
1) start with an interface:
public interface ImageService{ public void sendImage(DataHandler data); }
save that to a file named ImageService.java
Also, add proper package for the class and import statements for DataHandler.
2) Use Java2Wsdl to generate the Wsdl file. You can open and see if it work or not.
3) Use Wsdl2Java to generate all the stubs and whatnots.
4) Implement your sever:
public void sendImage(DataHandler data){
try{
//data.getInputStream();
//the above is the binary data for your image, save it to file, or do whatever it takes. Do
//not print it out to the screen, because you'll get alot of beeps.
}catch(Exception e){ e.printStackTrace(); } }
5) Deploy the server by compiling all your stuffs, copy to the server's classes directory and also copy the content of deploy.wsdl to the axis config file.
6) Write the client:
public void send myStuff(String imageFileName){
try{
DataHandler data = null;
FileDataSource fds = new FileDataSource(imageFileName); //assume it's in a file for now, play with it if it's not
data = new DataHandler(fds);
ImageService service = null;
//Create a new service locator for ImageService , note that this is generated by Wsdl2Java
//set the server's address:
//set whatever thing you need such as document or whatever, this is optional, after getting this to work, do this later.
//call the service service.sendImage(data);
}catch(Exception e){
}
}
Note that I haven't test this code, but it should work with minor twist.