But you certainly can achieve what you want in the following ways ...
public class AsyncService {
static Buffer buffer = Buffer.getSingleton();
public String submitRequest(Request request) {
String trackerId = buffer.save(request); // save in buffer
return trackerId;
}
public Response pollForResponse(String trackerId) {
if (buffer.isResponseReady(trackerId)) {
return (buffer.getResponse(trackerId));
} else {
return (null);
}
}
public void submitRequestWithCallback(Request request, ICallback callback) {
buffer.save(request, callback);
}
}
public class Execution extends Thread {
public void run () {
Request request = buffer.takeRequest();
Response response = handle(request);
if (request.needsCallback()) {
ICallback callback = buffer.getCallback(request.getTrackerId());
callback.sendResponse(response);
} else {
buffer.saveResponse(request.getTrackerId(), response)
}
}
}
Rgds, Ricky
At 02:29 PM 11/27/2002 +1100, Trond Hjelmaas wrote:
Hi, I have a problem with finding relevant info regarding asynch Web Services.For example, I've got this javaclass, all it does is wait 10 seconds public class delay{ public void wait10sec(){ /*some code for 10 sec delay*/ } } it has WSDL like: ...... <message name="wait10sec0Request"/> <portType name="blahPortType"> <operation name="wait10sec"> <input name="wait10sec0Request" message="tns:wait10sec0Request"/> </operation> </portType> <binding name="blahBinding" type="tns:blahPortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="wait10sec"> <soap:operation soapAction="" style="rpc"/> <input name="wait10sec0Request"> <soap:body use="encoded" namespace="blah" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> </operation> </binding> <service name="blah"> <port name="blahPort" binding="tns:blahBinding"> <soap:address location="http://some_URTL:8888/blah_ctx/blah"/> </port> </service> NOTE: I have change WSDL to have no response, the original has reponse message listed, but is was empty..... According to some mail I read Web Services are async if they don't have any reponse method. I uploaded this and invoke the method using Oracle9ias (9.0.0.3), the invocation halts for 10 seconds, and does NOT return ASAP (which is what I need). Any suggestions about how to make asynch Web Services are very appreciated! Regards, Trond
