<?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>TommyBlue.it &#187; SOAP</title>
	<atom:link href="http://www.tommyblue.it/tag/soap/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tommyblue.it</link>
	<description>Bombardare per la pace è un po' come trombare per la verginità...</description>
	<lastBuildDate>Tue, 24 Jan 2012 09:34:19 +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>Interrogare un servizio SOAP con Ruby, Python e PHP</title>
		<link>http://www.tommyblue.it/2009/07/11/interrogare-un-servizio-soap-con-ruby-python-e-php/</link>
		<comments>http://www.tommyblue.it/2009/07/11/interrogare-un-servizio-soap-con-ruby-python-e-php/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 13:34:10 +0000</pubDate>
		<dc:creator>TommyBlue</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Informatica]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[SOAP]]></category>

		<guid isPermaLink="false">http://www.tommyblue.it/?p=539</guid>
		<description><![CDATA[Sempre in tema di SOAP, ho avuto la necessità di interrogare un server SOAP con Ruby,Python e PHP. In tutti e tre i casi la faccenda è stata piuttosto semplice, bastano 3/4 righe di codice. Vi propongo questo breve paragone. RUBY require 'soap/wsdlDriver' @SOAPUrl = "http://HOST_URL/ws/ws208913.asmx?WSDL" @service = SOAP::WSDLDriverFactory.new(@SOAPUrl).create_rpc_driver @service.function2call(param1, param2) PYTHON from SOAPpy import [...]]]></description>
			<content:encoded><![CDATA[<p>Sempre<a href="http://www.tommyblue.it/2009/06/15/interrogare-un-servizio-soap-con-ruby/"> in tema di SOAP</a>, ho avuto la necessità di interrogare un server SOAP con Ruby,Python e PHP. In tutti e tre i casi la faccenda è stata piuttosto semplice, bastano 3/4 righe di codice. Vi propongo questo breve paragone.</p>
<h3>RUBY</h3>
<pre>require 'soap/wsdlDriver'
@SOAPUrl = "http://HOST_URL/ws/ws208913.asmx?WSDL"
@service = SOAP::WSDLDriverFactory.new(@SOAPUrl).create_rpc_driver
@service.function2call(param1, param2)</pre>
<h3>PYTHON</h3>
<pre>from SOAPpy import WSDL
server =  WSDL.Proxy('http://myurl/ws.asmx?WSDL')
result  = server.function2call(param1, param2)</pre>
<h3>PHP</h3>
<pre>$url = "http://myurl/ws.asmx?WSDL";
$client  = new SoapClient($url);
$client-&gt;function2call($param1, $param2);</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tommyblue.it/2009/07/11/interrogare-un-servizio-soap-con-ruby-python-e-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Interrogare un servizio SOAP con Ruby</title>
		<link>http://www.tommyblue.it/2009/06/15/interrogare-un-servizio-soap-con-ruby/</link>
		<comments>http://www.tommyblue.it/2009/06/15/interrogare-un-servizio-soap-con-ruby/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 22:49:03 +0000</pubDate>
		<dc:creator>TommyBlue</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Informatica]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[SOAP]]></category>

		<guid isPermaLink="false">http://www.tommyblue.it/?p=518</guid>
		<description><![CDATA[Come spesso accade Windows &#38; Co. fanno le cose a modo loro. È il caso del web service SOAP (quando REST funziona bene e anche meglio) che, causa lavoro, ho dovuto interrogare. Per farlo ho utilizzato Ruby con l&#8217;aiuto della libreria soap/wsdlDriver. Qui di seguito un codice di esempio per connettersi al web service e [...]]]></description>
			<content:encoded><![CDATA[<p>Come spesso accade Windows &amp; Co. fanno le cose a modo loro. È il caso del web service <strong>SOAP</strong> (quando <strong>REST</strong> funziona bene e anche meglio) che, causa lavoro, ho dovuto interrogare. Per farlo ho utilizzato <strong>Ruby</strong> con l&#8217;aiuto della libreria <strong>soap/wsdlDriver</strong>.</p>
<p>Qui di seguito un codice di esempio per connettersi al web service e gestire la risposta alla chiamata a <em>getCourses208913</em></p>
<p><a href="http://blog.kreations.it/wp-content/uploads/2009/06/SOAP-wsdlDriver.rb">Scarica il file SOAP-wsdlDriver.rb</a></p>
<pre>#
# SOAP service query example
#
# Usage:
#
# course = CourseManagement.new
# course.getCourses
#
# Author::    Tommaso Visconti  (mailto:tommaso.visconti@kreations.it)
# Copyright:: Copyright (c) 2009 Kreations Agency
# License::   General Public License v.2

require 'soap/wsdlDriver'

class CourseManagement

  # Initialize the SOAP service
	def initialize
		@SOAPUrl = "http://HOST_URL/ws/ws208913.asmx?WSDL"
		@service=SOAP::WSDLDriverFactory.new(@SOAPUrl).create_rpc_driver
		@service.generate_explicit_type = true
		@service.wiredump_dev = STDOUT if $DEBUG
	end

	# Get the possible callbacks
	def getMethods
	 @service.methods.sort
	end

	#
	# Get the courses
	#
	# The first call use :IDParent =&gt; 0 which indicates the root of the tree
	#
	def getCourses
		result = @service.getCourses208913(:IDParent =&gt; 0)

		if result.getCourses208913Result.to_a.size &gt; 0
			puts "# Code =&gt; " + result.getCourses208913Result.codeDescription.code
			puts "# Description =&gt; " + result.getCourses208913Result.codeDescription.description
			puts

			self.getCourse(result.getCourses208913Result.codeDescription.code, 1)
		end
	end

	def getCourse(idParent, count)
		result = @service.getCourses208913(:IDParent =&gt; idParent)

		if result.getCourses208913Result.to_a.size &gt; 0

			result.getCourses208913Result.codeDescription.each do |course|
				puts " "*count*2 + "# Code =&gt; " + course.code
				puts " "*count*2 + "# Description =&gt; " + course.description
				puts

				# Recoursive call
				self.getCourse(course.code, count+1) if result.getCourses208913Result.to_a.size &gt; 1
			end
		end
	end
end</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tommyblue.it/2009/06/15/interrogare-un-servizio-soap-con-ruby/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

