<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>indiWiz.com &#187; webservice</title>
	<atom:link href="http://indiwiz.com/tag/webservice/feed/" rel="self" type="application/rss+xml" />
	<link>http://indiwiz.com</link>
	<description>Subhash&#039;s Tech Log</description>
	<lastBuildDate>Sun, 29 Apr 2012 15:11:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Accessing RESTful WebServices with Prototype.js</title>
		<link>http://indiwiz.com/2009/07/22/accessing-restful-webservices-with-prototype-js/</link>
		<comments>http://indiwiz.com/2009/07/22/accessing-restful-webservices-with-prototype-js/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 07:30:14 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[webservice]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=396</guid>
		<description><![CDATA[We can make Ajax requests using Prototype.js (version 1.6.0.3) thus: While working on this code, we found out that the method parameter accepted only GET or POST requests. When we give any other request type like DELETE or PUT, the Prototype.js library converted the request to POST. Arun Jeganath found this post where the same [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>We can make Ajax requests using <a href="http://www.prototypejs.org/">Prototype.js</a> (version 1.6.0.3) thus:</p>
<pre class="brush: jscript; title: ; notranslate">
var url = ...;
new Ajax.Request(
            url,
            {
               method:'DELETE',
               onComplete:function doMessage(response){
                   alert(response.status);
               }
            });
</pre>
<p>While working on this code, we found out that the <tt>method</tt> parameter accepted only GET or POST requests. When we give any other request type like DELETE or PUT, the Prototype.js library converted the request to POST.</p>
<p><a href="http://www.linkedin.com/in/arunjeganath">Arun Jeganath</a> found <a href="https://prototype.lighthouseapp.com/projects/8886/tickets/289-allow-put-delete-and-other-http-methods-on-ajax-requests">this post</a> where the same issue is discussed. The problem was solved when we commented these lines from the Prototype.js code:</p>
<pre>
      if (!['get', 'post'].include(this.method)) {
        //simulate other verbs over post
        params['_method'] = this.method;
        this.method = 'post';
      }
</pre>
<div class="shr-publisher-396"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/07/22/accessing-restful-webservices-with-prototype-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebService Client in JAX-WS (Java 6 and above)</title>
		<link>http://indiwiz.com/2008/12/30/webservice-client-in-jax-ws-java-6-and-above/</link>
		<comments>http://indiwiz.com/2008/12/30/webservice-client-in-jax-ws-java-6-and-above/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 12:40:50 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[jax-ws]]></category>
		<category><![CDATA[webservice]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=114</guid>
		<description><![CDATA[Given a WSDL URL, you may generate the Java client classes using the JDK provided tool wsimport. The basic usage: $ wsimport &#60;wsdl_url&#62; The common command-line parameters supported by this tool: -p specifies the target package -d folder where generated class files are placed]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Given a WSDL URL, you may generate the Java client classes using the JDK provided tool <tt>wsimport</tt>. The basic usage:</p>
<pre>
$ wsimport &lt;wsdl_url&gt;
</pre>
<p>The common command-line parameters supported by this tool:</p>
<table border="0" cellpadding="10" cellspacing="5">
<tr>
<td><tt>-p</tt></td>
<td>specifies the target package</td>
</tr>
<tr>
<td><tt>-d</tt></td>
<td>folder where generated class files are placed</td>
</tr>
</table>
<div class="shr-publisher-114"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2008/12/30/webservice-client-in-jax-ws-java-6-and-above/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MetaWeblog API in Java</title>
		<link>http://indiwiz.com/2008/11/20/metaweblog-api-in-java/</link>
		<comments>http://indiwiz.com/2008/11/20/metaweblog-api-in-java/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 16:43:18 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[webservice]]></category>
		<category><![CDATA[xml-rpc]]></category>

		<guid isPermaLink="false">http://indiwiz.wordpress.com/?p=28</guid>
		<description><![CDATA[Recently we were assigned with the task of writing code to remotely insert an entry to a blog. And we had to select the Blogging software. So we started with the search for a blogging software which exposed its API. To our amazement, we found XML-RPC ruling the blogging API world. And one software independent [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Recently we were assigned with the task of writing code to remotely insert an entry to a blog. And we had to select the Blogging software. So we started with the search for a blogging software which exposed its API. To our amazement, we found XML-RPC ruling the blogging API world. And one software independent standard for it is the <a href="http://www.xmlrpc.com/metaWeblogApi">MetaWeblog API</a>.</p>
<p>After selecting the API, we had to find a software supporting this API. This assignment was for a demo we were to show. So we wanted a minimal blogging software with no configuration. We found <a href="http://pebble.sourceforge.net/">Pebble</a> (we used version 2.3.1). This software is cool. Installation is breeze, just put the WAR file in an application server, and you are ready to use it!</p>
<p>Now came the implementation part. I assumed the existence of a Java library implementing this MetaWeblog API. But did not find any. So the next obvious step: use some XML-RPC library in Java to implement the call. I had some bad opinion about <a href="http://ws.apache.org/xmlrpc/">Apache&#8217;s XML-RPC library</a>. I had used it long back ago, and I hated the way it was implemented. Since then I have been using Python to access XML-RPC services. But, this time, the job required use of Java.</p>
<p>So we ventured to the next step: finding an alternative OpenSource Java XML-RPC library. We found <a href="http://rox-xmlrpc.sourceforge.net/">RoX</a>. We were happy because RoX was born out of frustration of using Apache&#8217;s XML-RPC engine. We implemented it. And RoX did not work for Pebble (still not able to figure out if it was a mistake on our part, or RoX really did have a bug). So switched to Apache (version 3.1.1). The 3.x API seems to have been simplified. So finally we wrote:</p>
<pre class="brush: java; title: ; notranslate">
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

...

XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(new URL(&quot;http://localhost:8080/pebble/xmlrpc/&quot;));
XmlRpcClient client = new XmlRpcClient();
client.setConfig(config);

// Params needed: blogid, username, password, struct, publish
// First create the fourth parameter, struct:
Map&lt;string, String&gt; m = new HashMap&lt;string, String&gt;();
m.put(&quot;title&quot;, &quot;Hello World &quot; + Calendar.getInstance().toString());
m.put(&quot;link&quot;, &quot;http://www.indiwiz.com/&quot;);
m.put(&quot;description&quot;, &quot;This is the content of the post!&quot;);

Object[] params = new Object[]{&quot;default&quot;, &quot;username&quot;, &quot;password&quot;, m, true};

String ret = (String) client.execute(&quot;metaWeblog.newPost&quot;, params);
System.out.println(ret);
</pre>
<p>And then we delivered our demo!</p>
<div class="shr-publisher-28"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2008/11/20/metaweblog-api-in-java/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick WebService Client in Groovy</title>
		<link>http://indiwiz.com/2008/11/18/quick-webservice-client-in-groovy/</link>
		<comments>http://indiwiz.com/2008/11/18/quick-webservice-client-in-groovy/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 09:50:57 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[webservice]]></category>

		<guid isPermaLink="false">http://indiwiz.wordpress.com/?p=17</guid>
		<description><![CDATA[Writing WebService client in Groovy is simple. sayHello() is the operation name. More details here. See the Installation part, you need to put the Groovy SOAP Jar in ${user.home}/.groovy/lib.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Writing WebService client in Groovy is simple.</p>
<pre class="brush: python; title: ; notranslate">
import groovy.net.soap.SoapClient

def proxy = new SoapClient(&quot;http://localhost:7777/path/to/endpoint?WSDL&quot;)
def result = proxy.sayHello(&quot;Subhash&quot;)

println result
</pre>
<p><tt>sayHello()</tt> is the operation name.</p>
<p>More details <a href="http://docs.codehaus.org/display/GROOVY/Groovy+SOAP">here</a>. See the Installation part, you need to put the Groovy SOAP Jar in <tt>${user.home}/.groovy/lib</tt>.</p>
<div class="shr-publisher-17"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2008/11/18/quick-webservice-client-in-groovy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick WebService in Java 6</title>
		<link>http://indiwiz.com/2008/11/18/quick-webservice-in-java-6/</link>
		<comments>http://indiwiz.com/2008/11/18/quick-webservice-in-java-6/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 09:16:13 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[jax-ws]]></category>
		<category><![CDATA[webservice]]></category>

		<guid isPermaLink="false">http://indiwiz.wordpress.com/?p=15</guid>
		<description><![CDATA[To write a quick JAX-WS webservice in Java 6: To compile and run: $ apt -d bin/ MyWebService.java $ java -cp bin test.MyWebService]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>To write a quick JAX-WS webservice in Java 6:</p>
<pre class="brush: java; title: ; notranslate">
package test;

import javax.xml.ws.Endpoint;

@javax.jws.WebService
public class MyWebService{

  @javax.jws.WebMethod
  public String getQuote(String name){
    return &quot;1234.56&quot;;
  }

  public static void main(String[] arg){
    Endpoint end = Endpoint.create(new MyWebService());
    end.publish(&quot;http://localhost:1000/MyWebService&quot;);
  }
}
</pre>
<p>To compile and run:</p>
<pre>
$ apt -d bin/ MyWebService.java
$ java -cp bin test.MyWebService
</pre>
<div class="shr-publisher-15"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2008/11/18/quick-webservice-in-java-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

