<?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>dotvoid.com &#187; wsdl</title>
	<atom:link href="http://www.dotvoid.com/tag/wsdl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotvoid.com</link>
	<description>Experiments and thoughts in PHP and javascript</description>
	<lastBuildDate>Tue, 11 Oct 2011 12:49:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP, SOAP and operation signatures</title>
		<link>http://www.dotvoid.com/2009/12/php-soap-and-operation-signatures/</link>
		<comments>http://www.dotvoid.com/2009/12/php-soap-and-operation-signatures/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 09:22:50 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[wsdl]]></category>

		<guid isPermaLink="false">http://www.dotvoid.com/?p=407</guid>
		<description><![CDATA[After investigating SOAP further there seems to be a common confusion regarding the difference between rpc/literal and document/literal and how it is handled in PHP. There is even a bug 49169 reported because PHP ext/soap maps all operations defined in the web service with the same signature to the first defined function or method in [...]]]></description>
			<content:encoded><![CDATA[<p>After investigating SOAP further there seems to be a common confusion regarding the difference between rpc/literal and document/literal and how it is handled in PHP. There is even a <a href="http://bugs.php.net/49169">bug 49169</a> reported because PHP ext/soap maps all operations defined in the web service with the same signature to the first defined function or method in PHP when using document/literal style.</p>
<p>It is not a bug. The style document/literal is for sending messages with document data. It is not a remote procedure call. For that we have rpc/literal. So if you look at it that way it is completely understandable that only one method should be around to handle one specific type of message (document).</p>
<p>It is also completely correct behaviour according to the <a href="http://www.ws-i.org/Profiles/BasicProfile-1.1.html#Operation_Signatures">specification WS-I Basic Profile</a>.</p>
<p><em>&#8220;In the case of rpc-literal binding, the operation name is used as a wrapper for the part accessors. In the  					document-literal case, since a wrapper with the operation name is not present, the message signatures must be  					correctly designed so that they meet this requirement.</em><em>&#8220;</em></p>
<p>As document/literal is the preferred style, and some implementations obviously have a tendency to dislike rpc/literal, a lot of people is going down the document/literal route without understanding the implications and what the real difference really is.</p>
<p>I don&#8217;t think this should stop ext/soap in PHP to use the soapAction header for routing when necessary. According to WSDL 1.1 the <a href="http://www.w3.org/TR/wsdl#_soap:operation">soapAction attribute is mandatory</a> when HTTP protocol binding is used. Whether rpc/literal or dcoument/literal style is used is of no difference. So is this information just garbage for document style messages?</p>
<p>Anyways, PHP bug 46169 is to my understanding not really a bug. But it is a reasonable feature request.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2009/12/php-soap-and-operation-signatures/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2009/12/php-soap-and-operation-signatures/&amp;title=PHP%2C+SOAP+and+operation+signatures" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2009/12/php-soap-and-operation-signatures/&amp;t=PHP%2C+SOAP+and+operation+signatures" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2009/12/php-soap-and-operation-signatures/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2009/12/php-soap-and-operation-signatures/&amp;title=PHP%2C+SOAP+and+operation+signatures&amp;summary=After%20investigating%20SOAP%20further%20there%20seems%20to%20be%20a%20common%20confusion%20regarding%20the%20difference%20between%20rpc%2Fliteral%20and%20document%2Fliteral%20and%20how%20it%20is%20handled%20in%20PHP.%20There%20is%20even%20a%20bug%2049169%20reported%20because%20PHP%20ext%2Fsoap%20maps%20all%20operations%20defined%20in%20the%20web%20service%20with%20the%20same%20signature%20to%20the%20&amp;source=dotvoid.com" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2009/12/php-soap-and-operation-signatures/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2009/12/php-soap-and-operation-signatures/&amp;title=PHP%2C+SOAP+and+operation+signatures" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=PHP%2C+SOAP+and+operation+signatures+-+http://b2l.me/wt44d&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2009/12/php-soap-and-operation-signatures/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SOAP structures in PHP</title>
		<link>http://www.dotvoid.com/2008/10/soap-structures-in-php/</link>
		<comments>http://www.dotvoid.com/2008/10/soap-structures-in-php/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 12:29:39 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[wsdl]]></category>

		<guid isPermaLink="false">http://www.dotvoid.com/?p=319</guid>
		<description><![CDATA[Handling SOAP structures in PHP can sometimes be really annoying. If an interface is defined in the WSDL as returning an array I can&#8217;t be sure that I will get an array. If there is only one element in the array PHP tries to be clever and turn the wanted array into an object which, [...]]]></description>
			<content:encoded><![CDATA[<p>Handling SOAP structures in PHP can sometimes be really annoying. If an interface is defined in the WSDL as returning an array I can&#8217;t be sure that I will get an array. If there is only one element in the array PHP tries to be clever and turn the wanted array into an object which, too me, isn&#8217;t really smart. I don&#8217;t know if this is a problem/limitation on the client side, server side or if it is just me doing something stupid in the wsdl.</p>
<p>As an example I have the below complex types, message and operation defined in the WSDL file. (The example is not complete of course.)</p>
<pre>    &lt;complexType name="KeyValueData"&gt;
      &lt;sequence&gt;
        &lt;element minOccurs="1" maxOccurs="1" name="id" type="string"/&gt;
        &lt;element minOccurs="1" maxOccurs="1" name="name" type="string"/&gt;
        &lt;element minOccurs="1" maxOccurs="1" name="data" type="string"/&gt;
      &lt;/sequence&gt;
    &lt;/complexType&gt;

    &lt;complexType name="ArrayOfKeyValueData"&gt;
      &lt;sequence&gt;
        &lt;element minOccurs="0" maxOccurs="unbounded"
                 name="keyval" type="tns:KeyValueData"/&gt;
      &lt;/sequence&gt;
    &lt;/complexType&gt;
      ...
    &lt;message name="StatisticsListOutput"&gt;
      &lt;part name="data" element="tns:ArrayOfKeyValueData"/&gt;
    &lt;/message&gt;
      ...
    &lt;operation name="getStatistics"&gt;
      &lt;input message="tns:StatisticsListInput"/&gt;
      &lt;output message="tns:StatisticsListOutput"/&gt;
    &lt;/operation&gt;</pre>
<p>Sending this from the client is an absolute no brainer. It is a simple array containg associative arrays in every slot. When receiving this structure on the client side the original array (the member variable <em>Map</em> in the example) <strong>with one element</strong> turns into</p>
<pre id="line1">Class Object
(
    <strong>[Map] =&gt; stdClass Object</strong>
        (
            [item] =&gt; Array
                (
                    [0] =&gt; stdClass Object
                        (
                            [key] =&gt; id
                            [value] =&gt; value
                        )

                    [1] =&gt; stdClass Object
                        (
                            [key] =&gt; name
                            [value] =&gt; value
                        )</pre>
<p>where an array with <strong>multiple elements</strong> turn into</p>
<pre id="line1">stdClass Object
(
    <strong>[Map] =&gt; Array</strong>
        (
            [0] =&gt; stdClass Object
                (
                    [item] =&gt; Array
                        (
                            [0] =&gt; stdClass Object
                                (
                                    [key] =&gt; id
                                    [value] =&gt; value
                                )

                            [1] =&gt; stdClass Object
                                (
                                    [key] =&gt; name
                                    [value] =&gt; value
                                )</pre>
<p>This is annoying. Just imagine the situation when you have multiple arrays in arrays&#8230; Which actually does happen every once in a while when sending compounds of various elements declared as ComplexTypes in the WSDL.</p>
<p>Is it a feature, quirk or anti social behaviour? I don&#8217;t know. If there is another way I&#8217;d like to hear about it.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2008/10/soap-structures-in-php/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2008/10/soap-structures-in-php/&amp;title=SOAP+structures+in+PHP" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2008/10/soap-structures-in-php/&amp;t=SOAP+structures+in+PHP" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2008/10/soap-structures-in-php/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2008/10/soap-structures-in-php/&amp;title=SOAP+structures+in+PHP&amp;summary=Handling%20SOAP%20structures%20in%20PHP%20can%20sometimes%20be%20really%20annoying.%20If%20an%20interface%20is%20defined%20in%20the%20WSDL%20as%20returning%20an%20array%20I%20can%27t%20be%20sure%20that%20I%20will%20get%20an%20array.%20If%20there%20is%20only%20one%20element%20in%20the%20array%20PHP%20tries%20to%20be%20clever%20and%20turn%20the%20wanted%20array%20into%20an%20object%20which%2C%20too%20me%2C%20isn%27t%20real&amp;source=dotvoid.com" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2008/10/soap-structures-in-php/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2008/10/soap-structures-in-php/&amp;title=SOAP+structures+in+PHP" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=SOAP+structures+in+PHP+-+http://b2l.me/wtwts&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2008/10/soap-structures-in-php/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

