tag:blogger.com,1999:blog-44992690527519622002024-03-22T04:04:29.198+05:30Sai Geetha's Technical BlogMy thoughts on various things as I explore and learn. If you are an interested android developer, you can visit my <a href="http://saigeethamn.blogspot.com">android blog</a>Saihttp://www.blogger.com/profile/12784084112335938233noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-4499269052751962200.post-43656375734362388892012-07-27T15:01:00.000+05:302012-07-27T15:01:17.315+05:30SOAP-based Web Services in Java: A start-up Primer<br />
<div class="MsoNormal">
<span lang="EN-GB">I feel compelled to share a simple Web Service
program in Java as I see this is quite an old technology that only advanced things are found everywhere - lot of generated code etc.. but the fundamentals are lost in the process...<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l3 level1 lfo1; text-indent: -18.0pt;">
<span lang="EN-GB">1.<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><span lang="EN-GB">Create a SOAP-based Web Service<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l3 level1 lfo1; text-indent: -18.0pt;">
<span lang="EN-GB">2.<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><span lang="EN-GB">Look at WSDL<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l3 level1 lfo1; text-indent: -18.0pt;">
<span lang="EN-GB">3.<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><span lang="EN-GB">Generate Proxies<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l3 level1 lfo1; text-indent: -18.0pt;">
<span lang="EN-GB">4.<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><span lang="EN-GB">Create a Web Services client <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">Pre-requisites:<o:p></o:p></span></div>
<div class="MsoListParagraph" style="mso-list: l2 level1 lfo2; text-indent: -18.0pt;">
<span lang="EN-GB">1.<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><span lang="EN-GB">Eclipse installed with J2EE
support<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">Not Required:<o:p></o:p></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo3; text-indent: -18.0pt;">
<span lang="EN-GB">1.<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><span lang="EN-GB">Any web server as this is pure
Java based<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">Basics:<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">The fundamental elements are to create:<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l1 level1 lfo4; text-indent: -18.0pt;">
<span lang="EN-GB">1.<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><span lang="EN-GB">An interface<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l1 level1 lfo4; text-indent: -18.0pt;">
<span lang="EN-GB">2.<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><span lang="EN-GB">An implementation class<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l1 level1 lfo4; text-indent: -18.0pt;">
<span lang="EN-GB">3.<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><span lang="EN-GB">A webservice publisher<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">Here is the interface Definition:</span></div>
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-GB"><code></code></span></div>
<div class="MsoNormal">
<code><span lang="EN-GB">
</span></code></div>
<div class="MsoNormal">
<code><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">package</span></b><span style="font-family: Monaco; font-size: 11pt;"> com.sai.ws;</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></code></div>
<code>
</code><br />
<div class="MsoNormal">
<code><br /></code></div>
<code>
</code><br />
<div class="MsoNormal">
<code><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">import</span></b><span style="font-family: Monaco; font-size: 11pt;"> javax.jws.WebService;</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></code></div>
<code>
</code><br />
<div class="MsoNormal">
<code><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">import</span></b><span style="font-family: Monaco; font-size: 11pt;"> javax.jws.WebMethod;</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></code></div>
<code>
</code><br />
<div class="MsoNormal">
<code><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">import</span></b><span style="font-family: Monaco; font-size: 11pt;"> javax.jws.soap.SOAPBinding;</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></code></div>
<code>
<div class="MsoNormal">
<b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">import</span></b><span style="font-family: Monaco; font-size: 11pt;"> javax.jws.soap.SOAPBinding.Style;</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: #646464; font-family: Monaco; font-size: 11pt;">@WebService</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #646464; font-family: Monaco; font-size: 11pt;">@SOAPBinding</span><span style="font-family: Monaco; font-size: 11pt;">(style = Style.</span><i><span style="color: #0000c0; font-family: Monaco; font-size: 11pt;">RPC</span></i><span style="font-family: Monaco; font-size: 11pt;">)</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">public</span></b><span style="font-family: Monaco; font-size: 11pt;"> </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">interface</span></b><span style="font-family: Monaco; font-size: 11pt;"> <span style="background-color: silver;">EchoServer</span> {</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><span style="color: #646464; font-family: Monaco; font-size: 11pt;">@WebMethod</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> String echoMessage(String strMsg);</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;">}</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
</code><br />
<div class="MsoNormal">
<code><span style="font-family: Monaco; font-size: 11pt;"></span></code></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span lang="EN-GB">Here using annotations, we are declaring
that this is a WebService Interface with SOAPBinding following the simple RPC
style.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">Now to the class that implements this
interface:<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-GB">
</span></div>
<div class="MsoNormal">
<span style="color: #646464; font-family: Monaco; font-size: 11pt;">@WebService</span><span style="font-family: Monaco; font-size: 11pt;">(endpointInterface = </span><span style="color: #2a00ff; font-family: Monaco; font-size: 11pt;">"com.sai.ws.EchoServer"</span><span style="font-family: Monaco; font-size: 11pt;">)</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">public</span></b><span style="font-family: Monaco; font-size: 11pt;"> </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">class</span></b><span style="font-family: Monaco; font-size: 11pt;">
EchoServerImpl </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">implements</span></b><span style="font-family: Monaco; font-size: 11pt;"> EchoServer{</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><span style="color: #646464; font-family: Monaco; font-size: 11pt;">@Override</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">public</span></b><span style="font-family: Monaco; font-size: 11pt;"> String
echoMessage(String strMsg) {</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> String capitalizedMsg;</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> System.</span><i><span style="color: #0000c0; font-family: Monaco; font-size: 11pt;">out</span></i><span style="font-family: Monaco; font-size: 11pt;">.println(</span><span style="color: #2a00ff; font-family: Monaco; font-size: 11pt;">"Server:
EchoMessage() invoked..."</span><span style="font-family: Monaco; font-size: 11pt;">);</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> System.</span><i><span style="color: #0000c0; font-family: Monaco; font-size: 11pt;">out</span></i><span style="font-family: Monaco; font-size: 11pt;">.println(</span><span style="color: #2a00ff; font-family: Monaco; font-size: 11pt;">"Server:
Message> "</span><span style="font-family: Monaco; font-size: 11pt;"> + strMsg);</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> capitalizedMsg = strMsg.toUpperCase();</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">return</span></b><span style="font-family: Monaco; font-size: 11pt;"> capitalizedMsg;</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> }</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;">}<o:p></o:p></span></div>
<br />
<br />
<br />
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-GB">
</span></div>
<div class="MsoNormal">
<span lang="EN-GB">The implementation merely capitalizes the
message and return he same. Note here that the annotation @WebService needs to
declare that this is an implementation of the interface “com.sai.ws.EchoServer”
which is the endpointInterface of the service.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">Now we are done. Implemented the Service.
We need to publish this service. We can publish it locally by the following:<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">public</span></b><span style="font-family: Monaco; font-size: 11pt;"> </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">class</span></b><span style="font-family: Monaco; font-size: 11pt;"> <span style="background-color: silver;">EchoServerPublisher</span> {</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">public</span></b><span style="font-family: Monaco; font-size: 11pt;"> </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">static</span></b><span style="font-family: Monaco; font-size: 11pt;"> </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">void</span></b><span style="font-family: Monaco; font-size: 11pt;"> main(String args[]) {</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> Endpoint.<i>publish</i>(</span><span style="color: #2a00ff; font-family: Monaco; font-size: 11pt;">"http://localhost:9876/es"</span><span style="font-family: Monaco; font-size: 11pt;">,</span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">new</span></b><span style="font-family: Monaco; font-size: 11pt;">
EchoServerImpl());</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> }</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;">}</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">Now, you execute the above java program and
your Webservice is running. Endpoint c</span><span style="background-color: white; font-size: 13.5pt;">reates
and publishes an endpoint for the specified implementor object (EchoServerImpl)
at the given address (<a href="http://localhost:9876/es">http://localhost:9876/es</a>).
The necessary server infrastructure will be created and configured by the
JAX-WS internal implementation using some default configuration. <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">So far, we have created a webservice
interface, implementation and published it. <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">Now you can view the WSDL generated by
accessing the URL: <a href="http://localhost:9876/es?wsdl">http://localhost:9876/es?wsdl</a><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="background-color: white;">This is a verbose WSDL that describes the
message style, the interface consisting of the request-response style, the
bindings of ‘how’ to acess the service and the ‘where’ to access it finally
(the URL).</span></div>
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-GB"><span lang="EN-GB" style="font-family: Cambria; font-size: 12pt;">The various components of the WSDL may be
summarized as follows:</span>
</span></div>
<div class="MsoNormal">
<span lang="EN-GB"><span lang="EN-GB" style="font-family: Cambria; font-size: 12pt;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0mbXX1o7J8rLQjVHM5dVKUSBV68_eTxlypa6Yg9n4SpqitQlk7cNJtXDjChDlDNs79sBK2odKAH-JE-ZQcEH3CD6erLaykQgzc1WRkcaJ7KkQRzf5PF0ClTs4yFGL5UfT6SUwBbSkD_UF/s1600/WebService+Components.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="241" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0mbXX1o7J8rLQjVHM5dVKUSBV68_eTxlypa6Yg9n4SpqitQlk7cNJtXDjChDlDNs79sBK2odKAH-JE-ZQcEH3CD6erLaykQgzc1WRkcaJ7KkQRzf5PF0ClTs4yFGL5UfT6SUwBbSkD_UF/s400/WebService+Components.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="MsoNormal">
<span lang="EN-GB">How do you consume this from a client. Let
us write a simple client project named “WebServiceCLientExample”. Create a
class “SimpleServiceClient” in that project. <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">Here is the method to access the Service
within the client:<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">public</span></b><span style="font-family: Monaco; font-size: 11pt;"> </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">static</span></b><span style="font-family: Monaco; font-size: 11pt;"> </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">void</span></b><span style="font-family: Monaco; font-size: 11pt;"> main (String args[]) </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">throws</span></b><span style="font-family: Monaco; font-size: 11pt;"> Exception{</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">final</span></b><span style="font-family: Monaco; font-size: 11pt;"> URL url = </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">new</span></b><span style="font-family: Monaco; font-size: 11pt;"> URL(</span><span style="color: #2a00ff; font-family: Monaco; font-size: 11pt;">"http://localhost:9876/es"</span><span style="font-family: Monaco; font-size: 11pt;">);</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">final</span></b><span style="font-family: Monaco; font-size: 11pt;"> QName name = </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">new</span></b><span style="font-family: Monaco; font-size: 11pt;"> QName(</span><span style="color: #2a00ff; font-family: Monaco; font-size: 11pt;">"http://ws.sai.com/"</span><span style="font-family: Monaco; font-size: 11pt;">, </span><span style="color: #2a00ff; font-family: Monaco; font-size: 11pt;">"EchoServerImplService"</span><span style="font-family: Monaco; font-size: 11pt;">);</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">final</span></b><span style="font-family: Monaco; font-size: 11pt;"> Service service
= Service.<i>create</i>(url, name);</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">final</span></b><span style="font-family: Monaco; font-size: 11pt;"> EchoServer
simple = service.getPort(EchoServer.</span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">class</span></b><span style="font-family: Monaco; font-size: 11pt;">);</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> System.</span><i><span style="color: #0000c0; font-family: Monaco; font-size: 11pt;">out</span></i><span style="font-family: Monaco; font-size: 11pt;">.println(simple.echoMessage(</span><span style="color: #2a00ff; font-family: Monaco; font-size: 11pt;">"Hello Everyone!"</span><span style="font-family: Monaco; font-size: 11pt;">));</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> }</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">As you see, from the client we need to
specify the URL to access the service: </span><span style="color: #2a00ff; font-family: Monaco; font-size: 11pt;"><a href="http://localhost:9876/es">http://localhost:9876/es</a><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Then we need to
specify the qualified namespace that consists of two things:<o:p></o:p></div>
<ol start="1" style="margin-top: 0cm;" type="1">
<li class="MsoNormal">The URI is the value of the @namespace
attribute in WSDL.<o:p></o:p></li>
<li class="MsoNormal">The local part is the value of the
service[@name] attribute at the bottom of WSDL.<o:p></o:p></li>
</ol>
<div class="MsoNormal">
<span lang="EN-GB">As shown here:<o:p></o:p></span></div>
<div class="MsoNormal">
<b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">final</span></b><span style="font-family: Monaco; font-size: 11pt;"> QName name = </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">new</span></b><span style="font-family: Monaco; font-size: 11pt;"> QName(</span><span style="color: #2a00ff; font-family: Monaco; font-size: 11pt;">"http://ws.sai.com/"</span><span style="font-family: Monaco; font-size: 11pt;">, </span><span style="color: #2a00ff; font-family: Monaco; font-size: 11pt;">"EchoServerImplService"</span><span style="font-family: Monaco; font-size: 11pt;">);<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Then, we create the
service as in:<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;"> </span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">final</span></b><span style="font-family: Monaco; font-size: 11pt;"> Service
service = Service.<i>create</i>(url, name);</span><span style="font-family: Monaco; font-size: 11pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">Finally get our port:<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">final</span></b><span style="font-family: Monaco; font-size: 11pt;"> EchoServer simple = service.getPort(EchoServer.</span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">class</span></b><span style="font-family: Monaco; font-size: 11pt;">);<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">Then, call the methods on that port:<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Monaco; font-size: 11pt;">simple.echoMessage(</span><span style="color: #2a00ff; font-family: Monaco; font-size: 11pt;">"Hello Everyone!")<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">This completes a simple webservice and a
client to the webservice in plain java. However, not that for the client to
work in the above format (without any proxy generation), you will have to
include the webservice project in the classpath of the client project. If not, </span><span style="font-family: Monaco; font-size: 11pt;">service.getPort(EchoServer.</span><b><span style="color: #7f0055; font-family: Monaco; font-size: 11pt;">class</span></b><span style="font-family: Monaco; font-size: 11pt;">) </span><span lang="EN-GB">will throw an error as EchoServer.class cannot
be found in the path.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">So, in reality, you will not have the
server classes available on the client side as Webservices are for remote
access of the service. In that case, you will have to download the WSDL from
the URL <a href="http://localhost:9876/es?wsdl">http://localhost:9876/es?wsdl</a>
and include into into the client project. Then, right click the file and select
‘Web Services - > Generate Client’. You get this dialog box:<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI6PUns2Yku9uovCfq1AdAvln-i7yxF6GnjlnehnynsA4tuw36p9TOAC0zRAMdQ680JKDhvWb0NL2gxk2DhJMtgb8kgPXWeCkRIB3YAG8J45ghmOaFYwKAIoYg5AxV9eBsfmf-wib3w72N/s1600/Screen+Shot+2012-07-27+at+10.21.52+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="304" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI6PUns2Yku9uovCfq1AdAvln-i7yxF6GnjlnehnynsA4tuw36p9TOAC0zRAMdQ680JKDhvWb0NL2gxk2DhJMtgb8kgPXWeCkRIB3YAG8J45ghmOaFYwKAIoYg5AxV9eBsfmf-wib3w72N/s320/Screen+Shot+2012-07-27+at+10.21.52+AM.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB"><span lang="EN-GB" style="font-family: Cambria; font-size: 12pt;"><br /></span></span></div>
<br />
<div class="MsoNormal">
<br />
<div class="MsoNormal">
<span lang="EN-GB">Select only Develop client. If you use the
slider, it will generate a lot more which you can explore if you are interested.
Click ‘next’ and finish. <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">You will have the following files (proxies
generated)<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBcHtzDLUxvBQu2xk1qV3uJbFmb8IVqltqcEI18ua82CjnfqHvtCBvyd1M2uT3ZojzjeY2H6z1WElLS6TnViKvpkWX1j95zs_vnDu6xHGkXTCKj3GZT7zltPhd1mSdhZgulCsLMBgRfCwi/s1600/Screen+Shot+2012-07-27+at+11.04.44+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="188" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBcHtzDLUxvBQu2xk1qV3uJbFmb8IVqltqcEI18ua82CjnfqHvtCBvyd1M2uT3ZojzjeY2H6z1WElLS6TnViKvpkWX1j95zs_vnDu6xHGkXTCKj3GZT7zltPhd1mSdhZgulCsLMBgRfCwi/s320/Screen+Shot+2012-07-27+at+11.04.44+AM.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
</div>
<br />
<div class="MsoNormal">
<span lang="EN-GB">Now, you should be able to compile the
client and use it remotely.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">Hope this helps in your first step to
SOAP-based web services.<o:p></o:p></span></div>
<br />
<br /><div class="blogger-post-footer"><script type="text/javascript"><!--
amazon_ad_tag = "saigstec-20"; amazon_ad_width = "728"; amazon_ad_height = "90";//--></script>
<script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script></div>Saihttp://www.blogger.com/profile/12784084112335938233noreply@blogger.com3tag:blogger.com,1999:blog-4499269052751962200.post-14544639813986106882011-05-25T12:38:00.000+05:302011-05-25T12:38:01.176+05:30OAuth - A Brief IntroductionOauth is the rescue mechanism when you want to share some of your data with another site or software without sharing the credentials for accessing your data. For e.g. If you want to share your photos that are private on Picasa without sharing your Picasa credentials with a Photo Studio for printing, OAuth comes to your rescue.<br />
<br />
<br />
OAuth allows this by handing out a token to the requesting site instead of sharing the login credentials itself. <br />
<br />
The token itself can define access to which site for which specific resources and for a defined duration.<br />
<br />
This requires implementation from the accessing site as well as the site having the resources to share with the accessing site along with the device being used for the access.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZQJmm2xW2ec5QidzKtvRmSQLy2zWw3nu6yOgg5GkzVyj9mkKbxKBWWQBrjAkLH1qSSZtlZ3MHn-oxiNR-YYqn4rqgW3Po8LVwr7wekBLFnFCJU-eQosAZ-MqblekS6OWwqt8K8qIpn2PP/s1600/OAuth.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="188" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZQJmm2xW2ec5QidzKtvRmSQLy2zWw3nu6yOgg5GkzVyj9mkKbxKBWWQBrjAkLH1qSSZtlZ3MHn-oxiNR-YYqn4rqgW3Po8LVwr7wekBLFnFCJU-eQosAZ-MqblekS6OWwqt8K8qIpn2PP/s320/OAuth.PNG" t8="true" width="320" /></a></div><br />
1. User logs in to the Resource Accessing site (Consumer) like a print studio’s site<br />
<br />
<br />
2. User places an order for print of photos stored in another site (Service Provider Site).<br />
<br />
3. The Consumer site redirects the user to the Service Provider site<br />
<br />
4. At the 2nd site, the user signs into the account where the site questions if the user certainly wants to share the resources with the origin site. On agreeing, the service provider site creates a token with information on what resources can be accessed for how long and <br />
<br />
5. Then the token is shared with the Consumer site <br />
<br />
6. Based on the token provided, the Consumer site can access the resources from the Provider site.<br />
<br />
<br />
So, in this whole process the user did not have to share the login credentials at any point of time with the consumer site. This is the biggest advantage of the OAuth mechanism and is widely used by all the major social networking sites currently. <br />
<br />
<br />
This helps in reducing the problem of having sharing resources across sites without sharing the user credentials between them.<br />
<br />
In the OAuth Parlance, the following jargon are equivalent: <br />
<br />
<br />
1. User a.k.a. Resource Owner<br />
<br />
2. Service Provider a.k.a Server<br />
<br />
3. Consumer a.k.a Client<div class="blogger-post-footer"><script type="text/javascript"><!--
amazon_ad_tag = "saigstec-20"; amazon_ad_width = "728"; amazon_ad_height = "90";//--></script>
<script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script></div>Saihttp://www.blogger.com/profile/12784084112335938233noreply@blogger.com0tag:blogger.com,1999:blog-4499269052751962200.post-79775537394912688842011-02-14T16:22:00.000+05:302011-02-14T16:22:49.493+05:30Developing Apps for iPhone and iPadWhile both iPhone and iPad are from Apple and have the same underling OS and it is possible to run applications built for iPhone to be installed on iPad as well, porting iPhone apps to iPad is not a straight forward exercise.<br />
<br />
In principle, the same app can run, however the user experience will not be great and will not meet the expectations of the use as the larger real estate on iPad will not be efficiently used.<br />
<br />
Also, there are some fundamental differences between the two which have to be kept in mind while developing the applications:<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin-left: 4.65pt; width: 337px;"><tbody>
<tr style="height: 15.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;"> <td style="border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: .5pt; mso-border-color-alt: windowtext; mso-border-left-alt: 1.0pt; mso-border-right-alt: .5pt; mso-border-style-alt: solid; mso-border-top-alt: 1.0pt; padding: 0in 5.4pt 0in 5.4pt; width: 58.0pt;" valign="bottom" width="77"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><b><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">Features<o:p></o:p></span></b></div></td> <td style="border-left: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext 1.0pt; padding: 0in 5.4pt 0in 5.4pt; width: 97.0pt;" valign="bottom" width="129"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><b><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">iPhone<o:p></o:p></span></b></div></td> <td style="border-left: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext 1.0pt; mso-border-top-alt: solid windowtext 1.0pt; padding: 0in 5.4pt 0in 5.4pt; width: 98.0pt;" valign="bottom" width="131"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><b><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">iPad<o:p></o:p></span></b></div></td> </tr>
<tr style="height: 15.0pt; mso-yfti-irow: 1;"> <td style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext 1.0pt; mso-border-right-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 58.0pt;" valign="bottom" width="77"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">Phone<o:p></o:p></span></div></td> <td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 97.0pt;" valign="bottom" width="129"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">Yes<o:p></o:p></span></div></td> <td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext 1.0pt; padding: 0in 5.4pt 0in 5.4pt; width: 98.0pt;" valign="bottom" width="131"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">No<o:p></o:p></span></div></td> </tr>
<tr style="height: 45.0pt; mso-yfti-irow: 2;"> <td style="border-top: none; border: solid windowtext 1.0pt; height: 45.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext 1.0pt; mso-border-right-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 58.0pt;" valign="bottom" width="77"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">Camera<o:p></o:p></span></div></td> <td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 45.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 97.0pt;" valign="bottom" width="129"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">Yes (2 for video conferencing in iPhone 4)<o:p></o:p></span></div></td> <td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 45.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext 1.0pt; padding: 0in 5.4pt 0in 5.4pt; width: 98.0pt;" valign="bottom" width="131"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">No<o:p></o:p></span></div></td> </tr>
<tr style="height: 15.0pt; mso-yfti-irow: 3;"> <td style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext 1.0pt; mso-border-right-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 58.0pt;" valign="bottom" width="77"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">Screen Size<o:p></o:p></span></div></td> <td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 97.0pt;" valign="bottom" width="129"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">3.5 inch display<o:p></o:p></span></div></td> <td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext 1.0pt; padding: 0in 5.4pt 0in 5.4pt; width: 98.0pt;" valign="bottom" width="131"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">9.7 inch display<o:p></o:p></span></div></td> </tr>
<tr style="height: 15.0pt; mso-yfti-irow: 4;"> <td style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext 1.0pt; mso-border-right-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 58.0pt;" valign="bottom" width="77"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">Resolution<o:p></o:p></span></div></td> <td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 97.0pt;" valign="bottom" width="129"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">960 x 480<o:p></o:p></span></div></td> <td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext 1.0pt; padding: 0in 5.4pt 0in 5.4pt; width: 98.0pt;" valign="bottom" width="131"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">1024 x 768<o:p></o:p></span></div></td> </tr>
<tr style="height: 30.0pt; mso-yfti-irow: 5;"> <td style="border-top: none; border: solid windowtext 1.0pt; height: 30.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext 1.0pt; mso-border-right-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 58.0pt;" valign="bottom" width="77"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">GPS<o:p></o:p></span></div></td> <td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 30.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 97.0pt;" valign="bottom" width="129"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">Yes<o:p></o:p></span></div></td> <td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 30.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext 1.0pt; padding: 0in 5.4pt 0in 5.4pt; width: 98.0pt;" valign="bottom" width="131"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">only on Wi-Fi supported Models<o:p></o:p></span></div></td> </tr>
<tr style="height: 15.75pt; mso-yfti-irow: 6; mso-yfti-lastrow: yes;"> <td style="border-top: none; border: solid windowtext 1.0pt; height: 15.75pt; mso-border-bottom-alt: solid windowtext 1.0pt; mso-border-left-alt: solid windowtext 1.0pt; mso-border-right-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 58.0pt;" valign="bottom" width="77"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">Sensors<o:p></o:p></span></div></td> <td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.75pt; mso-border-bottom-alt: solid windowtext 1.0pt; mso-border-right-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 97.0pt;" valign="bottom" width="129"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">Gyroscope<o:p></o:p></span></div></td> <td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.75pt; padding: 0in 5.4pt 0in 5.4pt; width: 98.0pt;" valign="bottom" width="131"> <div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"><span style="color: black; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: Calibri;">No Gyroscope<o:p></o:p></span></div></td> </tr>
</tbody></table><br />
<div>Every app needs to consider the Screen size and Resolution as the major difference. However apps that include phone features, GPS or Camera features will have to be rewritten for iPad. </div><div><br />
</div><div>Also, the lack of gyroscope in iPad makes it not so very suitable for gaming apps.</div><div><br />
</div><div class="blogger-post-footer"><script type="text/javascript"><!--
amazon_ad_tag = "saigstec-20"; amazon_ad_width = "728"; amazon_ad_height = "90";//--></script>
<script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script></div>Saihttp://www.blogger.com/profile/12784084112335938233noreply@blogger.com0tag:blogger.com,1999:blog-4499269052751962200.post-78696185679790911682011-02-07T16:49:00.000+05:302011-02-07T16:49:29.116+05:30Telnet on Windows 7<span class="Apple-style-span" style="font-family: inherit;">By default, telnet is not enabled on Windows 7 <span class="Apple-style-span" style="color: #505050;">due to insecure connection security concern.</span></span><br />
<span class="Apple-style-span" style="color: #505050;"><span class="Apple-style-span" style="font-family: inherit;"><br />
</span></span><br />
<span class="Apple-style-span" style="color: #505050;"><span class="Apple-style-span" style="font-family: inherit;">In order to enable and install Telnet in Windows 7, the steps are easy, and similar to procedures to turn on and enable Telnet in Windows Vista:<br />
<br />
* Open Control Panel.<br />
* Go to Programs or Programs and Features.<br />
* Click Turn Windows features on or off.<br />
* In the “Windows Features” dialog box, select (tick) the Telnet Client check box.<br />
<br />
* Click OK.<br />
* After installation is done, Telnet can be used and called immediately.</span></span><div class="blogger-post-footer"><script type="text/javascript"><!--
amazon_ad_tag = "saigstec-20"; amazon_ad_width = "728"; amazon_ad_height = "90";//--></script>
<script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script></div>Saihttp://www.blogger.com/profile/12784084112335938233noreply@blogger.com1tag:blogger.com,1999:blog-4499269052751962200.post-35042412954685461192011-01-21T16:41:00.000+05:302011-01-21T16:41:00.598+05:30Enterprise Architect Vs. Solution ArchitectThere are a lot of Architects and types of Architectures that are spoken about leading to a dilution in the meaning and the responsibilities of each.<br />
<br />
After going through the TOGAF literature on Enterprise Architecture, I was able to clearly distinguish between the roles and responsibilities of an Enterprise Architect and Solution Architect based on the work they are supposed to be doing.<br />
<br />
Keeping in mind that Enterprise Architecture is to draw a Roadmap to align IT to Business by assessing the current state and understanding its gap from the target state, and Enterprise Architect is one who is able to come up with the transitional architectures that lead to various IT projects typically (sometimes even business projects). EA would define the solution context along with the high level transition architectures and hand over to the 'Solution Architect' with the details of the analysis.<br />
<br />
After this, the EA is involved only in Governance Procedures to ensure that the Solution in the project is being implemented on the suggested solution building blocks and adhering to the initially defined Architectural principles. <br />
<br />
It is at the point just before the roll out of projects or at the beginning of a roll out that a solution architect takes over from an EA and starts detailing the solution with the help of data, infrastructure and application architects (if required based on SMEs required). An SA would be answerable to an EA on any deviations required, justifications for the same etc.<br />
<br />
Does this ring the bell? Is this the way the industry works? Any thoughts?<div class="blogger-post-footer"><script type="text/javascript"><!--
amazon_ad_tag = "saigstec-20"; amazon_ad_width = "728"; amazon_ad_height = "90";//--></script>
<script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script></div>Saihttp://www.blogger.com/profile/12784084112335938233noreply@blogger.com5tag:blogger.com,1999:blog-4499269052751962200.post-67822765041462110732011-01-21T16:10:00.000+05:302011-01-21T16:10:33.027+05:30TOGAF and ZachmanThere are quite a few Enterprise Architecture Frameworks like TOGAF, Zachman, DODAF, FEAF and many more.<br />
<br />
However, the most often talked about are TOGAF and Zachman in the IT communities that I have interacted with. So, I thought, I will share my thoughts on what are the major differences between the two.<br />
<br />
They have somethings in common but are widely different in terms of their coverage.<br />
<br />
TOGAF is a methodology that includes a EA Process (The ADM) as well as the taxonomy and the required templates and guidelines for an enterprise architecture practice.<br />
<br />
However, Zachman only provides only a taxonomy (pretty exhaustive) and is completely silent on the process, guidelines and techniques.<br />
<br />
To draw parallels between the two, TOGAF suggests an Architecture Content Framework consisting of a Content Meta Model - Zachman's taxonomy maps to this part of the TOGAF specification.<br />
<br />
Hence it is often claimed that TOGAF can work in conjunction with any other EA model like the Zachman Framework - since the taxonomy could be derived from Zachman while the process could be that of TOGAF.<div class="blogger-post-footer"><script type="text/javascript"><!--
amazon_ad_tag = "saigstec-20"; amazon_ad_width = "728"; amazon_ad_height = "90";//--></script>
<script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script></div>Saihttp://www.blogger.com/profile/12784084112335938233noreply@blogger.com0tag:blogger.com,1999:blog-4499269052751962200.post-48464295696917763962011-01-21T15:33:00.000+05:302011-01-21T15:33:35.262+05:30What is Enterprise Architecture?Here is my take on trying to define Enterprise Architecture:<br />
<br />
It is a methodology<br />
that provides a process, guidelines and techniques that help in developing an 'Enterprise Landscape' consisting of its Business Processes, its IT applications, its Data and its supporting Infrastructure (including their geographical spread)<br />
thus enabling the enterprise to optimize and manage complexity, respond quickly to changes and align itself to the enterprise's Strategic Goal and Objectives<br />
with clear transitional steps from the current state to the desired state, in the least disruptive way possible.<div class="blogger-post-footer"><script type="text/javascript"><!--
amazon_ad_tag = "saigstec-20"; amazon_ad_width = "728"; amazon_ad_height = "90";//--></script>
<script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script></div>Saihttp://www.blogger.com/profile/12784084112335938233noreply@blogger.com2tag:blogger.com,1999:blog-4499269052751962200.post-78742949756033152512011-01-21T15:06:00.000+05:302011-01-21T15:06:24.768+05:30TOGAF 9 - A Brief Introduction<div class="MsoNormal"></div><div class="MsoNormal">In the next few articles, I will be sharing my thoughts on TOGAF 9 as I am discovering it…</div><div class="MsoNormal"><br />
</div><div class="MsoNormal">TOGAF 9, at the very outset is an Enterprise Architecture Methodology and a Framework. What does it mean? In simple terms, it provides the process to be followed as well as the content taxonomy along with some suggested techniques. It leds itself to tailoring for an enterprise's specific needs.</div><div class="MsoNormal">However, it also seems like a methodology that is very inclined towards the "IT nature" of an enterprise. I will write a separate blog article on why I feel so, with references to the TOGAF methodology.</div><div class="MsoNormal"><br />
</div><div class="MsoNormal">Through its famous ADM (Architecture Development Method), it tells the various phases of a typical enterprise architecture iteration (as this needs to be done in iterations to be able to cover all the functions / verticals in an enterprise). </div><div class="MsoNormal"><br />
</div><div class="MsoNormal">I will briefly touch upon the 6 main parts that constitute TOGAF completely:</div><div class="MsoNormal"></div><ol><li>The Architecture Development Method (ADM)</li>
<li>ADM Guidelines and Techniques</li>
<li>The Enterprise Continuum</li>
<li>Architecture Content Framework</li>
<li>TOGAF Reference Models</li>
<li>The Architecture Capability Framework</li>
</ol><br />
<div class="MsoNormal">A few words about what each of these mean:</div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><b>ADM</b> – This is a major component of TOGAF and provides guidance to the Enterprise Architecture group on the possible architecture development phases with each phase being described with details such as an objective, approach, inputs, steps, outputs. This is executed iteratively.</div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><b>ADM Guidelines and Techniques</b> – provides a large number of guidelines and techniques on how to apply ADM. Guidelines help to adapt the ADM. Techniques support specific tasks in ADM.</div><div class="MsoNormal"><br />
</div><div class="MsoNormal">These I found to be basic, useful starting points and extensible.</div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><b>The Enterprise Continuum</b> – provides a model for structuring a virtual repository and provides methods for classifying architecture and solution artifacts. </div><div class="MsoNormal"><br />
</div><div class="MsoNormal">It helps in categorizing based on industry standards, architectural patterns etc. While TOGAF 8 just provided this, TOGAF 9 provides the below mentioned Architecture Content Framework which is one way of realizing the Enterprise Continuum.</div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><b>Architecture Content Framework</b> – provides a detailed model or meta model of architectural work products including deliverables, artifacts and the Architecture building blocks. This is one realization of the Enterprise Continuum.</div><div class="MsoNormal"><br />
</div><div class="MsoNormal">This is very useful for creating taxonomy of enterprise architecture artifacts generated throughout the lifecycle of architectural work. Any repository to be maintained in the enterprise can get a starting point here.</div><div class="MsoNormal">The common thread across TOGAF is that every single bit is almost customizable to the context of one’s enterprise. </div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><b>TOGAF Reference Models</b> – This provides one integration / interoperability reference model called the III-RM (Integrated Information Infrastructure Reference Model) and the TRM (Technical Reference Model). </div><div class="MsoNormal"><br />
</div><div class="MsoNormal">In my opinion, probably something known well in the industry and probably a bit archaic!</div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><b>The Architecture Capability Framework</b> – These are certain guidelines and resources to help an architect set up the architecture practice in an organization. </div><div class="MsoNormal"><br />
</div><div class="MsoNormal">This would be useful especially in the beginning of an EA practice.</div><div class="blogger-post-footer"><script type="text/javascript"><!--
amazon_ad_tag = "saigstec-20"; amazon_ad_width = "728"; amazon_ad_height = "90";//--></script>
<script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script></div>Saihttp://www.blogger.com/profile/12784084112335938233noreply@blogger.com0tag:blogger.com,1999:blog-4499269052751962200.post-61233512867757073792011-01-21T14:52:00.000+05:302011-01-21T14:52:46.013+05:30Benefits of Enterprise ArchitectureOf late, I have been wondering a lot about what tangible benefits would any Enterprise Architecture initiative bring to the Enterprise.<br />
Or put in another way, when would an enterprise be driven to set up an Enterprise Architecture practice?<br />
<br />
<br />
<div class="MsoNormal"><span lang="EN-US" style="mso-ansi-language: EN-US;">Here are a few reasons for starting an EA project.</span></div><div class="MsoNormal"></div><ol><li>Rationalize / consolidate a large number of IT assets (data, application and infrastructure) that seem to have outgrown reasonable manageability (Reduce the complexity of IT Systems)</li>
<li>Create a road-map on how IT will meet the business strategy in the years to come. ( Through performing a gap analysis after understanding the current and the target architectures)</li>
<li>To enable an enterprise to be "agile". </li>
<ul><li>For the IT systems to be able to meet the changing business demands in very short cycles</li>
</ul><li>To enable an impact on the various layers of the organization (Business process, applications, infrastructure) due to a change in the Business Strategy or vision. Note: this is not easy for a large enterprise</li>
<li>To bring about Process Optimization which could lead to lot of IT-related optimizations</li>
<li>To bring about standardization across the organizations various sub-organizations</li>
<li>To ensure the enterprise is compliant to regulatory requirements in a standard way across the organization</li>
</ol><div class="blogger-post-footer"><script type="text/javascript"><!--
amazon_ad_tag = "saigstec-20"; amazon_ad_width = "728"; amazon_ad_height = "90";//--></script>
<script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script></div>Saihttp://www.blogger.com/profile/12784084112335938233noreply@blogger.com0tag:blogger.com,1999:blog-4499269052751962200.post-37799471067383867632010-07-26T16:00:00.000+05:302010-07-26T16:01:04.199+05:30Multi-Tenant Architecture - First thoughts...<strong>A Multi-Tenant Architecture:</strong><br />
<br />
<br />
<div></div>Definition: A single instance of the application being able to serve various companies or tenants at once, providing the customized end-user experience, without having to write custom code for each tenant is said to be a multi-tenant architecture.<br />
<br />
<div></div><strong>Benefits & Attributes:</strong><br />
<ol><li>Highly Scalable</li>
<li>Configurable</li>
<li>Cost-effective or high ROI</li>
<li>Multi-tenant efficient </li>
</ol><strong>The Challenges:</strong><br />
<br />
<div></div><ol><li>To be able to configure the application for a new tenant without incurring extra operational costs or development costs for each new set up</li>
<li>Customization of the application can be in any of the following:</li>
</ol><ul><li>User Interface – Native language, time zone, keyboard input styles, UI validation rules, Truncation of strings</li>
<li>Storage of data in various languages – support Unicode character sets through all the layers of the application till data persistence</li>
<li>Business rules and workflow patterns</li>
<li>Authorization and security policies with compliance needs</li>
<li>Extensions to data models based on custom requirements of tenants</li>
</ul>3. Providing data isolation and security between the tenants’ data<br />
<br />
<div></div><br />
<div> <strong>Solution:</strong></div><br />
<div></div><br />
<div> <strong>“It has to be a highly METADATA driven architecture”</strong></div><br />
<div></div>The solution has to consider the following aspects while being designed:<br />
<br />
<div></div>1. Data Management<br />
<ul><li>a. Partitioning</li>
<li>b. Availability </li>
</ul>2. Tenant Management<br />
<ul><li>a. Data Model</li>
<li>b. Subscription Management</li>
<li>c. Identity Management</li>
<li>d. Delegated administration</li>
<li>e. Identity Federation</li>
</ul>3. Tenant Customization<br />
<ul><li>a. Meta data services</li>
<li>b. Extending application data model</li>
<li>c. UI customization</li>
<li>d. Business process customization</li>
</ul>4. Application and Data Security<br />
<ul><li>a. Common authentication schemes</li>
<li>b. Single sign-on</li>
<li>c. Securing data transfer</li>
<li>d. Authorizations</li>
<li>e. Data isolation schemes</li>
</ul>5. Instrumentation & Monitoring<br />
<ul><li>a. Health</li>
<li>b. Availability</li>
<li>c. Business performance</li>
</ul>6. Metering<br />
<ul><li>a. Usage Models</li>
<li>b. Data model for metering</li>
<li>c. Usage tracking architectur</li>
</ul>7. Configuration Management<br />
8. Infrastructure Security<br />
<ul><li>a. Provisioning (Infrastructure, Application, Tenants)</li>
<li>b. Disaster Recovery</li>
<li>c. Billing</li>
<li>d. Network operations</li>
</ul>9. Programmable software Services<br />
<ul><li>a. Software service lifecycle</li>
<li>b. Service versioning</li>
<li>c. Service certification, registration & publication</li>
</ul><div class="blogger-post-footer"><script type="text/javascript"><!--
amazon_ad_tag = "saigstec-20"; amazon_ad_width = "728"; amazon_ad_height = "90";//--></script>
<script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script></div>Saihttp://www.blogger.com/profile/12784084112335938233noreply@blogger.com0tag:blogger.com,1999:blog-4499269052751962200.post-51665526166483099652010-06-03T16:55:00.000+05:302010-06-03T16:55:30.387+05:30Blogger Comment NotificationHi,<br />
Here was a small tip for which I browsed a lot but could not find help. So, finally when i discovered this tiny titbit, felt like sharing. <br />
If you want to change the email address to which comments on your blog are to be notified ( assuming you are using blogspot), then, go to dashboard, settings, comments tab and towards the end you have a place to tell which email id should receive your comments. Type it in there or change it there and you are done.<br />
<br />
This may be trivial but of some help :)<div class="blogger-post-footer"><script type="text/javascript"><!--
amazon_ad_tag = "saigstec-20"; amazon_ad_width = "728"; amazon_ad_height = "90";//--></script>
<script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script></div>Saihttp://www.blogger.com/profile/12784084112335938233noreply@blogger.com0tag:blogger.com,1999:blog-4499269052751962200.post-58368316872289821792010-04-14T12:44:00.000+05:302010-04-14T12:44:07.608+05:30JSF, JBoss Seam and EJB3I just happened to explore this combination of technologies recently as it was required for a project. The first impression is that it is a providing a very impressive standards-based alternative to other frameworks which have become the de-facto standard in the Java World – Hibernate and spring. <br />
<br />
The learnings of the community from various previous not-so-successful frameworks and some good frameworks which have been adopted by many have all been put together. <br />
<br />
Also, there has been some out-of-the-box thinking w.r.t the way the layering has been handled. Standard JEE applications have been used to writing a lot of “glue” code for communication across the layers – presentation, business & data apart from others like integration etc. Some of the JEE patterns have been subtly built-in while some of them become redundant in this context – like a DAO or DTO or Business Delegate.<br />
<br />
To put it crisply, here are the advantages of this combination of technologies and frameworks:<br />
<br />
1. Provides a unified component model centered around EJB3<br />
<br />
2. No tedious glue code to copy data back and forth between the layers<br />
<br />
3. Supports dependency bijection – this is one of the main points that help us do away with glue code<br />
<br />
4. Annotation driven data binding<br />
<br />
5. Seam support JSF in such a seamless way that we do not have to have an extra layer of backing beans / managed beans – session beans itself can play the same role<br />
<br />
6. Seam integrates hibernate validators even if we do not use Hibernate at the persistence layer. This allows for annotation-based integrated validation of data across the layers. Infact, this can do the front-end validation directly by annotating at the entity bean<br />
<br />
7. Supports JPA lazy loading in JSF (open session in view) by default<br />
<br />
8. Supports the use of JSF EL within EJB-QL. This makes it very clean and convenient <br />
<br />
9. Seam support a lot many scopes as against the standard session scope. To name a few, it has – event, page, conversation, session, application, business process. This expands the horizon of how to manage state within an application and yet not have too many memory issues<br />
<br />
10. Using Facelets as the View technology instead of JSP is the best thing that has happened. There have been many problems using JSP with JSF. Please read this article on <a href="http://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html">Improving JSF by dumping JSP</a><br />
<br />
11. Facelets provide templating, re-use and ease of development which have been some concerns with JSF.<div class="blogger-post-footer"><script type="text/javascript"><!--
amazon_ad_tag = "saigstec-20"; amazon_ad_width = "728"; amazon_ad_height = "90";//--></script>
<script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script></div>Saihttp://www.blogger.com/profile/12784084112335938233noreply@blogger.com0