mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-24 07:02:09 +01:00
* inclusão dos arquivos originais com revisão atualizada * Tradução em reference/soap/soapserver * ajuste de fechamento de tag
143 lines
4.6 KiB
XML
143 lines
4.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: fe4e8b87d18f17394e7177917c498774b062448c Maintainer: fernandowobeto Status: ready --><!-- CREDITS: fernandowobeto -->
|
|
<refentry xml:id="soapserver.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>SoapServer::__construct</refname>
|
|
<refpurpose>Construtor SoapServer</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<constructorsynopsis role="SoapServer">
|
|
<modifier>public</modifier> <methodname>SoapServer::__construct</methodname>
|
|
<methodparam><type class="union"><type>string</type><type>null</type></type><parameter>wsdl</parameter></methodparam>
|
|
<methodparam choice="opt"><type>array</type><parameter>options</parameter><initializer>[]</initializer></methodparam>
|
|
</constructorsynopsis>
|
|
<para>
|
|
Este construtor permite a criação de objetos <classname>SoapServer</classname>
|
|
no modo WSDL ou não WSDL.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>wsdl</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Para utilizar o SoapServer em modo WSDL, passe o URI de um arquivo WSDL.
|
|
Caso contrário, passe &null; e defina a opção <literal>uri</literal> como
|
|
namespace de destino para o servidor.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>options</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Permite definir uma versão SOAP padrão (<literal>soap_version</literal>),
|
|
codificação interna de caracteres (<literal>encoding</literal>),
|
|
e URI do ator (<literal>actor</literal>).
|
|
</para>
|
|
<para>
|
|
A opção <literal>classmap</literal> pode ser usada para mapear alguns tipos WSDL
|
|
para classes PHP. Esta opção deve ser um array com tipos WSDL
|
|
como chaves e nomes de classes PHP como valores.
|
|
</para>
|
|
<para>
|
|
A opção <literal>typemap</literal> é um array de mapeamentos de tipos.
|
|
O mapeamento de tipo é um array com chaves <literal>type_name</literal>,
|
|
<literal>type_ns</literal> (URI do namespace), <literal>from_xml</literal>
|
|
(retorno de chamada aceitando um parâmetro de string) e <literal>to_xml</literal>
|
|
(retorno de chamada aceitando um parâmetro de objeto).
|
|
</para>
|
|
<para>
|
|
A opção <literal>cache_wsdl</literal> é uma das
|
|
<constant>WSDL_CACHE_NONE</constant>,
|
|
<constant>WSDL_CACHE_DISK</constant>,
|
|
<constant>WSDL_CACHE_MEMORY</constant> ou
|
|
<constant>WSDL_CACHE_BOTH</constant>.
|
|
</para>
|
|
<para>
|
|
Há também uma opção <literal>features</literal> que pode ser definida como
|
|
<constant>SOAP_WAIT_ONE_WAY_CALLS</constant>,
|
|
<constant>SOAP_SINGLE_ELEMENT_ARRAYS</constant>,
|
|
<constant>SOAP_USE_XSI_ARRAY_TYPE</constant>.
|
|
</para>
|
|
<para>
|
|
A opção <literal>send_errors</literal> pode ser definida como &false; enviar uma
|
|
mensagem de erro genérica ("Erro interno") em vez da mensagem de erro específica
|
|
enviada de outra forma.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemplo de <function>SoapServer::__construct</function></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>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><methodname>SoapClient::__construct</methodname></member>
|
|
</simplelist>
|
|
</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:"~/.phpdoc/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
|
|
-->
|