diff options
| author | Dmitry Stogov <dmitry@php.net> | 2004-11-16 12:07:32 +0000 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@php.net> | 2004-11-16 12:07:32 +0000 |
| commit | a9a5dbd9b8bfe68fe4306145023d16d38224ea85 (patch) | |
| tree | 19e526384210a49b7488090d73b375b251ecd009 /ext/soap/tests/classmap001.phpt | |
| parent | ccc7c3b48e9394c18f1cef663dd2310ff094cd67 (diff) | |
| download | php-git-a9a5dbd9b8bfe68fe4306145023d16d38224ea85.tar.gz | |
Class mapping was implemented (Bug #29385 Soapserver always uses std class).
Diffstat (limited to 'ext/soap/tests/classmap001.phpt')
| -rw-r--r-- | ext/soap/tests/classmap001.phpt | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/ext/soap/tests/classmap001.phpt b/ext/soap/tests/classmap001.phpt new file mode 100644 index 0000000000..0bda1674b6 --- /dev/null +++ b/ext/soap/tests/classmap001.phpt @@ -0,0 +1,50 @@ +--TEST-- +SOAP Classmap 1: SoapServer support for classmap +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +$GLOBALS['HTTP_RAW_POST_DATA']=" +<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\" + xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" + xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" + xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\" + xmlns:ns1=\"http://schemas.nothing.com\" +> + <env:Body> + <dotest> + <book xsi:type=\"ns1:book\"> + <a xsi:type=\"xsd:string\">Blaat</a> + <b xsi:type=\"xsd:string\">aap</b> +</book> +</dotest> + </env:Body> +<env:Header/> +</env:Envelope>"; + +class test{ + function dotest(book $book){ + $classname=get_class($book); + return "Classname: ".$classname; + } +} + +class book{ + public $a="a"; + public $b="c"; + +} +$options=Array( + 'actor' =>'http://schema.nothing.com', + 'classmap' => array('book'=>'book', 'wsdltype2'=>'classname2') + ); + +$server = new SoapServer(dirname(__FILE__)."/classmap.wsdl",$options); +$server->setClass("test"); +$server->handle(); +echo "ok\n"; +?> +--EXPECT-- +<?xml version="1.0" encoding="UTF-8"?> +<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nabek.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:dotestResponse><res xsi:type="xsd:string">Classname: book</res></ns1:dotestResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> +ok |
