• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help to create client code  RSS feed

 
Abhra Kar
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am new to Web Services.I am trying to understand JAX-WS and till now I have done these much—

1>Create one interface “Hello”

package abhra;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;

@WebService(name="hello")
@SOAPBinding(style=Style.RPC)

public interface Hello
{
@WebMethod
public String sayHello(String name);
}



2>Create one implementing class “HelloImpl”---

package abhra;
import javax.jws.WebService;
import javax.xml.ws.Endpoint;

@WebService(endpointInterface="abhra.Hello",serviceName="MyHelloService",portName="MyHelloPort")

public class HelloImpl implements Hello{
public String sayHello(String name) {
return "Hello "+name+", welcome to the world of JAX-WS";
}

public static void main(String[] args) {
Endpoint.publish("http://localhost:8080/abhra/helloService", new HelloImpl());
}
}


3>compile these classes D:\>javac –d . *.java

4>wsgen -cp . abhra.HelloImpl

5>Run HelloImpl D:/> java abhra.HelloImpl

6> display the wsdl in Mozilla firefox ------- http://localhost:8080/abhra/helloService?WSDL

I am able to see the generated xml .Now what I able to know that I will have to create one client to call the method exposed as web service and for that I will have to run wsimport tool
But these steps I don’t know properly. Please help me to know create and execute client code .
Thanks in advance
 
Abhra Kar
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any help please
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried so far? http://docs.oracle.com/javase/6/docs/technotes/tools/share/wsimport.html outlines how to use the tool.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!