JBoss3.0.7_tomcat_4.1.24 AXIS configuration
Author: Shuai Niu Shi Email: Trynews@163.com
One. Decompose the jboss-net.sar file in the c: /jboss-3.0.7_jakarta-tomcat-4.1.24/server/all/Deploy directory, solve the file in the jboss-net.sar directory, then put JBoss- Net.SAR file back up to other directories, such as C: / Root Directory, remove C: /JBoss-3.0.7_jakarta-tomcat-4.1.24/server/all/Deploy/jobss-net.sar file
two. Start JBoss (Run -c ALL), enter http: // localhost: port / axis / * / service in the IE address bar, you can see the following text, explain the configuration success
AXIS / * / SERVICES
Hi there, this is an axis service!
Perhaps there is a form for invoking the service here ...
three. Construction WSR file
Example: Write a TestHelloWorld.java file, compile into CLASS
Content: Public Class TesthelloWorld
{
Public helloworld () {
}
Public String GetHelloWorldMessage (String Name) {
Return "Hello World to" Name;
}
}
Built a meta-inflicide file in the directory of the Testhelloworld file, build a web-service.xml file in Meta-Inf,
Content:
XMLns = "http://xml.apache.org/axis/wsdd/" XMLns: xsi = "http://www.w3.org/2000/10/xmlschema-instance" XMLns: java = "http://xml.apache.org/axis/wsdd/providers/java"> service> deployment> Using JAR commands in the Testhelloworld file directory: JAR CVF TestHelloWorld.WSR, copy TestHelloWorld.WSR to C: /JBoss-3.0.7_jakarta-tomcat-4.1.24/server/all/deploy/ directory. four. Write a client class call (of course, PHP, ASP can also be called), the content: Import org.apache.axis.client.call; Import org.apache.axis.client.service; Import org.apache.axis.encoding.xmltype; import javax.xml.rpc.parametermode; Public Class TestClient1 { Public static void main (String [] args) { Try { String endpoint = "http://192.168.0.28:8080/AXIS/*/services/testhelloworld"; String methodname = "gethelloworldMessage"; Service service = new service (); Call call = (call) service.createcall (); Call.SettargetendPointdaddress (New Java.net.URL (Endpoint)); Call.SetoperationName (MethodName); // Call to addparameter / setReturntype as described in user-guide.html Call.addparameter ("Name", Org.apache.axis.constants.xsd_string, ParameterMode.Param_Mode_IN); Call.setReturntype (org.apache.axis.constants.xsd_string); String Ret = (string) Call.invoke (new object [] {"axis!"}); System.out.println (RET); } catch (exception e) { System.err.println (e.tostring ()); E.PrintStackTrace (); } } } Perform this class, such as printing Hello World to Axis! Is OK.