Monday, August 15, 2005
Tutorial for J2EE tutorial 1.4
1. Download the tutorial from http://java.sun.com/j2ee/1.4/download-docs.html
2. Unzip it to C:\Sun (already install Sun Application Server to C:\Sun)
3. modifty "C:\Sun\j2eetutorial14\examples\common\build.property"
-----------------------------------------
j2ee.home=C:/Sun/AppServer
j2ee.tutorial.home=C:/Sun/j2eetutorial14
...
-----------------------------------------
4. modify "C:\Sun\j2eetutorial14\examples\common\admin-password.txt"
-----------------------------------------
AS_ADMIN_PASSWORD=88888888
-----------------------------------------
5. modify "C:\Sun\j2eetutorial14\examples\jaxrpc\helloservice\build.property"
-----------------------------------------
example=helloservice
wsdl.file=MyHelloService.wsdl
war.file=hello-jaxrpc.war
config.interface.file=config-interface.xml
mapping.file=mapping.xml
context.path=hello-jaxrpc
-----------------------------------------
6. run "asant build; asant create-war; asant deploy" in "C:\Sun\j2eetutorial14\examples\jaxrpc\helloservice\"
7. modifty ""C:\Sun\j2eetutorial14\examples\jaxrpc\staticstub\build.property"
--------------------------------------
example=staticstub
client.class=${example}.HelloClient
endpoint.address=${hello.endpoint}
client.jar=client.jar
context.path=hello-jaxrpc
url.pattern=/hello
config.wsdl.file=config-wsdl.xml
--------------------------------------
8. run "asant build; asant run" in
"C:\Sun\j2eetutorial14\examples\jaxrpc\staticstub\"
9. create .NET web service client
9.1 New a C# console application, add "web reference" JWSHello with URL
http://localhost:8080/hello-jaxrpc/hello?WSDL
9.2 in main, add
JWSHello.MyHelloService service=new JWSHello.MyHelloService();
System.Console.Write(service.sayHello("Pop"));
9.3 build and run
Note:
run "asant listprops; asant listprops-jaxrpc;" to check if the environment is set properly