<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Niels Dev</title>
	<atom:link href="http://nsharp.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nsharp.wordpress.com</link>
	<description>"There are only 10 types of people in the world: Those who understand binary, and those who don't"</description>
	<lastBuildDate>Thu, 28 Oct 2010 21:05:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='nsharp.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Niels Dev</title>
		<link>http://nsharp.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nsharp.wordpress.com/osd.xml" title="Niels Dev" />
	<atom:link rel='hub' href='http://nsharp.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Presentatie 29/10</title>
		<link>http://nsharp.wordpress.com/2010/10/28/presentatie-2910/</link>
		<comments>http://nsharp.wordpress.com/2010/10/28/presentatie-2910/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 21:05:17 +0000</pubDate>
		<dc:creator>nielsschroyen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nsharp.wordpress.com/?p=21</guid>
		<description><![CDATA[Presentatie kan je vinden op http://hoogmaatheide.nl/Niels/kolybri.pdf Demo wordt live in de les gegeven<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nsharp.wordpress.com&amp;blog=6519225&amp;post=21&amp;subd=nsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Presentatie kan je vinden op http://hoogmaatheide.nl/Niels/kolybri.pdf<br />
Demo wordt live in de les gegeven</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nsharp.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nsharp.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nsharp.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nsharp.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nsharp.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nsharp.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nsharp.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nsharp.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nsharp.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nsharp.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nsharp.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nsharp.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nsharp.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nsharp.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nsharp.wordpress.com&amp;blog=6519225&amp;post=21&amp;subd=nsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nsharp.wordpress.com/2010/10/28/presentatie-2910/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5717564813b18f6a2e55dd84659e8dfb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nielsschroyen</media:title>
		</media:content>
	</item>
		<item>
		<title>Juggling with nuSoap php array&#8217;s</title>
		<link>http://nsharp.wordpress.com/2009/02/09/juggling-with-nusoup-php-arrays/</link>
		<comments>http://nsharp.wordpress.com/2009/02/09/juggling-with-nusoup-php-arrays/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 21:25:15 +0000</pubDate>
		<dc:creator>nielsschroyen</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[webservices]]></category>

		<guid isPermaLink="false">http://nsharp.wordpress.com/?p=3</guid>
		<description><![CDATA[Juggling with nuSoup php array's gives a little tutorial of how to use array's with nuSoap. <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nsharp.wordpress.com&amp;blog=6519225&amp;post=3&amp;subd=nsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Intro:</h2>
<p>Started last week with nuSoap php webservices and I must say that the oppertunities of this little library are unlimited.</p>
<p>Me for instance use online mysql-databases for certain projects and would like to build neat little offline applications to manipulate and use those databases, so one word: webservices.</p>
<p>For people with limited resources, nuSoap is a great easy to use library for webservices.</p>
<p>Most usefull info that I found:</p>
<ul>
<li><a href="http://www.wackylabs.net/2004/07/creating-a-web-service-and-wsdl-using-nusoap/">http://www.wackylabs.net/2004/07/creating-a-web-service-and-wsdl-using-nusoap/</a></li>
<li><a href="http://www.scottnichol.com/nusoapprogwsdl.htm">http://www.scottnichol.com/nusoapprogwsdl.htm</a></li>
<li><a href="http://www.ferdychristant.com/blog/articles/DOMM-6J2QFF">http://www.ferdychristant.com/blog/articles/DOMM-6J2QFF</a></li>
</ul>
<h2>Tutorial:</h2>
<p>This tutorial gives a small explanation of how to use array&#8217;s with nuSoap. The webservice asks for a name and returns an array that says &#8220;hello &#8216;name&#8217;&#8221;.</p>
<h2>First: Install the library&#8217;s on the server.</h2>
<p>You can download the library&#8217;s at <a href="http://sourceforge.net/projects/nusoap/">SourceForge</a>.</p>
<p>The location on the server is not of relevance (I put mine on http://www.example.com/soap/lib/)</p>
<h2>Second: Create the serverobject that makes the service</h2>
<p>For example http://www.example.com/soap/hello/server.php</p>
<p><em><span style="color:#808080;">&lt;?php<br />
<strong>// load SOAP library<br />
</strong>require_once(&#8220;../lib/nusoap.php&#8221;);</span></em></p>
<p><em><span style="color:#808080;"><strong>// load library that holds implementations of functions we&#8217;re making available to the web service<br />
</strong>require_once(&#8220;functions.php&#8221;);</span></em></p>
<p><em><span style="color:#808080;"><strong>// set namespace<br />
</strong>$ns=&#8221;</span></em><em><span style="color:#808080;">http://localhost/</span></em><em><span style="color:#808080;">&#8220;;</span></em></p>
<p><em><span style="color:#808080;"><strong>// create SOAP server object</strong><br />
$server = new soap_server();</span></em></p>
<p><em><span style="color:#808080;"><strong>// setup WSDL file, a WSDL file can contain multiple services<br />
</strong>$server-&gt;configureWSDL(&#8216;HelloWorld&#8217;,$ns);<br />
$server-&gt;wsdl-&gt;schemaTargetNamespace=$ns;</span></em></p>
<p><em><span style="color:#808080;"><strong>//Add complex type</strong><br />
$server-&gt;wsdl-&gt;addComplexType(<br />
  &#8216;myarray&#8217;,                                         //Complextype Name<br />
  &#8216;complexType&#8217;,                              //Complextype type<br />
  &#8216;array&#8217;,                                              //Php type<br />
  &#8221;,                                                         //compositor (all|sequence|choice)<br />
  &#8216;SOAP-ENC:Array&#8217;,                       //restrictionBase namespace:name (</span></em><em><span style="color:#808080;">http://schemas.xmlsoap.org/soap/encoding/:Array</span></em><em><span style="color:#808080;">)<br />
  array(),                                                 //elements = array ( name = array(name=&gt;”,type=&gt;”) )<br />
  array(                                               // attributes<br />
    array(&#8216;ref&#8217; =&gt; &#8216;SOAP-ENC:arrayType&#8217;,<br />
         &#8216;wsdl:arrayType&#8217; =&gt; &#8216;xsd:string[]&#8216;)<br />
  ),<br />
  &#8216;xsd:string&#8217;         //arrayType<br />
);</span></em></p>
<p><em><span style="color:#808080;"><strong>// register a web service method</strong><br />
$server-&gt;register(&#8216;ws_hello&#8217;,<br />
 array(&#8216;input&#8217; =&gt; &#8216;xsd:string&#8217;),                       // input parameters<br />
 array(&#8216;return&#8217; =&gt; &#8216;tns:myarray&#8217;),              // output parameter<br />
 &#8217;HelloWorld&#8217;,                                                                         // namespace<br />
    &#8220;HelloWorld#ws_hello&#8221;,                                            // soapaction<br />
    &#8216;rpc&#8217;,                                                                     // style<br />
    &#8216;encoded&#8217;,                                                          // use<br />
    &#8216;Say hello&#8217;                                                          // documentation<br />
 );</span></em></p>
<p><em><span style="color:#808080;"><strong>//webservice method</strong><br />
function ws_hello($name, $bla){</span></em></p>
<p><em><span style="color:#808080;">return new soapval(&#8216;return&#8217;,'tns:myarray&#8217;,sayhello($name)); //Using the functions.php file for clarity reasons<br />
}</span></em></p>
<p><em><span style="color:#808080;"><strong>// service the methods</strong><br />
$server-&gt;service($HTTP_RAW_POST_DATA);<br />
?&gt;</span></em></p>
<p>As you may notice, the server creates a new service: &#8216;HelloWorld&#8217;<br />
The service has 1 complexType: MyArray and 1 operation: ws_hello.<br />
The operation asks for a string and gives the complex type back.</p>
<p>You can examine the service at http://www.example.com/soap/hello/server.php<br />
And the wsdl at http://www.example.com/soap/hello/server.php?wsdl</p>
<p>I also seperated my function logic from my service by using a second file functions.</p>
<h2>Third: Create the file functions</h2>
<p>For example http://www.example.com/soap/hello/functions.php</p>
<p><em><span style="color:#808080;">&lt;?php<br />
<strong>// implementation of  hello function</strong><br />
function sayhello($name) {<br />
 return array(&#8220;Hello&#8221;, &#8221; &#8220;, $name);<br />
}<br />
?&gt;</span></em></p>
<p>The function returns an array with 3 strings.</p>
<h2>Last: Client implementation</h2>
<p>For example http:://www.example.com/soap/hello/Client.php</p>
<p><span style="color:#808080;"><em>&lt;?php<br />
<strong>//Call library&#8217;s</strong><br />
require_once(&#8216;../lib/nusoap.php&#8217;);</em></span></p>
<p><span style="color:#808080;"><em><strong>//Set wsdl</strong><br />
$wsdl=&#8221;</em></span><span style="color:#808080;"><em>http://www.example.com/soap/hello/server.php?wsdl</em></span><span style="color:#808080;"><em>&#8220;;</em></span></p>
<p><span style="color:#808080;"><em><strong>//Set client</strong><br />
$client=new soapclient($wsdl, &#8216;wsdl&#8217;);</em></span></p>
<p><span style="color:#808080;"><em><strong>//create input array</strong><br />
$input=array(&#8216;input&#8217;=&gt;&#8217;Niels&#8217;);</em></span></p>
<p><span style="color:#808080;"><em><strong>//call webservice</strong><br />
$result = $client-&gt;call(&#8216;ws_hello&#8217;,$input);</em></span></p>
<p><span style="color:#808080;"><em><strong>//Walk through array</strong><br />
foreach ($result as $value) {<br />
   echo $value;<br />
}<br />
?&gt;</em></span></p>
<p>The client creates a new soapclient and calls the method through the new soapclient. the call gives back the new made array and prints it on the screen.</p>
<p>As you can see, it&#8217;s very easy to create a webservice that uses an array, maybe later i&#8217;m gonna make an example using structs in my array&#8217;s.</p>
<p>Because everything works with wsdl you can easily create a java or .net client.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nsharp.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nsharp.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nsharp.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nsharp.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nsharp.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nsharp.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nsharp.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nsharp.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nsharp.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nsharp.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nsharp.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nsharp.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nsharp.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nsharp.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nsharp.wordpress.com&amp;blog=6519225&amp;post=3&amp;subd=nsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nsharp.wordpress.com/2009/02/09/juggling-with-nusoup-php-arrays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5717564813b18f6a2e55dd84659e8dfb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nielsschroyen</media:title>
		</media:content>
	</item>
	</channel>
</rss>
