0

I have deployed a simple hello service in jboss server. I can view the wsdl file. Can someone help me with the client side. I mean how to access this service? Is there any way to access from web browser? Method deployed is

@WebMethod
public String greet( @WebParam(name = "name")
String name )
    {
   return "Hello" + name;
    }
provokoe
  • 178
  • 2
  • 10

1 Answers1

2

Try to know what is the wsdl url to access the service which you have just exposed. It might most probably be something like "http://localhost: < port-number >/ems-ejb/?wsdl"

If you type the same in the browser, you should be able to see the wsdl file (page with full of xml tags).

Once done, follow the steps provided here

Example on how to call the method once client stub is generated

String endpoint = "your wsdl url";
GreetImplServiceLocator objGreetImplServiceLocator = new GreetImplServiceLocator();
java.net.URL url = new java.net.URL(endpoint);
GreetIntf objGreetIntf = objGreetImplServiceLocator.getFaultImplPort(url);
 String greetings=objFaultIntf.greet("stackoverflow");
Community
  • 1
  • 1
Anuj Balan
  • 7,629
  • 23
  • 58
  • 92
  • Thanks. I got the wsdl url. Even i got the stubs in eclipse. But i dont know what to do next? How do i get access to my service? When i try to add the client project to server (add or remove option) it forms an .ear file and deploy it on jboss. But that i am not able to access from browser. when i type http://localhost:8080/filename in the url i get that the link is broken – provokoe Dec 28 '11 at 11:26
  • From the client stub you just generated, you can see an interface having the method greet() You just need to call it. Refer the example which I added in the answer – Anuj Balan Dec 28 '11 at 12:26
  • ya thanks. Still facing hell lot of problems. But perhaps it is with my eclipse configuration. Thanks again – provokoe Dec 29 '11 at 09:21