Jdk provides webservice and jdk provides webservice.
1. Create the class to be released
Package com. test. webserive; import javax. jws. webService; // targetNamespace defines the namespace @ WebService (targetNamespace = "http://www.mess.com") public class HelloServiceImpl {public String sayHello (String name) {return "Hello:" + name ;} public String syaHi (String username) {return "Hi:" + username ;}}
2. Publish a service
Package com. test. webserive; import javax. xml. ws. endpoint; public class Service {public static void main (String [] args) {/*** parameter 1: Server publishing address * parameter 2: Service implementer */Endpoint. publish ("http: // 10.90.2.17: 6789/hello", new HelloServiceImpl (); System. out. println ("Server ready... ");}}
3. Start running, open the browser and enter
Http: // 10.90.2.17: 6789/hello? Wsdl
The following file is published successfully:
Which file of the jdk web container is stored on the machine?
JDK does not have its own
Tomcat can be used
Jdk16 webservice cannot be integrated with SSH
Answer: It is a waste to be alone. In our past, we were born to regard us as a torch, not to illuminate ourselves, but to embrace the world. Because our virtues cannot be pushed to others, it is like nothing.