<?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>eXpand yOur cReativity &#187; soap</title>
	<atom:link href="http://blog.bhushangahire.net/tag/soap/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bhushangahire.net</link>
	<description></description>
	<lastBuildDate>Thu, 05 Jan 2012 07:17:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Send SMS from Ruby On Rails application using web service, SOAP API</title>
		<link>http://blog.bhushangahire.net/2010/01/15/send-sms-from-ruby-on-rails-application-using-web-service-soap-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=send-sms-from-ruby-on-rails-application-using-web-service-soap-api</link>
		<comments>http://blog.bhushangahire.net/2010/01/15/send-sms-from-ruby-on-rails-application-using-web-service-soap-api/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 11:09:19 +0000</pubDate>
		<dc:creator>Bhushan G Ahire</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[mailserve]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[soap]]></category>

		<guid isPermaLink="false">http://blog.bhushangahire.net/2010/01/15/send-sms-from-ruby-on-rails-application-using-web-service-soap-api/</guid>
		<description><![CDATA[SOAP4R is a Ruby library for accessing Web Services via SOAP. Recently I had a chance to explore SOAP4R. Here&#8217;s how to get started with it. Installation Although Ruby 1.8.x comes with SOAP4R in its standard library, it is an old, buggy version. I highly recommend using the latest gem (1.5.8 as of the this [...]]]></description>
			<content:encoded><![CDATA[<p class="entry">SOAP4R is a Ruby library for accessing Web Services via SOAP. Recently I had a chance to explore SOAP4R. Here&#8217;s how to get started with it.</p>
<p class="entry"><span id="more-3"></span></p>
<h3 class="entry">Installation</h3>
<p class="entry">Although Ruby 1.8.x comes with SOAP4R in its standard library, it is an old, buggy version. I <strong>highly</strong> recommend using the latest gem (1.5.8 as of the this update). It has one dependency, httpclient.</p>
<p class="entry"><code>gem install soap4r --include-dependencies</code></p>
<h3 class="entry">Service</h3>
<p class="entry">There are many services available to send SMS but I prefer to use,</p>
<h4 class="entry">MailServe-SMS</h4>
<p class="entry"><a href="http://qlc.in/ms/overview.htm" target="_blank">MailServe-SMS</a>, text messaging service, is everything you need for fast, no-frills, no-fuss text messaging. A quick and easy way to send SMS.</p>
<p class="entry">Let’s explore these further.</p>
<h3 class="entry">Method 1: Read the WSDL at run-time</h3>
<p class="entry">&#160;</p>
<div class="entry">
<pre class="ruby"><span style="font-weight: bold; color: rgb(204,0,102)">require</span> <span style="color: rgb(153,102,0)">&quot;soap/wsdlDriver&quot;</span>
wsdl = <span style="color: rgb(153,102,0)">&quot;http://sms.qlc.co.in/smsapi.wsdl&quot;</span>
driver = <span style="font-weight: bold; color: rgb(102,102,255)">SOAP::WSDLDriverFactory</span>.<span style="color: rgb(153,0,204)">new</span><span style="font-weight: bold; color: rgb(0,102,0)">(</span>wsdl<span style="font-weight: bold; color: rgb(0,102,0)">)</span>.<span style="color: rgb(153,0,204)">create_rpc_drive</span></pre>
</div>
<p class="entry">&#160;</p>
<p class="entry">A single call to a driver factory reads the WSDL file, and creates a driver class for you to use, complete with the methods defined by the service. What if your service requires authentication? The driver inherits methods from httpclient, so you can specify its options as you would for httpclient:</p>
<p class="entry">Once driver is get initialised you need to call SMS sending API i.e. <b>SendSMSRequest</b>.</p>
<div class="entry">
<pre class="ruby">driver.<span style="color: rgb(153,0,204)">SendSMSRequest</span><span style="font-weight: bold; color: rgb(0,102,0)">(</span><span style="color: rgb(153,102,0)">&quot;username&quot;, <span style="color: rgb(153,102,0)">&quot;password&quot;</span>, <span style="color: rgb(153,102,0)">&quot;sender_no&quot;</span>, <span style="color: rgb(153,102,0)">&quot;from_no&quot;</span>, <span style="color: rgb(153,102,0)">&quot;message&quot;</span></span><span style="font-weight: bold; color: rgb(0,102,0)">)</span></pre>
</div>
<p class="entry">&#160;</p>
<p class="entry">Once This will return you response <strong>200 SMS sent successfully </strong>on success else if the information submitted was wrong then <strong>500 Information submitted was incomplete</strong>.</p>
<p class="entry">&#160;</p>
<h3 class="entry">Method 2: Generate classes from WSDL</h3>
<p class="entry">SOAP4R installs a command-line utility called &#8216;wsdl2ruby&#8217; which can generate a client or server.</p>
<p class="entry"><strong>Coming soon…..</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2010/01/15/send-sms-from-ruby-on-rails-application-using-web-service-soap-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

