views:

31

answers:

1

We have a simple Web Service client caller UpdaterService (the autogenerated one, extends javax.xml.ws.Service). The class has a getUpdaterPort function which wraps the super's getPort function (this is standard as well).

The return value for the call to getUpdaterPort is an Updater interface:

/** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.1.7-hudson-48- * Generated source version: 2.1 * */ @WebService(name = "Updater", targetNamespace = "http://updater.glassfish.com/") @XmlSeeAlso({ ObjectFactory.class }) public interface Updater {

/**
 * 
 * @param arg2
 * @param arg1
 * @param arg0
 * @return
 *     returns java.lang.String
 */
@WebMethod
@WebResult(targetNamespace = "")
@RequestWrapper(localName = "updateWar", targetNamespace = "http://updater.glassfish.com/", className = "com.abc.utils.updaterclient.client.UpdateWar")
@ResponseWrapper(localName = "updateWarResponse", targetNamespace = "http://updater.glassfish.com/", className = "com.abc.utils.updaterclient.client.UpdateWarResponse")
public String updateWar(
    @WebParam(name = "arg0", targetNamespace = "")
    String arg0,
    @WebParam(name = "arg1", targetNamespace = "")
    String arg1,
    @WebParam(name = "arg2", targetNamespace = "")
    byte[] arg2,
    @WebParam(name = "arg3", targetNamespace = "")
    byte[] arg3);

}

The call to updateWar is quite long as a 20MB array is uploaded through it. We'd like to be able to know the progress that is being made in order to report back each 10% of progress made.

Is there a way we can hook this call and know how far along it is?

A: 

This answer is probably what you want. Basically, create a web service to allocate a process ID, start the upload (with the process ID as an input parameter, along with the actual data to upload), and then create another web service that reports on the progress of the upload (with the ID as the input parameter).

Catchwa
Which is all nice and dandy but how is this accomplished? In JavaEE there is no (legal) way to e.g. start a thread and schedule it yourself. And where/what is the registry that maintains the IDs? JNDI? A DB?
musiKk
Someone there points to http://msdn.microsoft.com/en-us/library/aa480520.aspx which is exactly what we're trying to accomplish for Java but we have no idea how to hook these mechanisms there.
Yon