>>> Simple implementation of WebService under WebLogic8.1 <<<<

xiaoxiao2021-03-06  35

The younger brother recently learned Java WebService, it was a bit gain, so write down. Because it is a beginner, so it is difficult to have a mistake, I hope that everyone will advise. Email: wj8384@gmail.com This webservice is the result of returning a String type, value is Input parameters (String). 1. First deploy a web application in WebLogic. WebLogic.jar, plusPath, and WebServices.jar in the ClassPath in the environment variable. 2. Newly build a class TestWs.java, implement the above features in one method of the class, here is the Output method. Public final class testws {

Public testws () {}

Public String Output (String Input) {Return New String (Input);}} After compiling into .class files, put it under the application's Web-INF / CLASSES. 3, create a TestWshandler, this class is responsible for some initialization work, because this example is relatively simple, so there is actually what is nothing.

Import WebLogic.Webservice.GenericHandler;

Public Final Class Testwshandler Extends GenericHandler {

Public testWshandler () {}} After compiling into a .class file, put it under the application's Web-INF / CLASSES. 4, create a new web-services.xml file, put it in the application's Web-INF / under, the content is as shown below

< Param name = "input" style = "in" type = "xsd: string" /> 5, create a new WebLogic.xml file, put it in the application's Web-INF / under, the content is as follows:

/ restarts WebLogic, you can test this in the browser through http: // localhost / testws. WebService features.

转载请注明原文地址:https://www.9cbs.com/read-61138.html

New Post(0)