Tips for creating a simple web service

I want to create a simple SOAP web service. So far, I have only worked with existing SOAP / Rest services. And now I would like to create my own, easy to start.

For example, create a simple hello + string service where I provide a string in a request from SOAP ui or a similar tool.

I already have a Jboss server installed, what is the “easiest” way to achieve this? I understand that I need an interface, an Impl interface, and a wsdl file (possibly generated).

Does anyone have any good advice for me? thank

+3
source share
1 answer

- , JAX-WS Java. - Hello World:

@WebService
public class HelloWebService {
    public String sayHello(String name) {
        return "Hi" + name;
    }

    public static void main(String ... args) {
        HelloWebService hello = new HelloWebService();
        Endpoint endpoint = Endpoint.publish("http://localhost:8081/hello", hello);
    }
}

Java 6 JAX-WS RI, JAX-WS, SAOP-UI ( WSDL http://localhost:8081/hello?WSDL).

JBoss JAX-WS , Apache CXF Metro (Metro = JAX-WS RI + WSIT). JBossWS. .

.

+3
source

Source: https://habr.com/ru/post/1749684/


All Articles