summaryrefslogtreecommitdiffstats
path: root/site/trunk/site-publish/sca-native-developer-guide.html
blob: 0bcab1c479b1fff2e9f37614b16426a3e04df616 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
<!--

    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE- 2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
    <HEAD>
		<!-- generateKeywords macro -->
	    <META name="description" content="Apache Tuscany">
        <META name="keywords" content="apache, apache tuscany, tuscany, service, services, fabric, soa, service oriented architecture,  sca, service component architecture, das, sdo, csa, ruby, opensource">
		<!-- generateKeywords macro end -->
		
        <LINK type="text/css" rel="stylesheet" href="http://tuscany.apache.org/stylesheets/default.css">
        <LINK rel="SHORTCUT ICON" href="https://cwiki.apache.org/confluence/display/TUSCANY/$images/favicon.ico">   
        <TITLE>Apache Tuscany : SCA Native Developer Guide</TITLE>
    <META http-equiv="Content-Type" content="text/html;charset=UTF-8"></HEAD>
    
    <BODY onload="init()">
        <!-- topNav macro -->
		<TABLE valign="top" border="0" cellspacing="0" cellpadding="0" width="100%" background="http://tuscany.apache.org/images/TuscanyLogoNEW_Text_120px_bg.jpg">
			<TR>
				<TD valing="top" align="left">
					<A href="https://cwiki.apache.org/confluence/pages/viewpage.action?spaceKey=TUSCANY&title=$siteroot"><IMG src="http://tuscany.apache.org/images/TuscanyLogoNEW_Text_120px_bg.jpg" height="91" width="25" border="0"></A>
				</TD>
				<TD>
					<A href="http://tuscany.apache.org/"><IMG src="http://tuscany.apache.org/images/TuscanyLogo.jpg" border="0"></A>
				</TD>
				
				<TD width="100%">
					&nbsp;
				</TD>

				<!-- Adds the edit page link to the top banner-->
				<TD valign="bottom">
					<DIV style="padding: 2px 10px; margin: 0px;">
						<A href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=56441">
						<IMG src="http://tuscany.apache.org/images/notep_16.gif" height="16" width="16" border="0" align="absmiddle" title="Edit Page"></A>
					</DIV>
				</TD>

			</TR>
		</TABLE>
        <!-- topNav macro end -->

		<!-- breadCrumbs macro -->
		<TABLE border="0" cellpadding="2" cellspacing="0" width="100%">
			<TR class="topBar">
				<TD align="left" valign="middle" class="topBarDiv" nowrap="true" width="100%">
					&nbsp;<A href="home.html" title="Apache Tuscany">Apache Tuscany</A>&nbsp;&gt;&nbsp;<A href="home.html" title="Home">Home</A>&nbsp;&gt;&nbsp;<A href="sca-overview.html" title="SCA Overview">SCA Overview</A>&nbsp;&gt;&nbsp;<A href="sca-native.html" title="SCA Native">SCA Native</A>&nbsp;&gt;&nbsp;<A href="sca-native-documentation-menu.html" title="SCA Native Documentation Menu">SCA Native Documentation Menu</A>&nbsp;&gt;&nbsp;<A href="" title="SCA Native Developer Guide">SCA Native Developer Guide</A>
				</TD>
				
				<TD align="right" valign="middle" class="topBarDiv" align="left" nowrap="true">
				<A href="http://mail-archives.apache.org/mod_mbox/tuscany-user">User List</A> | <A href="http://mail-archives.apache.org/mod_mbox/tuscany-dev">Dev List</A> | <A href="http://issues.apache.org/jira/browse/Tuscany">Issue Tracker</A>&nbsp;&nbsp;
				</TD>
			</TR>
		</TABLE>
		<!-- breadCrumbs macro end -->


        <TABLE border="0" cellpadding="0" width="100%" bgcolor="#FFFFFF">
            <TR>
                <TD align="left" valign="top">

					<!-- pageContent macro -->
					<DIV id="PageContent">
												
						<DIV class="pagecontent">
							<DIV class="wiki-content">
								<TABLE class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR><TD class="confluenceTd" valign="top" width="15%"><P></P>
<DIV class="panel" style="background-color: #ECF4D1;border-color: #C3CDA1;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #C3CDA1;background-color: #C3CDA1;"><B>General</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
<P><A href="home.html" title="Home">Home</A><BR>
<A href="http://www.apache.org/licenses/LICENSE-2.0.html" class="external-link" rel="nofollow">License </A><BR>
<A href="sca-native-get-involved.html" title="SCA Native Get Involved">Get Involved</A><BR>
<A href="sca-native-found-a-bug.html" title="SCA Native Found a Bug">Found a Bug?</A></P>
</DIV></DIV>

<DIV class="panel" style="background-color: #ECF4D1;border-color: #b4b4b5;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #b4b4b5;background-color: #C3CDA1;"><B>SCA Native</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
<P><A href="sca-native.html" title="SCA Native">SCA Native Home</A><BR>
<A href="sca-native-releases.html" title="SCA Native Releases">Downloads</A><BR>
<A href="sca-native-documentation-menu.html" title="SCA Native Documentation Menu">Documentation</A><BR>
<A href="https://svn.apache.org/repos/asf/tuscany/sca-cpp/" class="external-link" rel="nofollow">Source Code</A></P>
</DIV></DIV></TD><TD class="confluenceTd" valign="top" width="85%">

<DIV class="panel" style="background-color: #ECF4D1;border-color: #C3CDA1;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #C3CDA1;background-color: #C3CDA1;"><B>How to get involved in development of Java SCA?</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
<P>This document is the development guideline for SCA Native project. </P>

<UL>
	<LI><A href="#SCANativeDeveloperGuide-GeneralGuide">General Guide</A></LI>
	<LI><A href="#SCANativeDeveloperGuide-GettingSource">Getting Source code</A></LI>
	<LI><A href="#SCANativeDeveloperGuide-Setup">Setting up your development environment</A>
	<UL>
		<LI><A href="#SCANativeDeveloperGuide-SetupLinux">Linux</A></LI>
		<LI><A href="#SCANativeDeveloperGuide-SetupWindows">Windows</A></LI>
	</UL>
	</LI>
	<LI><A href="#SCANativeDeveloperGuide-SystemRequirements">System Requirements</A></LI>
	<LI><A href="#SCANativeDeveloperGuide-Building">Building the source code</A></LI>
</UL>
</DIV></DIV>

<H3><A name="SCANativeDeveloperGuide-GeneralGuide"></A><A name="SCANativeDeveloperGuide-GeneralGuide"></A>General Guide</H3>


<H3><A name="SCANativeDeveloperGuide-GettingSourcecode"></A><A name="SCANativeDeveloperGuide-GettingSource"></A>Getting Source code</H3>

<P>The main Tuscany project repository is located at <A href="https://svn.apache.org/repos/asf/incubator/tuscany" class="external-link" rel="nofollow">https://svn.apache.org/repos/asf/incubator/tuscany</A>. You can use SVN to check out the entire project, and you will get both the java and C++ repositories. Alternatively you can check out just the cpp directory at <A href="https://svn.apache.org/repos/asf/incubator/tuscany/cpp" class="external-link" rel="nofollow">https://svn.apache.org/repos/asf/incubator/tuscany/cpp</A>, to get the SCA and SDO implementations for C++.</P>

<UL>
	<LI>From $HOME/tuscany, do svn co <A href="http://svn.apache.org/repos/asf/incubator/tuscany/cpp" class="external-link" rel="nofollow">http://svn.apache.org/repos/asf/incubator/tuscany/cpp</A>, this will check out all the source code in $HOME/tuscany/cpp.</LI>
	<LI>Configure your environment:
	<UL>
		<LI>export TUSCANY_SCACPP=$HOME/tuscany/cpp/sca/deploy</LI>
		<LI>export TUSCANY_SDOCPP=$HOME/tuscany/cpp/sdo/deploy</LI>
		<LI>export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TUSCANY_SDOCPP/lib:$TUSCANY_SCACPP/lib</LI>
	</UL>
	</LI>
</UL>


<H3><A name="SCANativeDeveloperGuide-Settingupyourdevelopmentenvironment"></A><A name="SCANativeDeveloperGuide-Setup"></A> Setting up your development environment 	</H3>

<P>Below you can find detailed instructions on how to configure the C++ runtime and tools for Linux or Windows.</P>

<H4><A name="SCANativeDeveloperGuide-Linux"></A><A name="SCANativeDeveloperGuide-SetupLinux"></A> Linux</H4>

<P> These steps take no more than 15 mns to complete,starting from scratch. After you complete them, you should be all set to build the Tuscany C++ runtime.</P>

<P>From a shell prompt, create a $HOME/tuscany directory.</P>

<P><B>Prerequisites</B></P>

<P>Install the following prerequisites:</P>

<OL>
	<LI>Subversion - SVN version 1.3.0 or later is good (most Linux distros already include SVN).</LI>
	<LI>Ant and a Java JDK are required by the SCA code generation tool used to generate proxies and wrappers for C++ components.
	<UL>
		<LI>Download apache-ant-1.6.5-bin to '$HOME/tuscany' do tar xzf apache-ant-1.6.5-bin.tar.gz.</LI>
		<LI>Configure your environment:
		<UL>
			<LI>export JAVA_HOME=$HOME/tuscany/jdk1.5.0_06</LI>
			<LI>PATH=$JAVA_HOME/bin:$PATH</LI>
		</UL>
		</LI>
		<LI>Download JDK 5.0 from java.sun.com.</LI>
		<LI>From $HOME/tuscany run jdk-1_5_0_06-linux-i586.bin, this will extract the JDK in $HOME/tuscany/jdk1.5.0_06.</LI>
		<LI>Configure your environment:
		<UL>
			<LI>export JAVA_HOME=$HOME/tuscany/jdk1.5.0_06</LI>
			<LI>PATH=$JAVA_HOME/bin:$PATH</LI>
		</UL>
		</LI>
	</UL>
	</LI>
	<LI>Libxml2 2.6.20 or later.Libxml2 is already in most Linux distros, just check that you have version 2.6.20 or later. To see which version of libxml2 is installed on your system do rpm -aq | grep libxml2.
	<UL>
		<LI>Configure your environment:
		<UL>
			<LI>export LIBXML2_LIB=/usr/lib</LI>
			<LI>export LIBXML2_INCLUDE=/usr/include/libxml2</LI>
		</UL>
		</LI>
	</UL>
	</LI>
	<LI>Axis2C version 0.92.
	<UL>
		<LI>Download axis2c-bin-0.92-linux.tar.gz from Apache.org.</LI>
		<LI>From $HOME/Tuscany do tar xzf axis2c-bin-0.92-linux.tar.gz, this will install Axis2C in $HOME/Tuscany/axis2c-bin-0.92-linux.</LI>
		<LI>Configure your environment:
		<UL>
			<LI>export AXIS2C_HOME=$HOME/tuscany/axis2c-bin-0.92-linux</LI>
			<LI>export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$AXIS2C_HOME/lib</LI>
		</UL>
		</LI>
	</UL>
	</LI>
</OL>


<H4><A name="SCANativeDeveloperGuide-Windows"></A><A name="SCANativeDeveloperGuide-SetupWindows"></A> Windows</H4>

<P> These steps take no more than 15 mns to complete,starting from scratch. After you complete them, you should be all set to build the Tuscany C++ runtime.</P>

<UL>
	<LI>Right click on &quot;My Computer&quot; and select properties. Select the advanced tab and click on Enviroment Variables. Under User Variables, click on new.</LI>
	<LI>In variable name type ANT_HOME</LI>
	<LI>In variable value insert the path to where you expanded apache ant. EG, &quot;C:\tuscany\apache-ant-1.6.5&quot; and hit ok.</LI>
</UL>


<UL>
	<LI>Now select the User variable PATH. Select new if it doesn't already create it.</LI>
	<LI>Append to the end the path to the apache-ant bin directory. EG, &quot;C:\tuscany\apache-ant-1.6.5\bin;&quot;</LI>
	<LI>Select ok and close the windows.</LI>
</UL>


<UL>
	<LI>Run the JDK installer.</LI>
	<LI>Right click on &quot;My Computer&quot; and select properties. Select the advanced tab and click on Enviroment Variables. Under User Variables, click on new.</LI>
</UL>


<UL>
	<LI>In variable name type JAVA_HOME</LI>
	<LI>In variable value insert the path to where you installed java. EG, &quot;C:\Program Files\Java\jdk1.5.0_07&quot;</LI>
	<LI>Select ok and close the windows.</LI>
</UL>



<H3><A name="SCANativeDeveloperGuide-SystemRequirements"></A><A name="SCANativeDeveloperGuide-SystemRequirements"></A> System Requirements</H3>

<P>In order to run the Tuscany Native runtimes there are some minimum system requirements:</P>

<TABLE class="wiki-table" cellpadding="0" cellspacing="0" border="0"><TR><TH><TR><TD><P>Operating System</P></TD></TH></TR><TR class="table-odd"><TD><TD><UL></TD></TR><TR class="table-even"><TD><LI>Windows XP SP2</LI></TD></TR><TR class="table-odd"><TD><LI>Linux</LI></TD></TR><TR class="table-even"><TD></UL></TD></TR><TR class="table-odd"><TD></TD></TR></TD></TR><TR class="table-even"><TD><TR><TD><P>Other components</P></TD></TD></TR><TR class="table-odd"><TD><TD><UL></TD></TR><TR class="table-even"><TD><LI><A href="http://ws.apache.org/axis2/c/" class="external-link" rel="nofollow">Apache Axis2/C verion 0.92</A></LI></TD></TR><TR class="table-odd"><TD><LI><A href="http://xmlsoft.org/downloads.html" class="external-link" rel="nofollow">Libxml2 Parser version 2.6.20</A></LI></TD></TR><TR class="table-even"><TD></UL></TD></TR><TR class="table-odd"><TD></TD></TR></TD></TR></TABLE>


<H3><A name="SCANativeDeveloperGuide-Buildingthesourcecode"></A><A name="SCANativeDeveloperGuide-Building"></A> Building the source code</H3>

<P>The builds use the GNU automake + configure tools, which nicely analyze your environment and generate all the make files you need.</P>

<P>To build the SDO C++ runtime:</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
cd $HOME/tuscany/cpp/sdo
./autogen.sh
./configure --prefix=$TUSCANY_SDOCPP --enable-<SPAN class="code-keyword">static</SPAN>=no
make
make install
cd $HOME/tuscany/cpp/sdo/samples
./autogen.sh
./configure --prefix=$TUSCANY_SDOCPP --enable-<SPAN class="code-keyword">static</SPAN>=no
make
make install
</PRE>
</DIV></DIV>    

<P>Note: Tuscany already has build.sh scripts that do all of this for you, but I wanted to use the individual commands to understand what was going on at each step. Also, when you make code changes in general you just run make and make install and not the whole set of steps.</P>

<P>To run the the SDO test suite:</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
cd $HOME/tuscany/cpp/sdo
./sdotest.sh
</PRE>
</DIV></DIV>

<P>To build the SCA C++ runtime:</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
cd $HOME/tuscany/cpp/sca
./autogen.sh
./configure --prefix=$TUSCANY_SCACPP --enable-<SPAN class="code-keyword">static</SPAN>=no
make
make install
cd $HOME/tuscany/cpp/sdo/samples
./autogen.sh
./configure --prefix=$TUSCANY_SCACPP --enable-<SPAN class="code-keyword">static</SPAN>=no
make
make install
</PRE>
</DIV></DIV>

<P>To run the SCA runtime tests:</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
cd $HOME/tuscany/cpp/sdo
./scatest.sh
</PRE>
</DIV></DIV>

<P>To run the SCA calculator sample:</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
cd $HOME/tuscany/cpp/sca/deploy/samples/Calculator/deploy/bin
./runclient.sh
</PRE>
</DIV></DIV>
</TD></TR></TBODY></TABLE>
							</DIV>
						</DIV>
					</DIV>	
		            <!-- pageContent macro end -->
					
                </TD>
            </TR>
        </TABLE>

		<!-- footer macro -->
				<SCRIPT src="http://www.google-analytics.com/urchin.js" type="text/javascript">
		</SCRIPT>
		<SCRIPT type="text/javascript">
		   _uacct = "UA-1174707-5";
		   urchinTracker();
		</SCRIPT>
		
				<A href="http://www.statcounter.com/" target="_blank"><IMG src="http://c26.statcounter.com/counter.php?sc_project=2619156&java=0&security=94bd7e7d&invisible=0" alt="website stats" border="0"></A>    

		<DIV class="footer">
			Copyright � 2003-2012, The Apache Software Foundation&nbsp;&nbsp;</BR>
                        Apache Tuscany and the Apache Tuscany project logo are trademarks of The Apache Software Foundation.
		</DIV>
		<!-- footer macro end -->

    </BODY>
</HTML>