• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

simple java problem

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this program and i want, that the user can also set the Service Endpoint, i wrote this:
---------------------------
public class bala{
private static String ServiceEndpoint ;

public static String getEndpoint(String serverName) throws UnknownHostException {
try{
setEndpoint(serverName);
}
catch (RemoteException ex){}
return getEndpoint();
}

public static String getEndpoint() throws UnknownHostException {
InetAddress endpoint = InetAddress.getByName(ServiceEndpoint);
return endpoint.getHostName();
}
public static void setEndpoint(String aServiceEndpoint) throws RemoteException{
ServiceEndpoint = aServiceEndpoint;
}

private static String endpoint(){
String ep = new String();
try {
ep = getEndpoint();
}
catch (UnknownHostException ex) {
System.err.println(ex);
}
return ep;
}
private static EndpointReference targetEPR = new EndpointReference("http://"+endpoint()+"/axis2/services/balaService");
... ...

public void exam(){... ... }

... ...
}
------------------
and i call this in anaother Programm with:
--------------------
... ...
private static String endpoint(){
String ep = new String();
try {
ep=bala.getEndpoint();
}
catch (UnknownHostException ex) System.err.println(ex);
return ep
}
private static bala port = new bala(endpoint());

... ...
case 6:
{ String server = getUserInput("Enter new server: ");
bala.setEndpoint(server);
System.out.println("server changed to :"+ server);
break;
}

port.exam();
... ...
----------------------

why didn't i get the right endpoint, what i want?
Thanks!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic