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/ComplexSOAP/client/stub README.html Run.java
Date Mon, 09 Dec 2002 21:46:34 GMT
nmukhi      2002/12/09 13:46:34

  Modified:    java/samples/ComplexSOAP README.html
               java/samples/ComplexSOAP/client/stub README.html Run.java
  Log:
  Completed writing and testing client
  
  Revision  Changes    Path
  1.2       +2 -2      xml-axis-wsif/java/samples/ComplexSOAP/README.html
  
  Index: README.html
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/samples/ComplexSOAP/README.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- README.html	9 Dec 2002 17:33:01 -0000	1.1
  +++ README.html	9 Dec 2002 21:46:33 -0000	1.2
  @@ -10,8 +10,8 @@
   <h1>
   Web Services Invocation Framework:<br>
   ComplexSOAP Sample</h1>
  -<p>This sample aims to demonstrate the invocation of a SOAP service that uses custom
type definitions. This is a little different from using service that exchange messages typed
using primitive schema types, since we have to have native equivalents for the custom schema
types and know how to serialize and deserialize these the representations betwenour native
format and the SOAP format.</p>
  -<p>The particular service we have chosen to demonstrate how to WSIF for such invocations
is called <em>Zip2Geo</em>. This is a publicly available services hosted by <a
href="http://www.cdyne.com">www.cdyne.com</a>. The service offers a single port type
with one operation, called <tt>GetLatLong</tt>. This operation takes as input
a zip code, and returns as output information about the corresponding location, such as the
name of the city, state, its latitude, longitude, etc. The return value is a complex schema
type. The service URL, where you can find details on the service implementation, etc. is <a
href="http://www.xmethods.net/ve2/ViewListing.po?serviceid=175331">here</a>.</p>
  +<p>This sample aims to demonstrate the invocation of a SOAP service that uses custom
type definitions. This is a little different from using service that exchange messages typed
using primitive schema types, since we have to have native equivalents for the custom schema
types and know how to serialize and deserialize these the representations between our native
format and the SOAP format.</p>
  +<p>The particular service we have chosen to demonstrate how to WSIF for such invocations
is called <em>Zip2Geo</em>. This is a publicly available service hosted by <a
href="http://www.cdyne.com">www.cdyne.com</a>. The service offers a single port type
with one operation, called <tt>GetLatLong</tt>. This operation takes as input
a zip code, and returns as output information about the corresponding location, such as the
name of the city, state, its latitude, longitude, etc. The return value is a complex schema
type. The service URL, where you can find details on the service implementation, etc. is <a
href="http://www.xmethods.net/ve2/ViewListing.po?serviceid=175331">here</a>.</p>
   <p>The <a href="Zip2Geo.wsdl">WSDL file</a> in this sample directory
is publicly available via the service URL and has been downloaded from there.</p>
   <p><a href="client/dynamic/README.html">Here's</a> how to invoke this
service dynamically using WSIF's dynamic invocation interface (DII).</p>
   <p><a href="client/stub/README.html">Here's</a> how to invoke this service
by first generating the stub interface and using this directly through WSIF's dynamic proxy,
thus hiding all WSIF specifics from the client code. Note that the stub interface used is
the the service interface as defined by the JAX-RPC specification.</p>
  
  
  
  1.2       +2 -2      xml-axis-wsif/java/samples/ComplexSOAP/client/stub/README.html
  
  Index: README.html
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/samples/ComplexSOAP/client/stub/README.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- README.html	9 Dec 2002 18:15:19 -0000	1.1
  +++ README.html	9 Dec 2002 21:46:33 -0000	1.2
  @@ -21,8 +21,8 @@
     <li>JAR files required by Axis - log4j.jar, commons-logging.jar, jaxrpc.jar, saaj.jar</li>
   </ul>
   </p>
  -<p>This directory contains a file called <tt>Run.java</tt> that contains
the <tt>main</tt> method. This is the logic that uses the generated stub interface
to run the sample. So you can run this class, specifying on the command line the zip code
of interest. For example, <br>
  -<tt>java samples.SimpleSOAP.client.static.Run 10005</tt></p>
  +<p>This directory contains a file called <tt>Run.java</tt> that contains
the <tt>main</tt> method. This is the logic that uses the generated stub interface
to run the sample. So you can run this class, specifying on the command line the location
of the WSDL file for the sample followed by the zip code of interest. For example, <br>
  +<tt>java file:/mywsifinstallation/samples/ComplexSOAP/Zip2Geo.wsdl samples.ComplexSOAP.client.static.Run
10005</tt></p>
   <p>To generate the stub interface, you can use any tool that generates Java interfaces
for WSDL services using their port type descriptions, such as WSDL2Java from Axis. WSIF assumes
a correspondence between the generated Java interface and the WSDL port type that has its
abstract description as specified in the JAX-RPC specification. This particular sample used
WSDL2Java in the following way:<br>
   <tt>java org.apache.axis.wsdl.WSDL2Java ../../Zip2Geo.wsdl</tt><br>
   After the tool finished running, we deleted all the generated files except <tt>Zip2GeoSoap.java</tt>
and <tt>LatLongReturn.java</tt> (Zip2GeoSoap is the java interface corresponding
to the port type; LatLongReturn is the java representation of the complex schema type returned
by the service - that is all that is required by WSIF). Note that the WSIF provider (in this
case, Axis) automatically handles (de)serialization of the data that the user's code sees.</p>
  
  
  
  1.2       +5 -5      xml-axis-wsif/java/samples/ComplexSOAP/client/stub/Run.java
  
  Index: Run.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/samples/ComplexSOAP/client/stub/Run.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Run.java	9 Dec 2002 18:15:19 -0000	1.1
  +++ Run.java	9 Dec 2002 21:46:33 -0000	1.2
  @@ -18,22 +18,22 @@
   public class Run {
       public static void main(String [] args) {
   	try {
  -	    if (args.length!=1) {
  -		System.out.println("Usage: java samples.ComplexSOAP.client.stub.Run <zip code>");
  +	    if (args.length!=2) {
  +		System.out.println("Usage: java samples.ComplexSOAP.client.stub.Run <wsdl location>
<zip code>");
   		System.exit(1);
   	    }
   	    // create a service factory
   	    WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
   	    // parse WSDL
  -	    WSIFService service = factory.getService("file:/work/xml-axis-wsif/java/samples/ComplexSOAP/Zip2Geo.wsdl",
null,
  +	    WSIFService service = factory.getService(args[0], null,
   						     null, "http://ws.cdyne.com", 
   						     "Zip2GeoSoap"); 
   	    Zip2GeoSoap stub = null;
   	    // create the stub
   	    stub = (Zip2GeoSoap) service.getStub(Zip2GeoSoap.class);
   	    // do the invocation
  -	    // args[0] is the zip code
  -	    LatLongReturn zipInfo = stub.GetLatLong(args[0],"");
  +	    // args[1] is the zip code
  +	    LatLongReturn zipInfo = stub.GetLatLong(args[1],"");
   	    System.out.println("This zip code is in "+zipInfo.getCity()+","+zipInfo.getStateAbbrev()+
   			       " in "+zipInfo.getCounty()+" county\n"+
   			       "It extends from longitude "+zipInfo.getFromLongitude()+" to longitude "+
  
  
  

Mime
View raw message