source: TI01-discovery/trunk/ws-Discovery2/readme.txt @ 3941

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI01-discovery/trunk/ws-Discovery2/readme.txt@3941
Revision 3941, 3.1 KB checked in by cbyrom, 12 years ago (diff)

Update the readme doc to include new instructions for setting things up.

Line 
1ws-Discovery
2------------
3
4NB, completing the build here assumes you have both apache axis2 and ant installed.  The AXIS2_HOME environment variable
5should be set to point to the top level directory of the axis2 install.
6
7The build file, \srcgen\buildDiscovery.xml, now includes targets to run the WSDL2Java code generation.  Running the build
8with no parameters, e.g.:
9
10ant -f buildClient.xml
11
12will now build both the server and client archives and make the necessary changes to the files outlined below.  NB, to get
13the DiscoveryService.wsdl file to be generated properly, you will likely have to temporarily rename the jsr file, as mentioned
14below.
15
16Original, detailed instructions, are as follows (but you shouldn't have to use them!):
17
18Client Side:
19---------------
20Instructions for building client (DiscoveryService-test-client.jar)
21
22Do all the following in directory "srcgen"
23
241) Generate automatic code from wsdl :
25%AXIS2_HOME%\bin\wsdl2java -d xmlbeans -uri ..\wsdl\Discovery.wsdl -o . -p ndg.clients.discovery
26
27Edit file src\ndg\clients\discovery\DiscoveryServiceStub.java, after the line (around #104?)
28        _serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext,_service);
29add the line
30        _serviceClient.getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, false);
31
322) Use ant to compile client jar using custom buildfile
33ant -buildfile buildDiscovery.xml jar.client
34
353) Use ant to run client
36ant -buildfile buildClient.xml run.client
37
38Server Side:
39---------------
40Instructions for building & deploying Axis2 web service archive (DiscoveryService.aar)
41
421. Run WSDL2Java to generate skeleton code and XMLBeans for data binding
43(In srcgen directory)
44%AXIS2_HOME%\bin\wsdl2java -ss -sd -d xmlbeans -uri ..\wsdl\Discovery.wsdl -o . -p ndg.services.discovery
45
46NB, when running this command, you may get an error along the lines of:
47
48Exception in thread "main" java.lang.NoSuchMethodError: javax.xml.stream.XMLOutputFactory.newInstance(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljavax/xml/stream/XMLOutputFactory;
49        at org.apache.axiom.om.util.StAXUtils.getXMLOutputFactory(StAXUtils.java:97)
50
51- this occurs due to a mismatch in libraries between the versions of java and axis being used.  A
52quick fix can be to temporarily hide jre/lib/ext/jsr173_1.0_api.jar.  NB, without this change, the
53generated DiscoveryService.wsdl file is likely to be empty.
54
552. Build server side code (DiscoveryService.aar)
56(In srcgen directory)
57ant -buildfile buildDiscovery.xml jar.server
58(output in build/lib)
59
603. Optionally build javadoc documentation
61ant -buildfile buildDiscovery.xml javadoc
62
634. Deploy the service
64 - Copy DiscoveryService.aar to <tomcat>/webapps/axis/WEB-INF/services (NB, for this step you need to have axis2
65 installed in your tomcat server - just drop an axis2.war file into the webapps directory when the server is running)
66 - Reload axis2 context within tomcat manager app, or restart tomcat
67
68
69
70Code to edit for testing is in ..\src\ndg\services\discovery\DiscoveryServiceClient.java
71
72Tested with Sun Java SDK 1.5.08 (problems with 1.6.03)
Note: See TracBrowser for help on using the repository browser.