Our source is open
The syntax highlighted source is automatically generated by PHP from
the plaintext script.
If you're interested in what's behind the several functions we
used, you can always take a look at the source of the following files:
Of course, if you want to see the source
of this page, we have it available.
You can also browse the SVN repository for this website on
svn.php.net.
Source of: /manual/en/soapclient.setlocation.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.soapclient.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'soapclient.setlocation.php',
1 => 'SoapClient::__setLocation',
),
'up' =>
array (
0 => 'class.soapclient.php',
1 => 'The SoapClient class',
),
'prev' =>
array (
0 => 'soapclient.setcookie.php',
1 => 'SoapClient::__setCookie',
),
'next' =>
array (
0 => 'soapclient.setsoapheaders.php',
1 => 'SoapClient::__setSoapHeaders',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="soapclient.setlocation" class="refentry">
<div class="refnamediv">
<h1 class="refname">SoapClient::__setLocation</h1>
<p class="verinfo">(PHP 5 >= 5.0.1)</p><p class="refpurpose"><span class="refname">SoapClient::__setLocation</span> — <span class="dc-title">Sets the location of the Web service to use.</span></p>
</div>
<a name="soapclient.setlocation.description"></a><div class="refsect1 description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="modifier">public</span> <span class="type">string</span> <span class="methodname"><b>SoapClient::__setLocation</b></span>
([ <span class="methodparam"><span class="type">string</span> <tt class="parameter">$new_location</tt></span>
] )</div>
<p class="para rdfs-comment">
Sets the endpoint URL that will be touched by following SOAP requests. This is equivalent to
specifying the <i>location</i> option when constructing the SoapClient.
</p>
<blockquote><p><b class="note">Note</b>:
Calling this method is optional. The SoapClient uses the endpoint from
the WSDL file by default.
<br />
</p></blockquote>
</div>
<a name="soapclient.setlocation.parameters"></a><div class="refsect1 parameters">
<h3 class="title">Parameters</h3>
<p class="para">
</p><dl>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">new_location</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
The new endpoint URL.
</p>
</dd>
</dl>
<p>
</p>
</div>
<a name="soapclient.setlocation.returnvalues"></a><div class="refsect1 returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
The old endpoint URL.
</p>
</div>
<a name="soapclient.setlocation.examples"></a><div class="refsect1 examples">
<h3 class="title">Examples</h3>
<p class="para">
</p><div class="example">
<p><b>Example #1 <b>SoapClient::__setLocation()</b> example</b></p>
<div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB"><?php<br />$client </span><span style="color: #007700">= new </span><span style="color: #0000BB">SoapClient</span><span style="color: #007700">(</span><span style="color: #DD0000">'http://example.com/webservice.php?wsdl'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$client</span><span style="color: #007700">-></span><span style="color: #0000BB">__setLocation</span><span style="color: #007700">(</span><span style="color: #DD0000">'http://www.somethirdparty.com'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$old_location </span><span style="color: #007700">= </span><span style="color: #0000BB">$client</span><span style="color: #007700">-></span><span style="color: #0000BB">__setLocation</span><span style="color: #007700">(); </span><span style="color: #FF8000">// unsets the location option<br /><br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">$old_location</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">?></span>
</span>
</code></div>
</div>
<div class="example-contents para"><p>The above example will output
something similar to:</p></div>
<div class="example-contents screen">
<div class="cdata"><pre>
http://www.somethirdparty.com
</pre></div>
</div>
</div><p>
</p>
</div>
<a name="soapclient.setlocation.seealso"></a><div class="refsect1 seealso">
<h3 class="title">See Also</h3>
<p class="para">
</p><ul class="simplelist">
<li class="member"> <span class="methodname"><a href="soapclient.soapclient.php" class="function" rel="rdfs-seeAlso">SoapClient::SoapClient</a> - SoapClient constructor</span></li>
</ul><p>
</p>
</div>
</div><?php manual_footer(); ?>