Can a Java web service be hosted without deployment on a Tomcat / JBoss server?

As far as I know, Apache Tomcat or an application server, such as JBoss, needs to deploy and run a web service implemented in Java.

My manager asked me if there was an alternative to deploying a web service without configuring or configuring Apache Tomcat / JBoss.

I am mainly a QA engineer and have some minimal Java programming experience.

We are trying to develop / implement a Java-based web service to generate a load of SMTP messages that can be caused by test scripts developed using various technologies (QTP, Perl, etc.).

Thank you for your time.

+4
source share
3 answers

Yes, you can start the web service simply with the JDK using the @WebService annotation. It even supports SOAP.

A simple example (taken from here in German):

Services:

 @WebService @SOAPBinding(style=Style.RPC) public class Calculator { public long addValues(int val1, int val2) { return val1 + val2; } } 

Initialization Code:

 public class CalculatorServer { public static void main (String args[]) { Calculator server = new Calculator(); Endpoint endpoint = Endpoint.publish("http://localhost:8080/calculator", server); } } 
+2
source

Web services created in Java are basically a Java application with a different presentation behavior. you can, it is then that you must start them when the consumer calls the service. So we test them in a white box.

+1
source

I hope we can use the BINDING protocol as SMTP or CORBA, not HTTP.

Link: The stack protocol for web services.

0
source

All Articles