I have a Java Application. I use Netbeans 7.4 IDE. I want to host some web service methods within this application so that other clients can get data provided by this application using web service.
I don't want to host this web servis on any web server, i want to host this only within the application itself like WCF selfhosting in .NET.
I have been developing C# applications and i have knowladge about WCF but i am just a starter of Java world. Is it possible to host web service endpoints within the application itself like happens in .NET?
The answer accourding to my needs is already here
I see that I just need to add new java class and add xml annoitions like @WebService and @WebMethod to make the class a web service. Then i just need to add following lines to publish this service:
public static void main(String[] args) {
String address = "http://127.0.0.1:8023/_WebServiceDemo";
Endpoint.publish(address, new MyWebService());
System.out.println("Listening: " + address);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With