• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java extend in web services

 
Hlias Makis
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when building a web service from java code can i use extend ?
public class test
{}

public interface a
{
public void x(){}
}


public class xx extends test implements a
{}
 
Tim Moores
Bartender
Posts: 2675
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happened when you tried?
 
Hlias Makis
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:What happened when you tried?



public class xx extends test implements a
{
public void x()
{
print(); it belongs to class test
System.out.println("Something");
}
}



print function never called .
 
Tim Moores
Bartender
Posts: 2675
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you using class xx?
 
Hlias Makis
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:How are you using class xx?




i hav e client creating an object xx and calling the function x
 
Hlias Makis
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I 'm sendin the exact code

package juma.mohammad;

public class a
{
public void print()
{
System.out.println("Works");
}


package juma.mohammad;
package juma.mohammad;

public interface Greeting {
public String sayHello(String name);
}


import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService(endpointInterface = "juma.mohammad.Greeting")
public class GreetingImpl extends a implements Greeting{
@Override
public String sayHello(String name)
{
print();
return "Hello, Welcom to jax-ws " + name;
}

}
 
Tim Moores
Bartender
Posts: 2675
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you trying to invoke this? And what happens if you do?
 
Hlias Makis
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:How are you trying to invoke this? And what happens if you do?


im using wsimport to generate client stubs


import juma.mohammad.Greeting;
import juma.mohammad.GreetingImplService;

public class client {
public static void main(String[] args){

GreetingImplService service = new GreetingImplService();
Greeting greeting = service.getGreetingImplPort();
System.out.println("------->> Call Started");
System.out.println(greeting.sayHello("Ali"));
System.out.println("------->> Call Ended");
}
}
 
Tim Moores
Bartender
Posts: 2675
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:And what happens if you do?

Is the sayHello method on the server invoked?
 
Hlias Makis
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:
Tim Moores wrote:And what happens if you do?

Is the sayHello method on the server invoked?



yes from the sayhello function i get only the Hello World ali not the print from function print
 
Tim Moores
Bartender
Posts: 2675
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, any output of System.out.println would go to a server log file; have you checked those?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic