SOAP SoapServer::__construct
(PHP 5, PHP 7, PHP 8)
SoapServer::__construct — SoapServer constructor
설명
public SoapServer::__construct(?string $wsdl
, array $options
= [])
이 생성자를 사용하면 WSDL 또는 비 WSDL 모드에서 SoapServer 개체를 만들 수 있습니다.
매개변수
wsdl
- WSDL 모드에서 SoapServer를 사용하려면 WSDL 파일의 URI를 전달하십시오. 그렇지 않으면
null
을 전달하고uri
옵션을 서버의 대상 네임스페이스로 설정합니다. options
- 기본 SOAP 버전(
soap_version
), 내부 문자 인코딩(encoding
) 및 액터 URI(actor
) 설정을 허용합니다.classmap
옵션을 사용하여 일부 WSDL 유형을 PHP 클래스에 매핑할 수 있습니다. 이 옵션은 WSDL 유형을 키로, PHP 클래스 이름을 값으로 갖는 배열이어야 합니다.typemap
옵션은 유형 매핑의 배열입니다. 유형 매핑은type_name
,type_ns
(네임스페이스 URI),from_xml
(하나의 문자열 매개변수를 수락하는 콜백) 및to_xml
(하나의 개체 매개변수를 수락하는 콜백) 키가 있는 배열입니다.cache_wsdl
옵션은WSDL_CACHE_NONE
,WSDL_CACHE_DISK
,WSDL_CACHE_MEMORY
또는WSDL_CACHE_BOTH
중 하나입니다.SOAP_WAIT_ONE_WAY_CALLS
,SOAP_SINGLE_ELEMENT_ARRAYS
,SOAP_USE_XSI_ARRAY_TYPE
으로 설정할 수 있는features
옵션도 있습니다.send_errors
옵션을false
로 설정하면 달리 전송되는 특정 오류 메시지 대신 일반 오류 메시지("내부 오류")를 전송할 수 있습니다.
Examples
예제 #1 SoapServer::__construct() 예제
<?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")));
?>
기타
- SoapClient::__construct() - SoapClient constructor