aspose file tools*
The moose likes Web Services and the fly likes java extend in web services Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "java extend in web services" Watch "java extend in web services" New topic
Author

java extend in web services

Hlias Makis
Greenhorn

Joined: May 21, 2012
Posts: 10
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
Rancher

Joined: Sep 21, 2011
Posts: 2408
What happened when you tried?
Hlias Makis
Greenhorn

Joined: May 21, 2012
Posts: 10
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
Rancher

Joined: Sep 21, 2011
Posts: 2408
How are you using class xx?
Hlias Makis
Greenhorn

Joined: May 21, 2012
Posts: 10
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

Joined: May 21, 2012
Posts: 10
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
Rancher

Joined: Sep 21, 2011
Posts: 2408
How are you trying to invoke this? And what happens if you do?
Hlias Makis
Greenhorn

Joined: May 21, 2012
Posts: 10
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
Rancher

Joined: Sep 21, 2011
Posts: 2408
Tim Moores wrote:And what happens if you do?

Is the sayHello method on the server invoked?
Hlias Makis
Greenhorn

Joined: May 21, 2012
Posts: 10
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
Rancher

Joined: Sep 21, 2011
Posts: 2408
Well, any output of System.out.println would go to a server log file; have you checked those?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java extend in web services