*
The moose likes Web Services and the fly likes web services Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "web services " Watch "web services " New topic
Author

web services

Jane Joseph
Ranch Hand

Joined: Feb 21, 2008
Posts: 39
The 'Options' class is typically used in a web service client. I'm curious as to how the port number is got when an options.getPort() method is called. Also we do not pass the port number while running the client program eg. java samples.userguide.example2.CalcClient add 2 3

I'm new to web services..the question may be amatuerish. Have pasted a part of the client program below.(taken from Axis sample programs)

package samples.userguide.example2 ;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;

import javax.xml.rpc.ParameterMode;
public class CalcClient
{
public static void main(String [] args) throws Exception {
Options options = new Options(args);

String endpoint = "http://localhost:" + options.getPort() +
"/axis/Calculator.jws";

args = options.getRemainingArgs();








Jane
SCJP, SCMAD
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Welcome to JavaRanch!

Options assumes a default URL of "http://localhost:8080/axis/servlet/AxisServlet".
You can specify your own URL with the -l option.
Host, port, and servlet are extracted from the URL unless they are specified separately with
-h to set the host
-p to set the port
-s to set the servlet name

-u sets the username that can be obtained with getUser()
-w sets the password that can be obtained with getPassword()
-f sets a filename that forces the "file" protocol and also suppresses the host and port setting

The source can be found in the source archive under src/org/apache/axis/utils/Options.java.
Jane Joseph
Ranch Hand

Joined: Feb 21, 2008
Posts: 39
Originally posted by Peer Reynders:
Welcome to JavaRanch!

Options assumes a default URL of "http://localhost:8080/axis/servlet/AxisServlet".
You can specify your own URL with the -l option.
Host, port, and servlet are extracted from the URL unless they are specified separately with
-h to set the host
-p to set the port
-s to set the servlet name

-u sets the username that can be obtained with getUser()
-w sets the password that can be obtained with getPassword()
-f sets a filename that forces the "file" protocol and also suppresses the host and port setting

The source can be found in the source archive under src/org/apache/axis/utils/Options.java.
Jane Joseph
Ranch Hand

Joined: Feb 21, 2008
Posts: 39
Hi Peers,

Thanks for the reply. The previous reply was an 'Ooops...'

-Jophy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: web services