<?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>Will Fitch&#039;s Blog &#187; web service</title>
	<atom:link href="http://www.willfitch.com/tag/web-service/feed" rel="self" type="application/rss+xml" />
	<link>http://www.willfitch.com</link>
	<description></description>
	<lastBuildDate>Sun, 11 Dec 2011 23:39:12 +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>What is a Web Service?</title>
		<link>http://www.willfitch.com/what-is-a-web-service.html</link>
		<comments>http://www.willfitch.com/what-is-a-web-service.html#comments</comments>
		<pubDate>Tue, 29 Apr 2008 20:01:26 +0000</pubDate>
		<dc:creator>Will Fitch</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.phpfever.com/?p=53</guid>
		<description><![CDATA[A web service is a way for systems to communicate over a network. They can be as simple as an API (e.g. Google Maps) or as complex as a brokered system that handles transactions for multiple requesters and/or providers. Web services bring with them some huge advantages. Data is packaged via HTTP or HTTPS and [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/images/WS-Standards-2007-02-medium.jpg" style="padding:2px;" width="200" height="142" alt="Web Services" align="left" border="0" />A web service is a way for systems to communicate over a network.  They can be as simple as an API (e.g. Google Maps) or as complex as a brokered system that handles transactions for multiple requesters and/or providers.</p>
<p>Web services bring with them some huge advantages.  Data is packaged via HTTP or HTTPS and can usually bypass firewalls since port 80 and 443 are commonly allowed open.  This plays a big role where intranet systems need to communicate but have a very strict set of firewall rules.  An example might be an Oracle DB link needing to reach a MySQL server.  Typically this is a daunting task as you have to go through the bureaucracy of getting the proper ports opened, get added to one or more access-controlled lists, receive/provide access privileges at the database level, etc.  Then there is the issue of direct access to data, either by view, table or procedure;  the list goes on and on.</p>
<p>Most of these problems can be eliminated by the use of web services.  This article&#8217;s objective is to explain, at a high-level, when, why and how web services are used.</p>
<p><span id="more-249"></span></p>
<h3>Table of Contents</h3>
<ol>
<li><a href="#wso">Web Service Overview</a></li>
<li><a href="#adc">Authoritative Data Control</a></li>
<li><a href="#mdaws">Multi-Data Access Web Services</a></li>
<li><a href="#bpws">Business Platform Web Services</a></li>
<li><a href="#wstct">Web Service Technologies and Common Terms</a></li>
</ol>
<p><strong><u><a name="wso">Web Service Overview</a></u></strong></p>
<p>As stated above, web services can be as simple as an API call similar to <a href="http://code.google.com/apis/maps/">Google Maps</a> where a client requests an action be performed and data sent/received.  You may have a system that displays a location based on a zip code related to a row in the database, and you want to display that precise location on a map to the end user.  You would send a request to the provider, Google in this case, and it would return a map based on that criteria.  This is a very common form of web services: a client requests data from a provider and the provider returns data based on the client&#8217;s request.</p>
<p><strong><u><a name="adc">Authoritative Data Control</a></u></strong></p>
<p>A not-so-common form of web services is authoritative data control.  This is when two or more systems have a unique set of data, but share a common subset of data elements.</p>
<p>Take the automotive industry, for example, and mix in auto insurance and the DMV (Department of Motor Vehicles).  All three sources might share a car&#8217;s VIN (Vehicle Identification Number), make, model, license plate number, and insurance policy number.  Today, I&#8217;ll bet there are few, if any, systems setup to share this type of authoritative data.  Instead, you are forced to give this information to each source.  Let&#8217;s analyze.</p>
<p>When you pull into a car lot, the following data elements are known prior to even selecting your car:</p>
<ol>
<li>VIN</li>
<li>Make</li>
<li>Model</li>
</ol>
<p>Identifying the origin of data is extremely important.  This will define the business logic behind identifying authoritative data sources.  We know the VIN is unique to every car on the road, so it will act as our &#8220;primary&#8221; or &#8220;unique&#8221; key.  All sources that need information relating to a single vehicle can use this to request and send data.  The make and model are absolutely not unique, so they will be accompanied by a VIN number.  If you are familiar with databases, you should be seeing a pattern here.</p>
<p>Now you have purchased the car of choice and ready to get on the road!  Wait!  You need a temporary license tag!  This information will make your car legal on the road for a short period of time.  In order to get this, however, you will need insurance!  You call up your insurance agent or company, and inform them of the new purchase.  They ask you for the automobiles VIN, and make a request to the dealer/manufacturer and get the information relating to the car.  They provide you with your policy number, which you hand off to the dealer.  They register your car with the DMV by providing the VIN and insurance policy number.  Yay!  You can drive off the lot.</p>
<p>Now that you&#8217;ve had the car for a few days, you need to get a permanent license plate.  Why not visit the DMV&#8217;s website and order it?  You visit the website, enter your VIN number and pay for your plate.  The DMV then pulls the information, grabs a license plate, sends the updated registration information to the dealer and insurance and sends your license plate.  Isn&#8217;t it a perfect world!!  Well, not exactly.</p>
<p>The difficult part about web services is not the technology;  it&#8217;s the business logic.  The DMV may think it should house all of the data and provide it to the insurance and dealer while the dealer thinks it should own it because it&#8217;s the originating source.  It takes dedication and sacrifice by those who make business decisions in order for scenarios like this to happen.</p>
<p><strong><u><a name="mdaws">Multi-Data Access Web Services</a></u></strong></p>
<p>This is another common scenario that is rarely addressed with web services:  a single data source that multiple systems access.  This situation is a no-brainer if you are building a new system, but can be hell if you are converting existing ones.</p>
<p>Let&#8217;s say you have a system that has a massive PostgreSQL database with views, procedures and tables and has a relatively old or unstable platform.  You have five systems that all use their own views and procedures to access and manipulate the data, and they are all mature sites.</p>
<p>This is a very hard situation to convert to web services, but it has its benefits.  What if you&#8217;re ready to (or have to) convert this system to MySQL?  You now have five codebases to change, views and stored procedures to reverse-engineer and months of development on your hands.</p>
<p>Now, imagine if you had a single source where a series of web services provide the data and same functionality as the views and procedures from the database.  All five systems manipulate and read the data from those web services.  You have only one place to change the code once the database is converted over to MySQL.  All of those views and procedures probably wouldn&#8217;t be necessary if these services provided that functionality.</p>
<p><strong><u><a name="bpws">Business Platform Web Services</a></u></strong></p>
<p>A Business Platform Web Service (that&#8217;s what I call it) is when most or all aspects of a business are driven by web services.  This is a very complex scenario and requires a mature set of programs.  You should have fail-overs in place for this, but if a single program fails, panic would arise in the programmer&#8217;s den.</p>
<p>In order to illustrate this, I will give you a fictitious company and scenario:</p>
<p><strong>Example Scenario</strong></p>
<p>A tire company called &#8220;ABC Tires&#8221; is located in the state of Arizona, and resells its tires to 200 stores in Tennessee, Alabama, Florida and Texas.  This tire company provides a combined average of 500,000 tires per month to all of its locations.  The tire factory has enough employees to produce that amount and no more.  It is crucial that each of these resellers not get backlogged on orders or tires will not be delivered on time and business will be lost.</p>
<p>To make things a little more complicated, tires are only shipped out in bulks of 5,000, and this tire company uses 4 different freight companies to deliver its tires.  Each of these freights attend to other clients, so they need as much notification as possible for pickup.</p>
<p>Take not of the diagram below:</p>
<p><center><img src="/images/tire_reseller.jpg" border="1" style="padding:10px;" /></center></p>
<p><strong>Let&#8217;s run through the scenario:</strong></p>
<ol>
<li>Reseller makes tire sale.  Point-of-sale system has a web service hook and sends the request to the provider.</li>
<li>Provider tracks sale and sends request for tire to be made.</li>
<li>Plant creates tire and sends it to the warehouse.  It then informs the provider that the tire has been created/replaced.</li>
<li>Provider checks the database for the total tires in the warehouse.  If the count is getting close to 5,000, it sends a request to freight providers until a confirmed shipment is setup.  The freight returns the pickup time back to the provider.</li>
<li>Provider informs reseller(s) of shipment.  The reseller can then hold tires for potential customers and can provide a date for installation/purchase.</li>
<li>Freight delivers tires to reseller(s).</li>
</ol>
<p>The are many advantages to this setup: single data source, automated work flow and no firewall rules to worry about.  Setting up a system like this requires time, planning and dedication on the part of the company implementing it.</p>
<p>There are other examples of more advanced web service systems where UDDIs (Universal Description, Discovery and Integration), an XML-based registry for businesses worldwide to list themselves, are involved but that is beyond the scope of this article.  Let&#8217;s take a look at some technologies associated with web services.</p>
<p><strong><u><a name="wstct">Web Service Technologies and Common Terms</a></u></strong></p>
<p>There are many technologies associated with web services, and I will attempt to touch some of them.  I will not go in-depth on any single technology as I will reserve a future article for them.</p>
<p><strong>Specifications<sup><a href="#wikipedia_footnote">1</a></sup></strong></p>
<ul>
<li>WS-Security &#8211; Defines how to use XML Encryption and XML Signature in SOAP to secure message exchanges, as an alternative or extension to using HTTPS to secure the channel.</li>
<li>WS-Reliability &#8211; An OASIS standard protocol for reliable messaging between two Web services.</li>
<li>WS-ReliableMessaging &#8211; A protocol for reliable messaging between two Web services, issued by Microsoft, BEA and IBM it is currently being standardized by the OASIS organization.</li>
<li>WS-Addressing &#8211; A way of describing the address of the recipient (and sender) of a message, inside the SOAP message itself.</li>
<li>WS-Transaction &#8211; A way of handling transactions</li>
</ul>
<p><strong>Styles of Use<sup><a href="#wikipedia_footnote">1</a></sup></strong></p>
<p><strong>Remote procedure calls</strong> &#8211; RPC Web services present a distributed function (or method) call interface that is familiar to many developers. Typically, the basic unit of RPC Web services is the WSDL operation.</p>
<p>The first Web services tools were focused on RPC, and as a result this style is widely deployed and supported. However, it is sometimes criticised for not being loosely coupled, because it was often implemented by mapping services directly to language-specific functions or method calls. Many vendors felt this approach to be a dead end, and pushed for RPC to be disallowed in the WS-I Basic Profile.</p>
<p><strong>Service-oriented architecture</strong> &#8211; Web services can also be used to implement an architecture according to Service-oriented architecture (SOA) concepts, where the basic unit of communication is a message, rather than an operation. This is often referred to as &#8220;message-oriented&#8221; services.</p>
<p>SOA Web services are supported by most major software vendors and industry analysts. Unlike RPC Web services, loose coupling is more likely, because the focus is on the &#8220;contract&#8221; that WSDL provides, rather than the underlying implementation details.</p>
<p><strong>Representational state transfer</strong> &#8211; Finally, RESTful Web services attempt to emulate HTTP and similar protocols by constraining the interface to a set of well-known, standard operations (e.g., GET, PUT, DELETE). Here, the focus is on interacting with stateful resources, rather than messages or operations. RESTful Web services can use WSDL to describe SOAP messaging over HTTP, which defines the operations, or can be implemented as an abstraction purely on top of SOAP (e.g., WS-Transfer).</p>
<p>WSDL version 2.0 offers support for binding to all the HTTP request methods (not only GET and POST as in version 1.1) so it enables a better implementation of RESTful Web services[1]. However support for this specification is still poor in software development kits, which often offer tools only for WSDL 1.1.</p>
<p><sup>1</sup> &#8211; <i><a name="wikipedia_footnote">http://en.wikipedia.org/wiki/Web_service</a></i></p>
]]></content:encoded>
			<wfw:commentRss>http://www.willfitch.com/what-is-a-web-service.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zip Code Web Service Under Maintenance</title>
		<link>http://www.willfitch.com/zip-code-web-service-under-maintenance.html</link>
		<comments>http://www.willfitch.com/zip-code-web-service-under-maintenance.html#comments</comments>
		<pubDate>Fri, 28 Mar 2008 03:55:03 +0000</pubDate>
		<dc:creator>Will Fitch</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[zip code]]></category>

		<guid isPermaLink="false">http://www.phpfever.com/zip-code-web-service-under-maintenance.html</guid>
		<description><![CDATA[The zip code web service will be under maintenance until April 3rd. I am completing a total overhaul on my blog, so please hang in there with me.]]></description>
			<content:encoded><![CDATA[<p>The zip code web service will be under maintenance until April 3rd.  I am completing a total overhaul on my blog, so please hang in there with me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.willfitch.com/zip-code-web-service-under-maintenance.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SOAP Zip Code Web Service!</title>
		<link>http://www.willfitch.com/soap-zip-code-web-service.html</link>
		<comments>http://www.willfitch.com/soap-zip-code-web-service.html#comments</comments>
		<pubDate>Fri, 27 Jul 2007 01:07:59 +0000</pubDate>
		<dc:creator>Will Fitch</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[zip code]]></category>

		<guid isPermaLink="false">http://www.phpfever.com/soap-zip-code-web-service.html</guid>
		<description><![CDATA[I have completed the major functionality to the SOAP integration of the zip code services. The following methods can be used to get the data you need: getDistanceByZip &#8211; Get the distance from one zip code to another getZipsByRadius &#8211; Get GPS information within (X) miles of a zip code getLocalTime &#8211; Get the local [...]]]></description>
			<content:encoded><![CDATA[<p>I have completed the major functionality to the SOAP integration of the zip code services. The following methods can be used to get the data you need:</p>
<ol>
<li><strong>getDistanceByZip</strong> &#8211; Get the distance from one zip code to another</li>
<li><strong>getZipsByRadius</strong> &#8211; Get GPS information within (X) miles of a zip code</li>
<li><strong>getLocalTime</strong> &#8211; Get the local time for a zip code</li>
</ol>
<p>I am going to describe each function in depth, and give examples of each in a few languages. If you have suggestions to this service, feel free to contact me using the contact form.</p>
<p><strong>About the Service</strong></p>
<p>This web service is provided absolutely free. Please don&#8217;t abuse this. If requests start getting out of hand and bringing my server to its knees, I will start limiting the number of queries per user per day. I don&#8217;t want to do this, but I do like my server actually serving <img src='http://www.willfitch.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>It is an RPC style web service, as it really isn&#8217;t complicated and is limited to a very specific audience. It&#8217;s also easier for developers to use and understand in comparison to document-literal.</p>
<p><span id="more-242"></span></p>
<p><strong>Error Handling &#8211; SoapFault </strong></p>
<p>If you receive a SoapFault from any of these services, it will be for one of two reasons:</p>
<ol>
<li>Client &#8211; you specified invalid parameters</li>
<li>Server &#8211; something is wrong with my server (let me know if you get this <img src='http://www.willfitch.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</li>
</ol>
<p>Always use a try-catch block when executing requests. In the event a SoapFault is caught, check to see if it&#8217;s a Server or Client error. If it&#8217;s a Client error, you can rest assured that there are no results to be returned because of invalid parameters, or there&#8217;s just no more data. If it is a Server reason, you might inform your users that &#8220;The server is experiencing difficulties&#8221; or something.</p>
<p><strong>Optimization (and less bandwidth)</strong></p>
<p>To optimize your runtime experience, <a href="http://www.phpfever.com/web-services/ZipCode.wsdl" title="Zip Code SOAP Web Service WSDL">download my WSDL</a>. This will save your script tons of time and me bandwidth. Also, unless you are in a development environment, make sure your php.ini value &#8220;soap.wsdl_cache&#8221; is set to 1. This will cache your WSDL in a temporary directory.</p>
<p>Now, on to the service description.</p>
<p><strong>Getting Distances Between Zip Codes &#8211; getDistanceByZip(int zipcode1, int zipcode2)</strong></p>
<p>The parameters for this service is pretty much self-explanatory. In order to successfully retrieve the distance between two zip codes, you should <strong>specify two valid zip codes</strong>.</p>
<p>It&#8217;s important to inform you that this is <strong>not road distance!</strong> This is in fact calculating the distance based on longitude and latitude. The result is always mileage returned in floating point number format, unless you try to get the distance between non-existing zip codes, at which point a Client SoapFault will be returned. This is a very simple, but useful tool for dating sites, phonebooks, etc. Time for some example code!</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$zip1</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">35761</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// New Market, AL</span>
&nbsp;
<span style="color: #000088;">$zip2</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">12345</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Schenectady, NY</span>
&nbsp;
try <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000088;">$soap</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SoapClient<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.phpfever.com/web-services/ZipCode.wsdl&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$distance</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$soap</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDistanceByZip</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$zip1</span><span style="color: #339933;">,</span><span style="color: #000088;">$zip2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span> catch <span style="color: #009900;">&#40;</span>SoapFault <span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// print the exception or do something different</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>It&#8217;s that simple!</p>
<p><strong>Zip Code Radius Searching &#8211; getZipsByRadius(int $zip_code, int $radius, string $return_type, int $start, int $end)</strong></p>
<p>The purpose of this service is getting other zip codes within a specified mileage, by a zip code. For instance, you have a dating service and you want your users to be able to search for matches by zip code. The process flow like this:</p>
<ol>
<li>Get user&#8217;s zip code (e.g. via form submission).</li>
<li>Send that zip code along with a radius (specified mileage) to the web service.</li>
<li>Receive the information from the service.</li>
<li>Query against your database with the provided zip codes.</li>
</ol>
<p>Voila! You now have a list of users by zip code and radius. The cool part about this service is that you can either receive the data by serialized array (PHP only) or XML. I recommend using SimpleXML if you plan to request the document in XML format.</p>
<p>The parameters are very important. You must specify each of them every time. Here are the definitions:</p>
<ol>
<li>int zip_code &#8211; this is the zip code to search against</li>
<li>int radius &#8211; this is the distance in mileage from the zip code. There is no maximum value here although this is limited to the US.</li>
<li>string return_type &#8211; either XML or ARRAY (case doesn&#8217;t matter). If array is chosen, a serialized array will be returned. If XML, obviously XML will be returned. See below for sample XML document.</li>
<li>int start &#8211; this is the starting point. It actually allows you to do pagination! If you are familiar with MySQL&#8217;s LIMIT clause, this is the first number (e.g. LIMIT 0,&#8230;)</li>
<li>int end &#8211; this is the ending point. Reverting back to the MySQL LIMIT clause LIMIT 0,30. This has a maximum value of 500. In other words, you can only receive a maximum of 500 results at any given query. Use the start, end capabilties to paginate!</li>
</ol>
<p><a href="http://www.phpfever.com/uploads/sampledoc.xml" title="Sample XML Document">Click here to download the sample XML document.</a></p>
<p>Again, the example:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">try <span style="color: #009900;">&#123;</span>
&nbsp;
 <span style="color: #000088;">$soap</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SoapClient<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.phpfever.com/web-services/ZipCode.wsdl&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #000088;">$distance</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$soap</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getZipsByRadius</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">35761</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">100</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'XML'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span> catch <span style="color: #009900;">&#40;</span>SoapFault <span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
 <span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// print the exception or do something different</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Very simple.</p>
<p><strong>Getting Local Time Based on Zip Code &#8211; getLocalTime(int zipcode,string format)</strong></p>
<p>This simple, yet powerful service allows you to get the local date/time of a specific zip code. The date and time fields are two separate elements for easier parsing.</p>
<p>Example:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&nbsp;
try <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$soap</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SoapClient<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://www.phpfever.com/web-services/ZipCode.wsdl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$time</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$soap</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getLocalTime</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">35761</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> catch <span style="color: #009900;">&#40;</span>SoapFault <span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>That&#8217;s it! I will be posting more example code in different languages as I go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.willfitch.com/soap-zip-code-web-service.html/feed</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>

