import javax.jws.WebService;
@WebService
public class InventoryService {
public int getStock(String productName) {
}
}
<web-services>
<services>
<service name="InventoryService">
<port name="InventoryPort" bindingUri="http://localhost:8080/InventoryServiceEndpoint">
</port>
</service>
</services>
</web-services>
import javax.xml.ws.Endpoint;
public class WebServicePublisher {
public static void main(String[] args) {
InventoryService inventoryService = new InventoryService();
Endpoint.publish("http://localhost:8080/InventoryServiceEndpoint", inventoryService);
}
}