<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.3 $ -->
<refentry id="function.soap-soapserver-construct">
 <refnamediv>
  <refname>SoapServer->__construct()</refname>
  <refpurpose>
   SoapServer constructor
  </refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <classsynopsis>
   <ooclass><classname>SoapServer</classname></ooclass>
   <constructorsynopsis>
    <methodname>__construct</methodname>
    <methodparam><type>mixed</type><parameter>wsdl</parameter></methodparam>
    <methodparam choice="opt"><type>array</type><parameter>options</parameter></methodparam>
   </constructorsynopsis>
  </classsynopsis>
  <para>
   This constructor allows the creation of <classname>SoapServer</classname>
   objects in WSDL or non-WSDL mode.
  </para>
 </refsect1>
 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>wsdl</parameter></term>
     <listitem>
      <para>
       If you want the WSDL mode, you must set this to the URI of a WSDL file.
       In the other case, you must set this to &null; and set the <literal>uri</literal>
       option.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>options</parameter></term>
     <listitem>
      <para>
       Allow setting a default SOAP version (<literal>soap_version</literal>),
       internal character encoding (<literal>encoding</literal>),
       and actor URI (<literal>actor</literal>).
       The <literal>classmap</literal> option can be used to map some WSDL 
       types to PHP classes. This option must be an array with WSDL types 
       as keys and names of PHP classes as values.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>
 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title>Some examples</title>
    <programlisting role="php">
<![CDATA[
<?php

$server = new SoapServer("some.wsdl");

$server = new SoapServer("some.wsdl", array('soap_version' => SOAP_1_2));

$server = new SoapServer("some.wsdl", array('actor' => "http://example.org/ts-tests/C"));

$server = new SoapServer("some.wsdl", array('encoding'=>'ISO-8859-1'));

$server = new SoapServer(null, array('uri' => "http://test-uri/"));

class MyBook {
    public $title;
    public $author;
}

$server = new SoapServer("books.wsdl", array('classmap' => array('book' => "MyBook")));

?>
]]>
    </programlisting>
   </example>
  </para>
 </refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->