<?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>Just Another Dang Blog &#187; PHP</title>
	<atom:link href="http://blog.lopau.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.lopau.com</link>
	<description>A tech blog about web development, graphic designs, freelancing, cloud computing, mobile development, innovations and seo.</description>
	<lastBuildDate>Thu, 06 Oct 2011 03:01: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>Create a Web Service using SOAP</title>
		<link>http://blog.lopau.com/create-a-web-service-using-soap/</link>
		<comments>http://blog.lopau.com/create-a-web-service-using-soap/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 14:49:58 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SalesForce]]></category>
		<category><![CDATA[Web Resources]]></category>
		<category><![CDATA[force.com]]></category>
		<category><![CDATA[soap]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=1502</guid>
		<description><![CDATA[This week one of the requirements for our client was to have a force.com application communicate with an external web service running on PHP to generate a barcode sequence. I&#8217;ll teach how I was able to setup the web service using NuSOAP and a document/literal as rcp/encoded is not supported by force.com. My goal was [...]]]></description>
			<content:encoded><![CDATA[<p>This week one of the requirements for our client was to have a force.com application communicate with an external web service running on PHP to generate a barcode sequence. I&#8217;ll teach how I was able to setup the web service using NuSOAP and a document/literal as rcp/encoded is not supported by force.com. My goal was to make the task easier on php side so from force.com it would make a request by passing a string delimited by an asterisk and pipe. We process the string and return it back as url for the barcode image. I wont be covering barcode creation though in this tutorial but only the web service and sample client.<br />
<span id="more-1502"></span></p>
<p>
<!-- Begin Google Adsense code -->
<div class="googleads">
<script type="text/javascript"><!--
google_ad_client = "pub-4515932012590505";
/* 200x200, created 10/29/08 */
google_ad_slot = "3929428513";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<!-- End Google Adsense code -->
<br />
e.g. Name*2|Mr.*3</p>
<p>The web service will parse the string convert it to an array. You can ofcourse pass any other type of string with a delimiter. </p>
<p>Here is how the server is.</p>
<div class="codesnip-container" >// Pull in the NuSOAP code<br />
require_once(&#8216;lib/nusoap.php&#8217;);<br />
// Create the server instance<br />
$server = new soap_server();<br />
$server->configureWSDL( &#8216;servicename&#8217;, &#8216;urn:servicename&#8217;, &#8221;, &#8216;document&#8217;);<br />
myRegister($server,&#8217;DoSomething&#8217;,array(<br />
	&#8216;in&#8217; => array(<br />
		&#8216;sf-parameters&#8217; =>  &#8216;xsd:string&#8217;),<br />
	&#8216;out&#8217; => array(&#8216;Pass&#8217; => &#8216;xsd:string&#8217;)<br />
));<br />
//if in safe mode, raw post data not set:<br />
if (!isset($HTTP_RAW_POST_DATA)) $HTTP_RAW_POST_DATA = implode(&#8220;\r\n&#8221;, file(&#8216;php://input&#8217;));<br />
$server->service( $HTTP_RAW_POST_DATA);<br />
function myRegister( &#038;$server, $methodname, $params) {<br />
	$server->register($methodname, $params["in"], $params["out"],<br />
&#8216;urn:servicename&#8217;, // namespace<br />
	$server->wsdl->endpoint .&#8217;#&#8217;. $methodname, // soapaction<br />
&#8216;document&#8217;, // style<br />
&#8216;literal&#8217;, // use<br />
&#8216;Generate Barcode Sequence URL&#8217; // documentation<br />
	);<br />
}<br />
function DoSomething($params) {<br />
	$string = $params;<br />
	$list = explode(&#8220;|&#8221;, $string);<br />
	//make associative array<br />
	$result = array();<br />
	foreach($list as $key=>$values) {<br />
		$result[] = explode(&#8220;*&#8221;, $values);<br />
	}</p>
<p>	//creates the string<br />
	$bcStr = &#8220;&#8221;;<br />
	foreach($result as $values) {<br />
		$bcStr .= $values[0];<br />
		for ($i = 1; $i < = $values[1]; $i++) {<br />
			$bcStr .= "\t";<br />
		}<br />
	}</p>
<p>	return array('Pass'=> $bcStr);<br />
}</p></div>
<p>You are instantiating a class of the NuSOAP server and configuring it with WSDL. You also create two functions,, one handles the $server->register method which takes the argument incoming request and the outgoing response and the $server->wsdl with arguments defining the server as a document/literal. </p>
<p>Then for my task purpose the incoming delimited string is converted to an associative array and then converted back to string with the proper formatting I require ($bcStr), if you have barcode class you can pass that string and a barcode image should be generated from it. That however is not covered on this tutorial.</p>
<p>Next is simple php client to test the web service out.</p>
<div class="codesnip-container" ><?php<br />
// Pull in the NuSOAP code<br />
require_once('lib/nusoap.php');<br />
// Create the client instance<br />
$ns="urn:servicename";<br />
$client = new nusoap_client('http://localhost/soap_server/hellowsdl2.php?wsdl', true);<br />
if ( $client->getError() ) {<br />
	print &#8220;Soap Constructor Error:
<pre>".
	$client->getError()."</pre>
<p>&#8220;;<br />
}<br />
$params=array(&#8220;sf-parameters&#8221;=>&#8221;Name*2|Mr.*3&#8243;);<br />
$result = $client->call( &#8220;DoSomething&#8221;, array(&#8220;parameters&#8221;=>$params), $ns);<br />
if ($client->fault) {<br />
	//soap_fault<br />
	print &#8220;<br />
<h2>Soap Fault: </h2>
<pre>(". $client->fault->faultcode .")  ".
	$client->fault->faultstring. "</pre>
<p>&#8220;;<br />
}<br />
elseif ( $client->getError() ) {<br />
	print &#8220;<br />
<h2>Soap Error: </h2>
<pre>". $client->getError() ."</pre>
<p>&#8220;;<br />
}<br />
else {<br />
	print &#8220;<br />
<h2>Result: </h2>
<pre>". $result["Pass"] ."</pre>
<p>&#8220;;<br />
}<br />
print &#8216;<br />
<h2>Details:</h2>
<hr />&#8216;.<br />
&#8216;<br />
<h3>Request</h3>
<pre>' .
htmlspecialchars( $client->request, ENT_QUOTES) .'</pre>
<p>&#8216;.<br />
&#8216;<br />
<h3>Response</h3>
<pre>' .
htmlspecialchars( $client->response, ENT_QUOTES) .'</pre>
<p>&#8216;.<br />
&#8216;<br />
<h3>Debug</h3>
<pre>' .
htmlspecialchars( $client->debug_str, ENT_QUOTES) .'</pre>
<p>&#8216;;<br />
?></p></div>
<p>This time I instantiated a <strong>nusoap_client</strong> note that underscore _ as I got stuck on this earlier and got PHP complaining when it was just <strong>nusoapclient</strong>. Next I created the string params to be passed to the DoSomething method via $client->call.</p>
<p>Then from here we goback to our force.com app we make a soap request to the webservice and it returns with the response we need. On Force.com make sure you add your web service the Remote Site Settings under Setup > Administrative Setup > Security Controls. </p>
<p>Kudos for the resource and solution for task from the original author <a href="http://mleiv.com/php-nusoap-documentliteral-web/">mleiv blog&#8217;s.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/create-a-web-service-using-soap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Certified Developers</title>
		<link>http://blog.lopau.com/php-certified-developers/</link>
		<comments>http://blog.lopau.com/php-certified-developers/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 18:00:36 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=700</guid>
		<description><![CDATA[I&#8217;ve been preparing for the past few months to take the Zend certification for PHP. However I&#8217;ve been busy as well with client projects but I plan to take it this year. Here is an interesting chart on the growth of PHP Certified Developers through the years. The growth of PHP developers have been phenomenal [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been preparing for the past few months to take the Zend certification for PHP. However I&#8217;ve been busy as well with client projects but I plan to take it this year. Here is an interesting chart on the growth of PHP Certified Developers through the years. The growth of PHP developers have been phenomenal due to developing applications on open source environment LAMP(Linux, Apache, MySQL and PHP) has always been cheaper alternative, but with the numbers of PHP developers growing there has not been a significant growth for those getting themselves PHP certified.</p>
<p>Here is a slide chart courtesy from a research made by Prof. Mauricio Garcia F. Nascimento from Sao Paulo </p>
<p><a href="http://blog.lopau.com/wp-content/uploads/2009/07/certified-php-experts.jpg"><img src="http://blog.lopau.com/wp-content/uploads/2009/07/certified-php-experts-300x240.jpg" alt="certified-php-experts" title="certified-php-experts" width="300" height="240" class="aligncenter size-medium wp-image-701" /></a></p>
<p>With the U.S. leading with 1,047 PHP Certified Developers based on 2009.</p>
<p>And from 2004-2008 only 15 are PHP Certified from the Philippines. I want to belong in that company soon this year. So back to studying again.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/php-certified-developers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Zend Certified</title>
		<link>http://blog.lopau.com/zend-certified/</link>
		<comments>http://blog.lopau.com/zend-certified/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 13:04:18 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[zend certification]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=18</guid>
		<description><![CDATA[I have made a goal for myself to become Zend Certified, I&#8217;ve been prepping up studying to get ready for the test hopefully by October, 3 months to go. From starting out ages ago as graphics designer to becoming a full pledge web developer. Just having your name listed on Zend Yellow Pages would definitely [...]]]></description>
			<content:encoded><![CDATA[<p>I have made a goal for myself to become Zend Certified, I&#8217;ve been prepping up studying to get ready for the test hopefully by October, 3 months to go. From starting out ages ago as graphics designer to becoming a full pledge web developer. Just having your name listed on Zend Yellow Pages would definitely be an achievement. Kudos to the guys who already made it.</p>
<p><span id="more-18"></span></p>
<p><a href="http://www.zend.com/store/education/certification/yellow-pages.php?cid=172&amp;submit=search&amp;orderby=ID&amp;form_name=Zend_VUE_Search_Form ">http://www.zend.com/store/education/certification/yellow-pages.php?cid=172&amp;submit=search&amp;orderby=ID&amp;form_name=Zend_VUE_Search_Form </a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/zend-certified/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to enable GD Library</title>
		<link>http://blog.lopau.com/how-to-enable-gd-library/</link>
		<comments>http://blog.lopau.com/how-to-enable-gd-library/#comments</comments>
		<pubDate>Sun, 15 Jun 2008 13:47:58 +0000</pubDate>
		<dc:creator>lopau</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[enable gd library]]></category>

		<guid isPermaLink="false">http://blog.lopau.com/?p=12</guid>
		<description><![CDATA[My first basic PHP tutorial. Pretty simple tutorial on enabling the GD support extension. PHP 4.3.x and higher by default has GD support included but may not be enabled. First thing to do is to check with phpinfo(), if you don&#8217;t see GD support, then we need to enable it. Simply open your php.ini and [...]]]></description>
			<content:encoded><![CDATA[<p>My first basic PHP tutorial. Pretty simple tutorial on enabling the GD support extension. PHP 4.3.x and higher by default has GD support included but may not be enabled. First thing to do is to check with <em>phpinfo()</em>, if you don&#8217;t see GD support, then we need to enable it.</p>
<p><span id="more-12"></span></p>
<p>Simply open your <em>php.ini</em> and uncomment extension=php_gd2.dll</p>
<blockquote><p>;extension=php_exif.dll<br />
;extension=php_fdf.dll<br />
;extension=php_filepro.dll<br />
extension=php_gd2.dll</p></blockquote>
<p>Next check the extension_dir and edit to your php directory.</p>
<blockquote><p>extension_dir = C:\php\extensions\</p></blockquote>
<p>Edit the path accordingly to where the php_gd2.dll file is found in the php directory.<br />
Save and restart Apache. GD should now be enabled.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lopau.com/how-to-enable-gd-library/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

