<?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>Dimuthu's Blog &#187; wsdl mode</title>
	<atom:link href="http://www.dimuthu.org/tag/wsdl-mode/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dimuthu.org</link>
	<description>Waiting for your comments</description>
	<lastBuildDate>Wed, 21 Dec 2011 05:39:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<image>
  <link>http://www.dimuthu.org</link>
  <url>http://www.dimuthu.org/favicon.ico</url>
  <title>Dimuthu's Blog</title>
</image>
		<item>
		<title>WSF/PHP Test Cases Explained</title>
		<link>http://www.dimuthu.org/blog/2008/11/11/wsfphp-test-cases-explained/</link>
		<comments>http://www.dimuthu.org/blog/2008/11/11/wsfphp-test-cases-explained/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 19:27:10 +0000</pubDate>
		<dc:creator>dimuthu</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Tutorial/Guide]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[WSDL]]></category>
		<category><![CDATA[wsf/php]]></category>
		<category><![CDATA[wso2]]></category>
		<category><![CDATA[xml schema]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[mtom]]></category>
		<category><![CDATA[phpt]]></category>
		<category><![CDATA[reliable messaging]]></category>
		<category><![CDATA[rm]]></category>
		<category><![CDATA[schema]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[test-suit]]></category>
		<category><![CDATA[tests]]></category>
		<category><![CDATA[wsdl generation]]></category>
		<category><![CDATA[wsdl mode]]></category>

		<guid isPermaLink="false">http://www.dimuthu.org/?p=594</guid>
		<description><![CDATA[WSO2 WSF/PHP comes with a comprehensive set of test cases. It covers the most of the basic/concrete scenarios supported by WSF/PHP. You can find these test cases inside the &#8220;src/tests&#8221; directory of WSF/PHP source package. Or you can find the latest test-suite from the SVN location. Here are some aspects covered in the test-suit. Scenario [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wso2.org/projects/wsf/php">WSO2 WSF/PHP</a> comes with a comprehensive set of test cases. It covers the most of the basic/concrete scenarios supported by WSF/PHP. You can find these test cases inside the &#8220;src/tests&#8221; directory of WSF/PHP source package. Or you can find the latest test-suite from <a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/">the SVN location</a>.</p>
<p>Here are some aspects covered in the test-suit.</p>
<table border="1">
<tbody>
<tr style="background:#dddddd">
<td>Scenario</td>
<td>Test Cases For Client</td>
<td>Test Cases For Service</td>
</tr>
<tr>
<td>Basic Functionality</td>
<td><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/">echo_client*.phpt</a><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/">math_*.phpt</a></td>
<td><a href="https://wso2.org/repos/wso2/trunk/wsf/php/samples/">samples/echo_service*.php</a><br />
<a href="https://wso2.org/repos/wso2/trunk/wsf/php/samples/">samples/math_service.php</a></td>
</tr>
<tr>
<td>Basic Schema Types</td>
<td><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/BasicDataTypes/">BasicDataTypes/*.phpt</a></td>
<td><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/services/BasicTypesDoclitBSvc/">services/BasicTypesDoclitBSvc/*.php</a></td>
</tr>
<tr>
<td>Complex Schema Types</td>
<td><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/cmplxDataTypes/">cmplxDataTypes/*.phpt</a></td>
<td><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/services/ComplexDataTypesWSvc/">services/ComplexDataTypesWSvc/*.php</a><br />
<a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/services/ComplexDataTypesBSvc/">services/ComplexDataTypesBSvc/*.php</a></td>
</tr>
<tr>
<td>WSDL/Schema Variations</td>
<td><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/wsdl_mode/">wsdl_mode/*.phpt</a></td>
<td><a href="https://wso2.org/repos/wso2/trunhttps://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/services/wsdl_mode/">services/wsdl_mode/*.php</a></td>
</tr>
<tr>
<td>WSDL Generation with Annotations</td>
<td><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/wsdl_generation/">wsdl_generation/*.phpt</a></td>
<td><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/services/wsdl_generation/">services/wsdl_generation/*.php</a></td>
</tr>
<tr>
<td>Reliable Messaging</td>
<td><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/">echo_rm*.phpt</a></td>
<td><a href="https://wso2.org/repos/wso2/trunk/wsf/php/samples/">samples/echo_service_rm*.php</a></td>
</tr>
<tr>
<td>Security</td>
<td><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/">echo_encrypt_client*.phpt</a><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/">echo_signing_client*.phpt</a></p>
<p><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/">echo_timestamp_client*.phpt</a></p>
<p><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/">echo_username_token_client*.phpt</a></td>
<td><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/services/">encrypt_service*.php</a><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/services/">signing_service*.php</a></p>
<p><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/services/">timestamp_service*.php</a></p>
<p><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/services/">username_token_service*.php</a></td>
</tr>
<tr>
<td>MTOM</td>
<td><a href="https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/">mtom_*.phpt</a></td>
<td><a href="https://wso2.org/repos/wso2/trunk/wsf/php/samples/mtom/">samples/mtom/*.php</a></td>
</tr>
</tbody>
</table>
<p>(Note that Here &#8216;*&#8217; is used as a wild card represent 0 or many characters)</p>
<p><strong>Steps to Run Tests</strong></p>
<ul>
<li>First you need to install WSF/PHP correctly. Please read the <a href="http://wso2.org/project/wsf/php/2.0.0/docs/manual_content.html#Installation">WSF/PHP installation manual</a> for that.</li>
<li>You have to have the &#8216;pear&#8217; utility tool comes with PHP. And add this to the PATH environment variable.</li>
<li>Copy the samples and src/tests/samples/services directory (paths are relative to the root directory of the wsf/php package) to the web root directory.</li>
<li>Then go to the src/tests directory and execute the following command.
<pre>pear run-tests -r</pre>
<p>This will execute all the test cases under the &#8216;tests&#8217; directory and finally give a summery of the test results.</li>
<li> You can run individual test cases separately by providing the relative path to the test case from the &#8216;test&#8217; directory. E.g. To run the echo_client.phpt test case, you may type
<pre>pear run-tests samples/echo_client.phpt</pre>
</li>
</ul>
<p>If you like to add test cases for the WSF/PHP scenarios, follow this comprehensive guideline titled <a href="http://wso2.org/library/3579">Writing Simple phpt Test Scripts For PHP Web Services</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dimuthu.org/blog/2008/11/11/wsfphp-test-cases-explained/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WSF/PHP Services Performance test with WSDL Caching</title>
		<link>http://www.dimuthu.org/blog/2008/10/28/wsfphp-services-performance-test-with-wsdl-caching/</link>
		<comments>http://www.dimuthu.org/blog/2008/10/28/wsfphp-services-performance-test-with-wsdl-caching/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 12:33:48 +0000</pubDate>
		<dc:creator>dimuthu</dc:creator>
				<category><![CDATA[perfomance test]]></category>
		<category><![CDATA[WSDL]]></category>
		<category><![CDATA[wsf/php]]></category>
		<category><![CDATA[wso2]]></category>
		<category><![CDATA[cacheWSDL]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[response time]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[WSDL Caching]]></category>
		<category><![CDATA[wsdl mode]]></category>

		<guid isPermaLink="false">http://www.dimuthu.org/?p=547</guid>
		<description><![CDATA[WSDL Caching is first introduced with the WSF/PHP 2.0.0 release to optimize the response time of PHP web services. In WSDL Caching WSF/PHP keeps an intermediate XML model which is generated from the WSDL in memory. This intermediate model which we call as &#8216;SIG&#8217; or &#8216;Signature&#8217; model is generated at the first request to the [...]]]></description>
			<content:encoded><![CDATA[<p>WSDL Caching is first introduced with the <a href="http://wso2.org/projects/wsf/php">WSF/PHP 2.0.0</a> release to optimize the response time of PHP web services. In WSDL Caching WSF/PHP keeps an intermediate XML model which is generated from the WSDL in memory. This intermediate model which we call as &#8216;SIG&#8217; or &#8216;Signature&#8217; model is generated at the first request to the service. This SIG can be generated using an XSLT template from any WSDL 2.0. So if you provide a WSDL version 1.1, WSF/PHP first convert it to a WSDL 2.0 using another XSLT template and then generate the SIG model. So in generally when WSDL caching is used it avoids two XSLT parses and hence optimize the response time significantly.</p>
<p>In this blog, I will show you a result of some performance tests I did to measure the response time of a service with and without WSDL Caching.</p>
<p>The complete source codes used for the test can be found from <a href="http://downloads.dimuthu.org/codes/wsfphp/wsdl_caching_test.zip">here</a>.</p>
<p>Here is a part of the service script I used. It is a simple echo service that echo a string.</p>
<pre class="php">	<span style="font-style: italic; color: #808080;">// create service in WSDL mode</span>
	<span style="color: #0000ff;">$service</span> = <span style="font-weight: bold; color: #000000;">new</span> WSService<span style="color: #66cc66;">(</span><a href="http://www.php.net/array"><span style="color: #000066;">array</span></a> <span style="color: #66cc66;">(</span><span style="color: #ff0000;">"wsdl"</span> =&gt;<span style="color: #ff0000;">"echo.wsdl"</span>,
			<strong><span style="color: #ff0000;">"cacheWSDL"</span> =&gt; <span style="font-weight: bold; color: #000000;">false</span>, <span style="font-style: italic; color: #808080;">// By default cache WSDL is true</span></strong>
			<span style="color: #ff0000;">"actions"</span> =&gt; <span style="color: #0000ff;">$actions</span>,
			<span style="color: #ff0000;">"operations"</span> =&gt; <span style="color: #0000ff;">$operations</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;

	<span style="font-style: italic; color: #808080;">// getting the start_time</span>
	<span style="color: #0000ff;">$start_time</span> = <a href="http://www.php.net/microtime"><span style="color: #000066;">microtime</span></a><span style="color: #66cc66;">(</span><span style="font-weight: bold; color: #000000;">true</span><span style="color: #66cc66;">)</span>;

	<span style="font-style: italic; color: #808080;">// process client requests and reply </span>
	<span style="color: #0000ff;">$service</span>-&gt;<span style="color: #006600;">reply</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;

	<span style="font-style: italic; color: #808080;">// getting the end time</span>
	<span style="color: #0000ff;">$end_time</span> = <a href="http://www.php.net/microtime"><span style="color: #000066;">microtime</span></a><span style="color: #66cc66;">(</span><span style="font-weight: bold; color: #000000;">true</span><span style="color: #66cc66;">)</span>;

	<span style="font-style: italic; color: #808080;">// getting the time difference</span>
	<span style="color: #0000ff;">$time_diff</span> = <span style="color: #0000ff;">$end_time</span> - <span style="color: #0000ff;">$start_time</span>;

	logme<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$time_diff</span><span style="color: #66cc66;">)</span>;</pre>
<p>You can see in there I have set the &#8220;cacheWSDL&#8221; to false and log the time taken by the $service-&gt;reply() function. Later I have set the &#8220;cacheWSDL&#8221; to true and measure the time again for the comparison with earlier values.</p>
<p>I have written a client to invoke the service 10 times. And I&#8217;m going to measure the time taken do the client request in there.</p>
<pre class="php">	    <span style="color: #b1b100;">for</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$i</span> = <span style="color: #cc66cc;">1</span>; <span style="color: #0000ff;">$i</span> &lt;= <span style="color: #cc66cc;">10</span>; <span style="color: #0000ff;">$i</span> ++<span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
		<span style="font-style: italic; color: #808080;">// create client in WSDL mode</span>
		<span style="color: #0000ff;">$client</span> = <span style="font-weight: bold; color: #000000;">new</span> WSClient<span style="color: #66cc66;">(</span><a href="http://www.php.net/array"><span style="color: #000066;">array</span></a> <span style="color: #66cc66;">(</span><span style="color: #ff0000;">"wsdl"</span> =&gt;<span style="color: #ff0000;">"echo.wsdl"</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;

		<span style="font-style: italic; color: #808080;">// get proxy object reference form client </span>
		<span style="color: #0000ff;">$proxy</span> = <span style="color: #0000ff;">$client</span>-&gt;<span style="color: #006600;">getProxy</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;

		<span style="font-style: italic; color: #808080;">// create input object and set values</span>
		<span style="font-style: italic; color: #808080;">//TODO: fill $input with (data type: string) data to match your business logic</span>
		<span style="color: #0000ff;">$input</span> = <span style="color: #ff0000;">"Hello World"</span>;

		<span style="font-style: italic; color: #808080;">// getting the start_time</span>
		<span style="color: #0000ff;">$start_time</span> = <a href="http://www.php.net/microtime"><span style="color: #000066;">microtime</span></a><span style="color: #66cc66;">(</span><span style="font-weight: bold; color: #000000;">true</span><span style="color: #66cc66;">)</span>;

		<span style="font-style: italic; color: #808080;">// call the operation</span>
		<span style="color: #0000ff;">$response</span> = <span style="color: #0000ff;">$proxy</span>-&gt;<span style="color: #006600;">myEcho</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$input</span><span style="color: #66cc66;">)</span>;
		<span style="font-style: italic; color: #808080;">//TODO: Implement business logic to consume $response, which is of type string</span>

		<span style="font-style: italic; color: #808080;">// getting the end time</span>
		<span style="color: #0000ff;">$end_time</span> = <a href="http://www.php.net/microtime"><span style="color: #000066;">microtime</span></a><span style="color: #66cc66;">(</span><span style="font-weight: bold; color: #000000;">true</span><span style="color: #66cc66;">)</span>;

		<span style="font-style: italic; color: #808080;">// getting the time difference</span>
		<span style="color: #0000ff;">$time_diff</span> = <span style="color: #0000ff;">$end_time</span> - <span style="color: #0000ff;">$start_time</span>;

		logme<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$time_diff</span><span style="color: #66cc66;">)</span>;

		<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$response</span>.<span style="color: #ff0000;">"&lt;/br&gt;"</span>;

	    <span style="color: #66cc66;">}</span></pre>
<p>Then I have measured the time taken to first 10 request for both WSDL caching on and off scenarios just after starting the Apache server.</p>
<table border="1">
<tbody>
<tr style="background: #dddddd">
<td colspan="2">Without WSDL Caching</td>
<td colspan="2">With WSDL Caching</td>
</tr>
<tr style="background: #dddddd">
<td>WSClient Operation invocation<br />
$client-&gt;myEcho($input)</td>
<td>WSService reply<br />
$service-&gt;reply()</td>
<td>WSClient Operation invocation<br />
$client-&gt;myEcho($input)</td>
<td>WSService reply<br />
$service-&gt;reply()</td>
</tr>
<tr>
<td>0.11091995239258</td>
<td>0.074313163757324</td>
<td>0.15158987045288</td>
<td>0.11872982978821</td>
</tr>
<tr>
<td>0.082005977630615</td>
<td>0.06772780418396</td>
<td>0.046205997467041</td>
<td>0.035470008850098</td>
</tr>
<tr>
<td>0.082638025283813</td>
<td>0.072394132614136</td>
<td>0.044647932052612</td>
<td>0.028353929519653</td>
</tr>
<tr>
<td>0.079883098602295</td>
<td>0.06883692741394</td>
<td>0.037378072738647</td>
<td>0.026839017868042</td>
</tr>
<tr>
<td>0.082012176513672</td>
<td>0.068314790725708</td>
<td>0.046517133712769</td>
<td>0.035148859024048</td>
</tr>
<tr>
<td>0.074619054794312</td>
<td>0.063674211502075</td>
<td>0.041852951049805</td>
<td>0.027253866195679</td>
</tr>
<tr>
<td>0.084127187728882</td>
<td>0.071602821350098</td>
<td>0.041593074798584</td>
<td>0.027820825576782</td>
</tr>
<tr>
<td>0.081571102142334</td>
<td>0.066971063613892</td>
<td>0.057910919189453</td>
<td>0.038385152816772</td>
</tr>
<tr>
<td>0.087567090988159</td>
<td>0.073211193084717</td>
<td>0.043420076370239</td>
<td>0.02738094329834</td>
</tr>
<tr>
<td>0.078658103942871</td>
<td>0.064589977264404</td>
<td>0.050504922866821</td>
<td>0.037022113800049</td>
</tr>
</tbody>
</table>
<p>If you obvious these values you will figure out when you don&#8217;t use WSDL caching it takes same amount of time to server each request. But when you turn on WSDL caching it takes a little more time at the very first request, but the subsequent requests take very low values.</p>
<p>Here is the chart for the above Data, See the Green and White lines corresponding to the WSDL caching turn on, have taken low values. In average we can observe a 50% reduction in server response time with the WSDL caching.</p>
<div id="attachment_552" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.dimuthu.org/wp-content/uploads/2008/10/chart.jpg"><img class="size-full wp-image-552" title="Response Time With and Without WSDL Caching" src="http://www.dimuthu.org/wp-content/uploads/2008/10/chart.jpg" alt="Response Time With and Without WSDL Caching" width="500" height="341" /></a><p class="wp-caption-text">Response Time With and Without WSDL Caching</p></div>
<p>This result is for a very simple WSDL which only had an echo operation. When the WSDL get more complex and contain lot of wsdl/schema includes and imports, we can expect more optimization due to the WSDL caching. We will check how the complexity of the WSDL affect the performance in a later blog post.:)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dimuthu.org/blog/2008/10/28/wsfphp-services-performance-test-with-wsdl-caching/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>WSF/PHP WSDL Mode &#8211; Handling XML Schema Arrays</title>
		<link>http://www.dimuthu.org/blog/2008/10/25/wsfphp-wsdl-mode-handling-xml-schema-arrays/</link>
		<comments>http://www.dimuthu.org/blog/2008/10/25/wsfphp-wsdl-mode-handling-xml-schema-arrays/#comments</comments>
		<pubDate>Sat, 25 Oct 2008 15:20:40 +0000</pubDate>
		<dc:creator>dimuthu</dc:creator>
				<category><![CDATA[Tutorial/Guide]]></category>
		<category><![CDATA[WSDL]]></category>
		<category><![CDATA[wsf/php]]></category>
		<category><![CDATA[wso2]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xml schema]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[maxOccurs]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wsdl mode]]></category>
		<category><![CDATA[wsdl2php]]></category>

		<guid isPermaLink="false">http://www.dimuthu.org/?p=543</guid>
		<description><![CDATA[In XML Schema we declare an array or a multiple occurrence of a schema element by setting its maxOccurs attribute to a value greater than 1 or to the value &#8220;unbounded&#8221; in a case of no maximum boundary. &#60;xs:element maxOccurs="unbounded"  minOccurs="0"  name="params"  nillable="true"  type="xs:int"/&#62; If you generate PHP code to such a schema using wsdl2php [...]]]></description>
			<content:encoded><![CDATA[<p>In XML Schema we declare an array or a multiple occurrence of a schema element by setting its maxOccurs attribute to a value greater than 1 or to the value &#8220;unbounded&#8221; in a case of no maximum boundary.</p>
<pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xs:element</span> <span style="color: #000066;">maxOccurs</span>=<span style="color: #ff0000;">"unbounded"
           </span> <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">"0"</span>
            <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"params"</span>
            <span style="color: #000066;">nillable</span>=<span style="color: #ff0000;">"true"</span>
            <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"xs:int"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></pre>
<p>If you generate PHP code to such a schema using <a title="online wsdl2php tool" href="http://labs.wso2.org/wsf/php/wsdl2phptool.php">wsdl2php tool</a>, you will get a code for the class variable named &#8220;params&#8221; similar to this.</p>
<pre class="php">    <span style="font-style: italic; color: #808080;">/**
     * @var array[0, unbounded] of int
     */</span>
    <span style="font-weight: bold; color: #000000;">public</span> <span style="color: #0000ff;">$params</span>;</pre>
<p>So if you have a variable (say $object) for the object of this class you can fill the &#8220;params&#8221; field like this,</p>
<pre class="php"><span style="color: #0000ff;">$object</span>-&gt;<span style="color: #006600;">params</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">(</span><span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">5</span>, <span style="color: #cc66cc;">8</span><span style="color: #66cc66;">)</span>;</pre>
<p>This will create the xml with the expected array of elements.</p>
<pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;wrapper<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;params<span style="font-weight: bold; color: black;">&gt;</span></span></span>1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/params<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;params<span style="font-weight: bold; color: black;">&gt;</span></span></span>5<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/params<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;params<span style="font-weight: bold; color: black;">&gt;</span></span></span>8<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/params<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/wrapper<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre>
<p>Not only for simple types, you can have arrays of complex types too.</p>
<pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xs:element</span> <span style="color: #000066;">maxOccurs</span>=<span style="color: #ff0000;">"unbounded"</span>
            <span style="color: #000066;">minOccurs</span>=<span style="color: #ff0000;">"0"</span>
            <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"params"</span>
            <span style="color: #000066;">nillable</span>=<span style="color: #ff0000;">"true"</span>
            <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"tns:MyComplexType"</span><span style="font-weight: bold; color: black;">/&gt;
</span></span></pre>
<p>Instead of giving simple integers like earlier case, this time you will feed the &#8220;params&#8221; variable with an array of PHP objects of &#8216;MyComplexType&#8217; class.</p>
<pre class="php"><span style="color: #0000ff;">$obj1</span> = <span style="font-weight: bold; color: #000000;">new</span> MyComplexType<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
<span style="font-style: italic; color: #808080;">/* feeding data to obj1 variables */</span>

<span style="color: #0000ff;">$obj2</span> = <span style="font-weight: bold; color: #000000;">new</span> MyComplexType<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
<span style="font-style: italic; color: #808080;">/* feeding data to obj2 variables */</span>

<span style="color: #0000ff;">$obj3</span> = <span style="font-weight: bold; color: #000000;">new</span> MyComplexType<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
<span style="font-style: italic; color: #808080;">/* feeding data to obj3 variables */</span>

<span style="color: #0000ff;">$object</span>-&gt;<span style="color: #006600;">params</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$obj1</span>, <span style="color: #0000ff;">$obj2</span>, <span style="color: #0000ff;">$obj3</span><span style="color: #66cc66;">)</span>;</pre>
<p>This will create a xml containing array of params similar to this,</p>
<pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;wrapper<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;params<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;elementx</span><span style="font-weight: bold; color: black;">/&gt;</span></span> <span style="color: #009900;"><span style="font-style: italic; color: #808080;">&lt;!-- elements in the MyComplexType type --&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;elementy</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/params<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;params<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        ... <span style="color: #009900;"><span style="font-style: italic; color: #808080;">&lt;!-- elements in the MyComplexType type --&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/params<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;params<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        ... <span style="color: #009900;"><span style="font-style: italic; color: #808080;">&lt;!-- elements in the MyComplexType type --&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/params<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/wrapper<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dimuthu.org/blog/2008/10/25/wsfphp-wsdl-mode-handling-xml-schema-arrays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Demo on Providing PHP Web Service with Username Token</title>
		<link>http://www.dimuthu.org/blog/2008/10/16/demo-on-providing-php-web-service-with-username-token/</link>
		<comments>http://www.dimuthu.org/blog/2008/10/16/demo-on-providing-php-web-service-with-username-token/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 17:43:45 +0000</pubDate>
		<dc:creator>dimuthu</dc:creator>
				<category><![CDATA[security]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[WSDL]]></category>
		<category><![CDATA[wsf/php]]></category>
		<category><![CDATA[wso2]]></category>
		<category><![CDATA[Calendar]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[policies]]></category>
		<category><![CDATA[wsdl mode]]></category>

		<guid isPermaLink="false">http://www.dimuthu.org/?p=468</guid>
		<description><![CDATA[WSF/PHP Demo Site contains number of applications that demonstrate the different features of WSO2 WSF/PHP in practice. Calendar Service is one of such application. It demonstrate the use of WSDL Mode for a service with different policies for different operations + the use of Username tokens. You can view the source code of the Calendar [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://labs.wso2.org/wsf/php">WSF/PHP Demo Site</a> contains number of applications that demonstrate the different features of <a href="http://wso2.org/projects/wsf/php">WSO2 WSF/PHP</a> in practice. <a href="http://labs.wso2.org/wsf/php/resource_view.php?url=Calendar">Calendar Service</a> is one of such application. It demonstrate the use of WSDL Mode for a service with different policies for different operations + the use of Username tokens.</p>
<p>You can view the source code of the Calendar Service from <a href="http://labs.wso2.org/wsf/php/source_page_frame.php?src=Calendar">here</a>.</p>
<p>The username token is provided as an arguments to the WSService constructor at the end of <a href="http://labs.wso2.org/wsf/php/source_page_old.php?src=solutions%2FCalendar%2FCalendarService.php&amp;aschild=1">the service script</a>.</p>
<pre class="php"><span style="font-style: italic; color: #808080;">// our security token</span>
<span style="color: #0000ff;">$security_token</span> = <span style="font-weight: bold; color: #000000;">new</span> WSSecurityToken<span style="color: #66cc66;">(</span><a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">(</span><span style="color: #ff0000;">"passwordCallback"</span> =&gt; <span style="color: #ff0000;">"get_password"</span>,
                                      <span style="color: #ff0000;">"passwordType"</span> =&gt; <span style="color: #ff0000;">"plain"</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;
<span style="font-style: italic; color: #808080;">// create service in WSDL mode</span>
<span style="color: #0000ff;">$service</span> = <span style="font-weight: bold; color: #000000;">new</span> WSService<span style="color: #66cc66;">(</span><a href="http://www.php.net/array"><span style="color: #000066;">array</span></a> <span style="color: #66cc66;">(</span><span style="color: #ff0000;">"wsdl"</span> =&gt;<span style="color: #ff0000;">"Calendar.wsdl"</span>,
        <span style="color: #ff0000;">"actions"</span> =&gt; <span style="color: #0000ff;">$actions</span>,
        <span style="color: #ff0000;">"classmap"</span> =&gt; <span style="color: #0000ff;">$class_map</span>,
        <span style="color: #ff0000;">"securityToken"</span> =&gt; <span style="color: #0000ff;">$security_token</span>,
        <span style="color: #ff0000;">"operations"</span> =&gt; <span style="color: #0000ff;">$operations</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;

<span style="font-style: italic; color: #808080;">// process client requests and reply </span>
<span style="color: #0000ff;">$service</span>-&gt;<span style="color: #006600;">reply</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;</pre>
<p>We use a callback function (&#8220;get_password&#8221;) to validate the user and give that function name to the securityToken object constructor. Inside that callback function, we retrieve the password for the user from a database call. Here is the code inside the callback function that is again extracted out from the <a href="http://labs.wso2.org/wsf/php/source_page_old.php?src=solutions%2FCalendar%2FCalendarService.php">calendar service</a>.</p>
<pre class="php"><span style="font-style: italic; color: #808080;">/**
 * call back function.
 * verify the validity of user enterd password with
 * the actual password which is kept in the database.
 */</span>
<span style="color: #0000ff;">$current_username</span> = <span style="color: #ff0000;">""</span>;
<span style="font-weight: bold; color: #000000;">function</span> get_password<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$username</span><span style="color: #66cc66;">)</span>
<span style="color: #66cc66;">{</span>

    <span style="color: #0000ff;">$dbhost</span> = DB_HOST;
    <span style="color: #0000ff;">$dbname</span> = DB_NAME;
    <span style="color: #0000ff;">$dbuname</span> = DB_USERNAME;
    <span style="color: #0000ff;">$dbpass</span> = DB_PASSWORD;
    <span style="color: #0000ff;">$link</span>=<a href="http://www.php.net/mysql_connect"><span style="color: #000066;">mysql_connect</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$dbhost</span>,  <span style="color: #0000ff;">$dbuname</span>,  <span style="color: #0000ff;">$dbpass</span><span style="color: #66cc66;">)</span>;
    <a href="http://www.php.net/mysql_select_db"><span style="color: #000066;">mysql_select_db</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$dbname</span>, <span style="color: #0000ff;">$link</span><span style="color: #66cc66;">)</span>;

    <span style="color: #0000ff;">$sql</span>=<span style="color: #ff0000;">"SELECT password FROM `customer_details` WHERE `user_name` = '"</span>.<span style="color: #0000ff;">$username</span>.<span style="color: #ff0000;">"'"</span>;
    <span style="color: #0000ff;">$result</span>=<a href="http://www.php.net/mysql_query"><span style="color: #000066;">mysql_query</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$sql</span>,<span style="color: #0000ff;">$link</span><span style="color: #66cc66;">)</span>;
    <span style="color: #0000ff;">$password</span>=<a href="http://www.php.net/mysql_fetch_array"><span style="color: #000066;">mysql_fetch_array</span></a><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$result</span>, MYSQL_NUM<span style="color: #66cc66;">)</span>;

    <a href="http://www.php.net/global"><span style="color: #000066;">global</span></a> <span style="color: #0000ff;">$current_username</span>;
    <span style="color: #b1b100;">if</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$password</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
         <span style="color: #0000ff;">$current_username</span> = <span style="color: #0000ff;">$username</span>;
         <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$password</span><span style="color: #66cc66;">[</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">]</span>;
    <span style="color: #66cc66;">}</span>
    <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">{</span>
         <span style="color: #0000ff;">$current_username</span> = <span style="color: #ff0000;">""</span>;
         <span style="color: #b1b100;">return</span> <span style="font-weight: bold; color: #000000;">NULL</span>;
    <span style="color: #66cc66;">}</span>
<span style="color: #66cc66;">}</span></pre>
<p>So for all the operations which require authentication like login, getEvents, deleteEvents and addEvent, the WSF/PHP engine validate the user before invoking the operation. If the authentication fails, the engine will send a SOAP fault with the fault details. But in this service there is a operation which doesn&#8217;t require authentication. That is the &#8216;register&#8217; operation. Because until the registration complete you can&#8217;t have a username password, so we should not authenticate that &#8216;register&#8217; operation. So we need to provide a different policy for the &#8216;register&#8217; operation.</p>
<p>The policies for each of the operation is declared in the <a href="http://labs.wso2.org/wsf/php/source_page_old.php?src=solutions%2FCalendar%2FCalendar.wsdl&amp;aschild=1">Calender.wsdl</a> itself.  If you look at the WSDL you can see each of the policies required by the operations are declared inside the policy elements as mentioned in WS-Policy Specification. And each of the operation refers the corresponding policy element from the binding section of the WSDL.</p>
<p>You can see how it is done for login (which requires authentication) and the register (which doesn&#8217;t requires authentication) from the code below.</p>
<pre class="xml">        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;wsdl:operation</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"login"</span><span style="font-weight: bold; color: black;">&gt;</span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;soap12:operation</span> <span style="color: #000066;">soapAction</span>=<span style="color: #ff0000;">"urn:login"</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">"document"</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;wsdl:input<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;wsp:PolicyReference</span> <span style="color: #000066;">URI</span>=<span style="color: #ff0000;">"#username_token_policy"</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;soap12:body</span> <span style="color: #000066;">use</span>=<span style="color: #ff0000;">"literal"</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/wsdl:input<span style="font-weight: bold; color: black;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;wsdl:output<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;soap12:body</span> <span style="color: #000066;">use</span>=<span style="color: #ff0000;">"literal"</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/wsdl:output<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/wsdl:operation<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;wsdl:operation</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"register"</span><span style="font-weight: bold; color: black;">&gt;</span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;soap12:operation</span> <span style="color: #000066;">soapAction</span>=<span style="color: #ff0000;">"urn:register"</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">"document"</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;wsdl:input<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;soap12:body</span> <span style="color: #000066;">use</span>=<span style="color: #ff0000;">"literal"</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/wsdl:input<span style="font-weight: bold; color: black;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;wsdl:output<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;soap12:body</span> <span style="color: #000066;">use</span>=<span style="color: #ff0000;">"literal"</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/wsdl:output<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/wsdl:operation<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dimuthu.org/blog/2008/10/16/demo-on-providing-php-web-service-with-username-token/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WSClient WSDL Mode With Array Based API</title>
		<link>http://www.dimuthu.org/blog/2008/10/08/wsclient-wsdl-mode-with-array-based-api/</link>
		<comments>http://www.dimuthu.org/blog/2008/10/08/wsclient-wsdl-mode-with-array-based-api/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 14:53:55 +0000</pubDate>
		<dc:creator>dimuthu</dc:creator>
				<category><![CDATA[Tutorial/Guide]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[WSDL]]></category>
		<category><![CDATA[wsf/php]]></category>
		<category><![CDATA[wso2]]></category>
		<category><![CDATA[xml schema]]></category>
		<category><![CDATA[array based]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[WSClient]]></category>
		<category><![CDATA[wsdl mode]]></category>

		<guid isPermaLink="false">http://www.dimuthu.org/?p=454</guid>
		<description><![CDATA[In WSF/PHP WDL Mode we have two APIs, first one is the class based API which we give a class object as the input parameter for the operation and expect to retrieve a class object as the response as well. The other API is the array based API. which we give an array (in fact [...]]]></description>
			<content:encoded><![CDATA[<p>In WSF/PHP WDL Mode we have two APIs, first one is the class based API which we give a class object as the input parameter for the operation and expect to retrieve a class object as the response as well. The other API is the array based API. which we give an array (in fact an associated map) containing all the necessary information and returns an array filled with response information.</p>
<p>If you are using WSDL2PHP script you are always using the class based API. But there are situations where you can easily use array based API instead of the class based API. Here is an example.</p>
<p>Take the simple add operation of the following WSDL, <a href="http://labs.wso2.org/wsf/php/example.xml">http://labs.wso2.org/wsf/php/example.xml</a>.</p>
<p>If you generated the code using <a href="http://labs.wso2.org/wsf/php/wsdl2phptool.php">wsdlphp tool</a> (<a href="http://labs.wso2.org/wsf/php/wsdl2phptool.php?wsdl_url=http%3A%2F%2Flabs.wso2.org%2Fwsf%2Fphp%2Fexample.xml">Here</a> is the complete generated code for the above wsdl using online wsdlphp tool) You can see two classes are generated for the above operation, one for the input object and the other for the output object.</p>
<pre class="php"><span style="font-weight: bold; color: #000000;">class</span> simpleAdd <span style="color: #66cc66;">{</span>

    <span style="font-style: italic; color: #808080;">/**
     * @var int
     */</span>
    <span style="font-weight: bold; color: #000000;">public</span> <span style="color: #0000ff;">$param0</span>;

    <span style="font-style: italic; color: #808080;">/**
     * @var int
     */</span>
    <span style="font-weight: bold; color: #000000;">public</span> <span style="color: #0000ff;">$param1</span>;

<span style="color: #66cc66;">}</span>

<span style="font-weight: bold; color: #000000;">class</span> simpleAddResponse <span style="color: #66cc66;">{</span>

    <span style="font-style: italic; color: #808080;">/**
     * @var int
     */</span>
    <span style="font-weight: bold; color: #000000;">public</span> <span style="color: #0000ff;">$return</span>;

<span style="color: #66cc66;">}</span></pre>
<p>So in order to invoke the service you need to create an object of the simpleAdd and set your input parameters and return the value from the simpleAddResponse object.</p>
<pre class="php">  <span style="color: #0000ff;">$input</span> = <span style="font-weight: bold; color: #000000;">new</span> simpleAdd<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;

  <span style="color: #0000ff;">$input</span>-&gt;<span style="color: #006600;">param0</span> = <span style="color: #cc66cc;">3</span>;
  <span style="color: #0000ff;">$input</span>-&gt;<span style="color: #006600;">parma1</span> = <span style="color: #cc66cc;">4</span>;

  <span style="font-style: italic; color: #808080;">// call the operation</span>
  <span style="color: #0000ff;">$response</span> = <span style="color: #0000ff;">$proxy</span>-&gt;<span style="color: #006600;">simpleAdd</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$input</span><span style="color: #66cc66;">)</span>;

<span style="font-style: italic; color: #808080;">  // extract the return value</span>
  <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$response</span>-&gt;<span style="color: #006600;">return</span>;</pre>
<p>But if you are using array mode for the same operation it will be something like this.</p>
<pre class="php">  <span style="font-style: italic; color: #808080;">// input as an array</span>
  <span style="color: #0000ff;">$input</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">(</span><span style="color: #ff0000;">"param0"</span> =&gt; <span style="color: #cc66cc;">3</span>, <span style="color: #ff0000;">"param1"</span> =&gt; <span style="color: #cc66cc;">4</span><span style="color: #66cc66;">)</span>;

  <span style="font-style: italic; color: #808080;">// call the operation</span>
  <span style="color: #0000ff;">$response</span> = <span style="color: #0000ff;">$proxy</span>-&gt;<span style="color: #006600;">simpleAdd</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$input</span><span style="color: #66cc66;">)</span>;

  <span style="font-style: italic; color: #808080;">// extract out the return value from the array</span>
  <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$response</span><span style="color: #66cc66;">[</span><span style="color: #ff0000;">"return"</span><span style="color: #66cc66;">]</span>;</pre>
<p>In this approach you don&#8217;t need to declare classes at the start. So you can write the code without the support of WSDL2PHP tool. Anyway for complex scenarios it is not easy to find the keys needed to be in the input array, so it is better depend on the generated code. But you can use array based approach more productively for simple scenarios like this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dimuthu.org/blog/2008/10/08/wsclient-wsdl-mode-with-array-based-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WSO2 Web Services Framework for Ruby (WSF/Ruby) 1.1.0 Released</title>
		<link>http://www.dimuthu.org/blog/2008/07/24/wso2-web-services-framework-for-ruby-wsfruby-110-released/</link>
		<comments>http://www.dimuthu.org/blog/2008/07/24/wso2-web-services-framework-for-ruby-wsfruby-110-released/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 04:06:00 +0000</pubDate>
		<dc:creator>dimuthu</dc:creator>
				<category><![CDATA[web services]]></category>
		<category><![CDATA[wsf/ruby]]></category>
		<category><![CDATA[wso2]]></category>
		<category><![CDATA[1.1.0]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[wsdl mode]]></category>
		<category><![CDATA[wsf]]></category>

		<guid isPermaLink="false">http://www.dimuthu.org/?p=22</guid>
		<description><![CDATA[WSO2 WSF/Ruby is back in a release, after more than 6 months. We released the WSF/Ruby 1.0.0 in this January (with the start of the year work) with a number of features that someone may expect in a WS-* stack. For Ruby space there were no such thing support that many number of WS-* specs, [...]]]></description>
			<content:encoded><![CDATA[<p>WSO2 WSF/Ruby is back in a release, after more than 6 months. We released the WSF/Ruby 1.0.0 in this January (with the start of the year work) with a number of features that someone may expect in a WS-* stack. For Ruby space there were no such thing support that many number of WS-* specs, specially implementation for WS-Security, WS-SecurityPoilcy, MTOM were really new for ruby developers.</p>
<p>For this release (1.1.0), we mainly worked for improving the usability aspects of the WSF/Ruby. The result is the WSDL mode for both client and the server, and more importantly with this you can specify WS-Addressing and WS-SecurityPolicy assertions through a WSDL.</p>
<p>Here is the complete release note. Hope you ruby people try this out, enjoy and more importantly give us some valuable feedback..</p>
<p>WSO2 Web Services Framework For Ruby (WSF/Ruby) &#8211; 1.1.0 Released<br />
=============================================</p>
<p>WSO2 WSF/Ruby team is pleased to announce the release of WSO2 WSF/Ruby 1.1.0.</p>
<p>WSF/Ruby is the Ruby language extension to WSO2 WSF/C. This enables you to consume/provide Web Services both with REST and with the power of WS-* stack including WS-Reliable Messaging, WS-Security, WS-Addressing and MTOM Attachments.</p>
<p>For more information, please visit our project home page, <a class="moz-txt-link-freetext" href="http://wso2.org/projects/wsf/ruby">http://wso2.org/projects/wsf/ruby</a></p>
<p>You can download this release from: <a class="moz-txt-link-freetext" href="http://wso2.org/downloads/wsf/ruby">http://wso2.org/downloads/wsf/ruby</a></p>
<p>Key Features<br />
============<br />
1. Client API to consume Web services</p>
<p>* WSMessage class to handle message level options<br />
* WSClient class with both one way and two way service invocation support</p>
<p>2. Service API to provide Web services</p>
<p>* WSMessage class to handle message level options<br />
* WSService class with support for both one way and two way operations</p>
<p>3. Attachments with MTOM</p>
<p>* Binary optimized<br />
* Non-optimized (Base64 encoded)</p>
<p>4. WS-Addressing</p>
<p>* Version 1.0<br />
* Submission</p>
<p>5. WS-Security<br />
* UsernameToken and Timestamp<br />
* Encryption<br />
* Signing<br />
* WS-SecurityPolicy based configuration</p>
<p>6. WS-Reliable Messaging<br />
* Single channel two way reliable messaging</p>
<p>7. WSDL mode support for both client and server side<br />
* WS-Addressing and WS-SecurityPolicy is supported in WSDL mode</p>
<p>8. REST Support<br />
* Expose a single service script both as SOAP and REST service</p>
<p>Major Changes Since Last Release<br />
================================<br />
o WSDL mode support for both client and server side<br />
* WS-Addressing and WS-SecurityPolicy is supported in WSDL mode</p>
<p>Dependencies<br />
============<br />
1. The provider implementation uses Rails framework as the deployment model. Therefore in order to use provider implementation, you should have Rails installed on your machine. Please visit <a class="moz-txt-link-freetext" href="http://www.rubyonrails.org/">http://www.rubyonrails.org/</a> to find out more about RoR(Ruby on Rails).</p>
<p>Reporting Problems<br />
==================<br />
Issues can be reported using the public JIRA available at: <a class="moz-txt-link-freetext" href="https://wso2.org/jira/browse/WSFRUBY">https://wso2.org/jira/browse/WSFRUBY</a></p>
<p>Contact Us<br />
==========<br />
Please subscribe to our user or developer mailing lists. For details on how to subscribe please visit: <a class="moz-txt-link-freetext" href="http://wso2.org/mail#wsfruby">http://wso2.org/mail#wsfruby</a></p>
<p>Thank you for your interest in WSO2 WSF/Ruby.</p>
<p>- WSO2 WSF/Ruby Team</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dimuthu.org/blog/2008/07/24/wso2-web-services-framework-for-ruby-wsfruby-110-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

