Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web services

 
Jane Joseph
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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();






 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peers,

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

-Jophy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic