Creating client for web service

后端 未结 1 369
被撕碎了的回忆
被撕碎了的回忆 2020-12-22 06:36

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 w

相关标签:
1条回答
  • 2020-12-22 07:07

    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");
    
    0 讨论(0)
提交回复
热议问题