Nice scenario. You have couple of ways to do this.
1. You can create an MTOM attachment, which in turn is an OMText, from your zip files and hook that up to the SOAP body. Write your own message receiver or if the client needs a feedback, use the RawXMLInOutSyncMessageReceiver. Write your service implementation class to work on OM, which will get the body of the SOAP message. Since OM treats the MTOM attachments as OMText, the service implementation can get the OMText which contains the attachment and using the data handler, you can retrieve the attachment in the server side. Then use your logic of unzipping, saving to db or whatever. 2. Create an xml file out of the contents of the zip file you need to send to the server and hook that bit of XML to the body of the SOAP message. Service implementation can get that and save that stuff to the db. 3. If its not a must to use web services, write a simple JSP or a servlet and use commons file upload util to upload the zip to the server and process it there. This is , without using web services.
HTH. Chinthaka Antony Grinyer wrote:
Hi all, This is my first mail to the list as I am new to axis2 development. I am using axis2 and resin 2.1.0, and I have developed a basic web service which allows me to retrieve information from the database using basic http parameters as arguments to web service calls e.g. http://localhost:8080/axis2/services/myservice/getPerson?db=myDb&personI D=10 I would now like to write a method to upload a zip file from a client to the server using a web service call convention like: http://localhost:8080/axis2/services/myservice/uploadZip?path=c:\data\xm l.zip Which takes the file from the client machine and dumps it on the server. This file will then be unzipped at the server end and processed to upload XML to a database. I am using AXIOM for my web service methods to process all the web service calls e.g. public OMElement uploadZip(OMElement element) throws XMLStreamException { QName qn = new QName("path"); OMElement e = element.getFirstChildWithName(qn); String pathToZip = e.getText(); // missing implementation - what goes here? } ...however I am completely mystified how I can implement this service to actually get the file from the client and put it on the server? i.e. how can my uploadZip method get the file from the client for the server to process? I can't find any examples anywhere on how to do this, therefore any help/advice would be gratefully received! Many thanks in advance, Antony
