You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Trond Hjelmaas <th...@cse.unsw.EDU.AU> on 2002/11/27 04:29:08 UTC

Async web services, do they exist?

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


how does axis handles restrictions

Posted by Ankit <an...@ltp.soft.net>.
Hi,
Does anybody have any idea about how axis utility WSDL2JAVA  handles
Restrictions.

suppose I have schema like

<simpleType name="Attribute">
    <restriction base="string">
      <length minLength="1"/>
    </restriction>
  </simpleType>

<simpleType name="Test">
    <restriction base="Attribute">
      <enumeration value="First"/>
      <enumeration value="Business"/>
      <enumeration value="Coach"/>
    </restriction>
  </simpleType>

I expected that generated java code will have

"public class Test extends Attribute"

but it does not takes restriction into consideration. Is it a bug in
axis????

regards,
Ankit


Re: Async web services, do they exist?

Posted by Eric Rajkovic <er...@oracle.com>.
If you want to run asynch on the server, you have to create a separate 
thread or push the data from the request into some queueing mechanism. 
The current implementation is still sending an empty SOAP body  back to 
the caller and block until wait10sec returns.

in your stateless service class
    private static Timer productionRunTimer = new Timer( true);

inside wait10sec
        // the PO will be processed by another
        // thread and the status of the PO will be send back to the 
warehouse
        // using the callback information found in the Start header.
        ProductionRun productionRun =
          new ProductionRun( AllRequiredData );
        productionRunTimer.schedule( productionRun, 10000);
       
public class ProductionRun extends TimerTask  {
  ...
      public void run() {
         // placeholder for the remaining code from your initial 
 wait10sec method
      } 
}

If you don't need to wait 10 sec before to start processing, use 
Runnable instead of TimerTask.

hope this help.
 
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
>
>  
>