axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmu...@apache.org
Subject cvs commit: xml-axis-wsif/java/samples/jms/service ServiceAvailabilityBean.java
Date Thu, 02 Jan 2003 19:53:09 GMT
nmukhi      2003/01/02 11:53:09

  Modified:    java/samples/dslprovider README.html
               java/samples/jms/service ServiceAvailabilityBean.java
  Log:
  Added example interactions to dslprovider README
  Modified JMS service availability implementation to return "true" for
  zip codes < 50000, false otherwise (changed from 5000 to 50000 since real
  zip codes have 5 digits)
  
  Revision  Changes    Path
  1.2       +116 -0    xml-axis-wsif/java/samples/dslprovider/README.html
  
  Index: README.html
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/samples/dslprovider/README.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- README.html	27 Dec 2002 22:12:09 -0000	1.1
  +++ README.html	2 Jan 2003 19:53:09 -0000	1.2
  @@ -39,5 +39,121 @@
         <br><tt>java dslprovider.ServiceChecker samples/complexsoap/Zip2Geo.wsdl

   	<br>samples/ejb/AddressBook.wsdl samples/jms/ServiceAvailability.wsdl</tt>
       </p>
  +    <p>Here is a set of interactions with the application:
  +<p>Providing an invalid zip code/city combination:<br>
  +<pre><tt>
  +C:\work\xml-axis-wsif\java>java dslprovider.ServiceChecker samples\complexsoap\Zip2Geo.wsdl
samples\ejb\AddressBook.wsdl samples\jms\ServiceAvailability.wsdl
  +
  +************************
  +WELCOME TO FAST DSL INC.
  +************************
  +
  +
  +Interested in DSL service? Enter your address in the form below and we will chec
  +k whether we have service available in your area.
  +
  +If you have previously expressed interest, just enter your name (leave other fie
  +lds blank) and we will look up the rest of the information in our records
  +Name: Jow Schmoe
  +Street Number: 20
  +Street Name: Nowhere Street
  +City: New York
  +State: NY
  +Zip: 47405
  +
  +
  +Adding address to records...
  +
  +
  +Verifying validity of address...
  +Zip 47405 is in city BLOOMINGTON, not city New York as you specified
  +</tt></pre></p>
  +<p>Providing a valid address, checking for service; then repeating the check for
service for the same name with providing address (address provided the first time is stored):<br>
  +<pre><tt>
  +C:\work\xml-axis-wsif\java>java dslprovider.ServiceChecker samples\complexsoap\Zip2Geo.wsdl
samples\ejb\AddressBook.wsdl samples\jms\ServiceAvailability.wsdl
  +************************
  +WELCOME TO FAST DSL INC.
  +************************
  +
  +
  +Interested in DSL service? Enter your address in the form below and we will check whether
we have service available in your area.
  +
  +If you have previously expressed interest, just enter your name (leave other fields blank)
and we will look up the rest of the information in our records
  +Name: Joe Schmoe
  +Street Number: 20
  +Street Name: Nowhere Street
  +City: NEW YORK
  +State: NY
  +Zip: 10005
  +
  +
  +Adding address to records...
  +
  +
  +Verifying validity of address...
  +
  +
  +Customer: Joe Schmoe
  +Address: 20 Nowhere Street, NEW YORK NY 10005
  +Checking service availability...
  +No, we do not offer service in your area
  +
  +
  +Enter 'q' to quit, any other key continue...
  +
  +************************
  +WELCOME TO FAST DSL INC.
  +************************
  +
  +
  +Interested in DSL service? Enter your address in the form below and we will check whether
we have service available in your area.
  +
  +If you have previously expressed interest, just enter your name (leave other fields blank)
and we will look up the rest of the information in our records
  +Name: Joe Schmoe
  +Street Number:
  +Street Name:
  +City:
  +State:
  +Zip:
  +
  +
  +Looking up address...
  +
  +
  +Verifying validity of address...
  +
  +
  +Customer: Joe Schmoe
  +Address: 20 Nowhere Street, NEW YORK NY 10005
  +Checking service availability...
  +No, we do not offer service in your area
  +
  +
  +Enter 'q' to quit, any other key continue...
  +q
  +</tt></pre></p>
  +<p>Doing an invalid address lookup by providing a name not entered before:<br>
  +<pre><tt>
  +C:\work\xml-axis-wsif\java>java dslprovider.ServiceChecker samples\complexsoap\Zip2Geo.wsdl
samples\ejb\AddressBook.wsdl samples\jms\ServiceAvailability.wsdl
  +************************
  +WELCOME TO FAST DSL INC.
  +************************
  +
  +
  +Interested in DSL service? Enter your address in the form below and we will check whether
we have service available in your area.
  +
  +If you have previously expressed interest, just enter your name (leave other fields blank)
and we will look up the rest of the information in our records
  +Name: Jane Schmoe
  +Street Number:
  +Street Name:
  +City:
  +State:
  +Zip:
  +
  +
  +Looking up address...
  +Address for Jane Schmoe wasn't found
  +</tt></pre></p>
  +    <p><b>Note:</b> The addressbook service has an EJB binding; in our
sample implementation, this is implemented by a session bean, so the conversational state
(i.e. the addressbook being modified and queried) is not saved to persistent storage. As a
result, in your use of this application, you will notice that if you add an address and then
terminate the session, then start another session with the application you start out with
an empty address book, i.e. the previous address you entered will not be stored. You can however
verify the lookup function by adding an address, then repeating the information with the same
name but an empty address. This is not in any way close to a real application it is just a
sample that demonstrates how easy it is to tie together JMS, EJBs and SOAP using WSDL as a
normalised description of software and WSIF as the programming model.</p>
   <hr width="100%">
   </body></html>
  
  
  
  1.2       +3 -3      xml-axis-wsif/java/samples/jms/service/ServiceAvailabilityBean.java
  
  Index: ServiceAvailabilityBean.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/samples/jms/service/ServiceAvailabilityBean.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServiceAvailabilityBean.java	27 Dec 2002 17:52:07 -0000	1.1
  +++ ServiceAvailabilityBean.java	2 Jan 2003 19:53:09 -0000	1.2
  @@ -12,7 +12,7 @@
    * that represents a zip code, and returns a message containing a 
    * boolean indicating whether DSL service is available at that zip code 
    * or not.
  - * Internally the bean just returns true for zip codes < 5000 and
  + * Internally the bean just returns true for zip codes < 50000 and
    * false otherwise.
    */
   public class ServiceAvailabilityBean implements MessageDrivenBean, MessageListener {
  @@ -32,8 +32,8 @@
   	    TextMessage  message = (TextMessage)msg;
   	    // assume we have an integer
   	    int zipCode = new Integer(message.getText()).intValue();
  -	    // return true if zip code < 5000, false otherwise
  -	    if (zipCode<5000)
  +	    // return true if zip code < 50000, false otherwise
  +	    if (zipCode<50000)
   		sendMessage(message,"true");
   	    else
   		sendMessage(message,"false");
  
  
  

Mime
View raw message