This post is a supplement to "use axis to publish simple Web Services.
We can see that deploy is written in axis. WSDD and use Org. apache. axis. client. adminclient release, its main job is to add the content in the <service> label in the server-config.wsdd, so it is more convenient to directly edit the server-config.wsdd file. But when you don't have a server-config.wsdd file, use deploy. the WSDD method is more convenient, because adminclient will help you generate some additional XML elements (
After the service is released, you can see its WSDL In the IE browser. Generally, the Service URL is followed by a "? For example, you can use http: // localhost: 8080/bookstore/services/booksvc? See in WSDL. For how Java classes map rules to WSDL, see the JAX-RPC specification. For the description of the WSDL itself, see here; to find out the names of various URL formats in the generated WSDL, I 'd better understand XML Schema. I think this article is good.
You can also use IE to directly call the service by adding "method = xxx" after the service URL, where XXX is the name of the method to be called. For example, http: // localhost: 8080/bookstore/services/booksvc? Method = addbook calls the Add book method. According to our service class, the "book has been added." is displayed on the Tomcat console.
Because the parameter used to add the library method is a custom type, you cannot specify the parameter value in IE calling (or you can specify it in another format, but I do not know ); if the parameter is of the simple type, you can specify it. For example, we can add an echo () method for booksvc, the parameter is a value of the Java. Lang. string type, as shown below, and then recompile and start Tomcat (the server-config.wsdd file does not have to be changed ).
Public Void Echo (string Str ){
System. Out. println ( " Hello " + Str );
}
Enter http: // localhost: 8080/bookstore/services/booksvc in IE? Method = echo & STR = Mike, you will see "Hello Mike" in the Tomcat console ". If there are multiple parameters, you only need to list them in the URL.
Related links:
- Use axis to publish simple Web Services