Skip to content

Commit 6a77948

Browse files
committed
Updating readme
1 parent 61585a8 commit 6a77948

File tree

1 file changed

+135
-28
lines changed

1 file changed

+135
-28
lines changed

README.md

Lines changed: 135 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,16 @@ Version History:
88
- 0.2 Updating instructions to use custom property to specify lib locations instead of adding libs manually
99
- 0.3 Adding Maven
1010

11-
## Prerequisites
11+
## Installation
1212

13-
This assumes you have Eclipse 3.6+, m2e Maven plugin, and Maven installed and configured
14-
for your development environment
13+
### In Eclipse
14+
15+
This assumes you have Eclipse 3.6+, m2e Maven plugin, Maven, and Git installed.
1516

1617
- Eclipse can be downloaded at: http://download.eclipse.org
1718
- Maven can be downloaded at: http://maven.apache.org/download.html
1819
- m2e Maven plugin comes with Eclipse 3.7+ and can be installed for older versions by going to Help > Eclipse Marketplace and typing 'm2e'
19-
20-
### Mac OS X
21-
22-
23-
## Environment
20+
- Git can be downloaded at: http://git-scm.com/download
2421

2522
It is recommended you set up your environment in the following manner:
2623

@@ -36,26 +33,37 @@ It is recommended you set up your environment in the following manner:
3633

3734
3. Create a "workspace" folder in your java folder. This will be the root of your Eclipse workspace.
3835
When you start Eclipse for the first time, tell it to use this folder as the workspace folder. If
39-
you are already using Eclipse and have already designated a workspace folder, you can continue using
40-
that folder.
41-
42-
Next we will bring the project into Eclipse. To do this:
36+
you are already using Eclipse and have already designated a workspace folder, you can continue using that folder.
37+
38+
Then you need to install 2 additional connectors from the m2e Marketplace in Eclipse:
39+
40+
1. File > Import > Check out Maven Projects from SCM > Next
41+
2. Click "m2e Marketplace" link
42+
3. Select the de.theit.m2e.axistools and m2e-egit connectors from the m2e Marketplace
43+
4. Click Finish
44+
5. Follow the prompts to install these connectors
45+
6. Restart Eclipse once these are done installing
46+
47+
Once Eclipse restarts:
48+
49+
1. File > Import > Check out Maven Projects from SCM > Next
50+
2. Select "git" from the dropdown
51+
3. Enter git://github.com/hannonhill/Webservices-Java-Sample-Project.git into the Git URL field
52+
4. Click Next
53+
5. Click Finish
4354

44-
1. Unzip/move the contents of this zip file to your Eclipse workspace directory.
45-
2. Import the project into Eclipse by choosing File -> Import -> General -> Existing Projects into Workspace
46-
and choosing the "Cascade Webservices" folder (this is the root of the project).
55+
This will import and build the project in Eclipse.
4756

48-
After this you should see the Cascade Webservices project show up in your Eclipse window. Do not be alarmed if
49-
there are compilation errors, this is because you still need to generate the Java client stubs for interacting
50-
with the web services layer.
57+
Once built, use Git to checkout the appropriate branch of this project for your Cascade installation. For example, if you're running Cascade version 6.8.3, checkout 6.8.x: `git checkout 6.8.x`
5158

52-
To do this:
59+
To update the generated Web Services stubs to correspond to your version of Cascade:
5360

5461
1. Open the WSDL from your Cascade Server instance by going to: http://<your-cascade-url>/ws/services/AssetOperationService?wsdl
5562
2. Save this as a file "asset-operation.wsdl".
5663
3. Replace the "asset-operation.wsdl" file in src/java/wsdl inside the eclipse project with your own file.
57-
4. Open a command-line/terminal window to run maven.
58-
5. Navigate to to the base directory where the project was unzipped to (e.g. java/workspace/Cascade Webservices) and type the command "maven generate-sources"
64+
4. In Eclipse, right-click the project and click Refresh. Maven should run and regenerate your stubs based on this updated WSDL file.
65+
5. If for some reason it doesn't, open a command-line/terminal window to run maven.
66+
6. Navigate to to the base directory where the project was created to (e.g. java/workspace/Cascade Webservices) and type the command "maven generate-sources"
5967
You should see a successful ant build similar to:
6068

6169
$ maven generate-sources
@@ -77,14 +85,113 @@ You should see a successful ant build similar to:
7785
[INFO] Finished at: Mon Jul 18 15:33:55 EDT 2011
7886
[INFO] Final Memory: 3M/81M
7987
[INFO] ------------------------------------------------------------------------
80-
81-
6. Refresh the project by right clicking on the project and selecting "Refresh".
88+
89+
7. Then, refresh Eclipse and your project should be built.
90+
91+
### With Git and Maven only
92+
93+
This assumes you have Maven 3+ and Git installed.
94+
95+
- Maven can be downloaded at: http://maven.apache.org/download.html
96+
- Git can be downloaded at: http://git-scm.com/download
97+
98+
Clone the project:
99+
100+
1. Clone this repository: git clone [email protected]:hannonhill/Webservices-Java-Sample-Project.git
101+
2. Change into the directory for the newly created project
102+
3. Use Git to checkout the appropriate branch of this project for your Cascade installation. For example, if you're running Cascade version 6.8.3, checkout 6.8.x: `git checkout 6.8.x`
82103

83-
At this point Eclipse will re-build the project for you. You should not see any red x's
84-
on any files (which indicate java compilation errors).
104+
Update the Web Services stubs:
105+
106+
1. Open the WSDL from your Cascade Server instance by going to: http://<your-cascade-url>/ws/services/AssetOperationService?wsdl
107+
2. Save this as a file "asset-operation.wsdl".
108+
3. Replace the "asset-operation.wsdl" file in src/java/wsdl inside the eclipse project with your own file.
109+
4. Open a command-line/terminal window to run maven.
110+
5. Navigate to to the base directory where the project was unzipped to (e.g. java/workspace/Cascade Webservices) and type the command "mvn generate-sources"
111+
You should see a successful ant build similar to:
112+
113+
$ mvn generate-sources
114+
[INFO] Scanning for projects...
115+
[INFO]
116+
[INFO] ------------------------------------------------------------------------
117+
[INFO] Building Cascade-Java-Web-Services-Example-Project 6.8.3
118+
[INFO] ------------------------------------------------------------------------
119+
[INFO]
120+
[INFO] --- axistools-maven-plugin:1.4:wsdl2java (default) @ Cascade-Java-Web-Services-Example-Project ---
121+
[INFO] about to add compile source root
122+
[INFO] Processing wsdl: /Users/bradley/cascade/Webservices-Java-Sample-Project/src/java/wsdl/asset-operation.wsdl
123+
Jul 18, 2011 3:33:52 PM org.apache.axis.utils.JavaUtils isAttachmentSupported
124+
WARNING: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
125+
[INFO] ------------------------------------------------------------------------
126+
[INFO] BUILD SUCCESS
127+
[INFO] ------------------------------------------------------------------------
128+
[INFO] Total time: 3.940s
129+
[INFO] Finished at: Mon Jul 18 15:33:55 EDT 2011
130+
[INFO] Final Memory: 3M/81M
131+
[INFO] ------------------------------------------------------------------------
85132

86-
## To run an example
133+
## To run an example in Eclipse
87134

88135
1. Open the TestRead class
89-
2. Change the credentials to those of a user that has access to the Base Folder in the Global Area
90-
3. Right click the main() method > Run as... > Java Application
136+
2. Change the credentials to those of a user that has access to the Base Folder in a Site
137+
3. Enter the name of the site where it says "<SITE-NAME>"
138+
4. Right click the testBaseFolderRead() method > Run as... > JUnit Test
139+
140+
## To run a test with Maven
141+
142+
1. Open the TestRead class
143+
2. Change the credentials to those of a user that has access to the Base Folder in a Site
144+
3. Enter the name of the site where it says "<SITE-NAME>"
145+
4. Open a terminal
146+
5. Navigate to the project folder
147+
6. Type: `mvn -Dtest=TestRead test`
148+
You should see something like:
149+
150+
$ mvn -Dtest=TestRead test
151+
[INFO] Scanning for projects...
152+
[INFO]
153+
[INFO] ------------------------------------------------------------------------
154+
[INFO] Building Cascade-Java-Web-Services-Example-Project 6.8.3
155+
[INFO] ------------------------------------------------------------------------
156+
[WARNING] The artifact axis:axis-jaxrpc:jar:1.4 has been relocated to org.apache.axis:axis-jaxrpc:jar:1.4
157+
[INFO]
158+
[INFO] --- axistools-maven-plugin:1.4:wsdl2java (default) @ Cascade-Java-Web-Services-Example-Project ---
159+
[INFO] about to add compile source root
160+
[INFO] Nothing to generate. All WSDL files are up to date.
161+
[INFO]
162+
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ Cascade-Java-Web-Services-Example-Project ---
163+
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
164+
[INFO] skip non existing resourceDirectory /Users/bradley/cascade/Cascade-Java-Web-Services-Example-Project/src/main/resources
165+
[INFO]
166+
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ Cascade-Java-Web-Services-Example-Project ---
167+
[INFO] Nothing to compile - all classes are up to date
168+
[INFO]
169+
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ Cascade-Java-Web-Services-Example-Project ---
170+
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
171+
[INFO] skip non existing resourceDirectory /Users/bradley/cascade/Cascade-Java-Web-Services-Example-Project/src/test/resources
172+
[INFO]
173+
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ Cascade-Java-Web-Services-Example-Project ---
174+
[INFO] Nothing to compile - all classes are up to date
175+
[INFO]
176+
[INFO] --- maven-surefire-plugin:2.7.1:test (default-test) @ Cascade-Java-Web-Services-Example-Project ---
177+
[INFO] Surefire report directory: /Users/bradley/cascade/Cascade-Java-Web-Services-Example-Project/target/surefire-reports
178+
179+
-------------------------------------------------------
180+
T E S T S
181+
-------------------------------------------------------
182+
Running com.cms.webservices.TestRead
183+
Jul 18, 2011 5:37:31 PM org.apache.axis.utils.JavaUtils isAttachmentSupported
184+
WARNING: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
185+
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.316 sec
186+
187+
Results :
188+
189+
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
190+
191+
[INFO] ------------------------------------------------------------------------
192+
[INFO] BUILD SUCCESS
193+
[INFO] ------------------------------------------------------------------------
194+
[INFO] Total time: 4.752s
195+
[INFO] Finished at: Mon Jul 18 17:37:32 EDT 2011
196+
[INFO] Final Memory: 4M/81M
197+
[INFO] ------------------------------------------------------------------------

0 commit comments

Comments
 (0)