Skip to content

Commit

Permalink
Deprecate SOAP_Base's __set_type_translation() method in favour of se…
Browse files Browse the repository at this point in the history
…tTypeTranslation().

git-svn-id: http://svn.php.net/repository/pear/packages/SOAP/trunk@227858 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
Jan Schneider committed Jan 22, 2007
1 parent e6ffd96 commit 2f05d7a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 13 deletions.
17 changes: 17 additions & 0 deletions Base.php
Expand Up @@ -1180,7 +1180,24 @@ function _decodeDIMEMessage(&$data, &$headers, &$attachments)
}
}

/**
* @deprecated Use setTypeTranslation().
*/
function __set_type_translation($type, $class = null)
{
$this->setTypeTranslation($type, $class);
}

/**
* Explicitly sets the translation for a specific class.
*
* Auto translation works for all cases, but opens ANY class in the script
* to be used as a data type, and may not be desireable.
*
* @param string $type A SOAP type.
* @param string $class A PHP class name.
*/
function setTypeTranslation($type, $class = null)
{
$tq =& new QName($type);
if (!$class) {
Expand Down
4 changes: 2 additions & 2 deletions example/client.php
Expand Up @@ -77,8 +77,8 @@
* class. auto_translation works for all cases, but opens ANY class in the
* script to be used as a data type, and may not be desireable. Both can be
* used on client or server. */
$soapclient->__set_type_translation('{http://soapinterop.org/xsd}SOAPStruct',
'SOAPStruct');
$soapclient->setTypeTranslation('{http://soapinterop.org/xsd}SOAPStruct',
'SOAPStruct');
$ret = $soapclient->call('echoStruct',
$p = array('inputStruct' => $struct->__to_soap()),
$options);
Expand Down
22 changes: 11 additions & 11 deletions example/wsdl_client.php
Expand Up @@ -54,22 +54,22 @@

$struct = new SOAPStruct('test string',123,123.123);

/* send an object, get an object back */
/* tell client to translate to classes we provide if possible */
/* Send an object, get an object back.
* Tell the client to translate to classes we provide if possible. */
$soapclient->_auto_translation = true;
/* or you can explicitly set the translation for
a specific class. auto_translation works for all cases,
but opens ANY class in the script to be used as a data type,
and may not be desireable. both can be used on client or
server */
$soapclient->__set_type_translation('{http://soapinterop.org/xsd}SOAPStruct','SOAPStruct');
/* Or you can explicitly set the translation for a specific class.
* auto_translation works for all cases, but opens ANY class in the script to
* be used as a data type, and may not be desireable. both can be used on
* client or server. */
$soapclient->setTypeTranslation('{http://soapinterop.org/xsd}SOAPStruct',
'SOAPStruct');
$ret = $soapclient->echoStruct($struct->__to_soap());
#print $soapclient->__get_wire();
//print $soapclient->__get_wire();
print_r($ret);

/**
* PHP doesn't support multiple OUT parameters in function calls, so we
* must do a little work to make it happen here. This requires knowledge on the
* PHP doesn't support multiple OUT parameters in function calls, so we must
* do a little work to make it happen here. This requires knowledge on the
* developers part to figure out how they want to deal with it.
*/
$ret = $soapclient->echoStructAsSimpleTypes($struct->__to_soap());
Expand Down
1 change: 1 addition & 0 deletions package.xml
Expand Up @@ -48,6 +48,7 @@
* Replace all invalid characters in label and variable name of the generated proxy code. (Bug 7493).
* Add setDefaultNamespace() (Request #5622).
* Make sure that generated proxy code doesn't use method or class names that are reserved words in PHP (Bug 3048).
* Deprecate SOAP_Base's __set_type_translation() method in favour of setTypeTranslation().
* Deprecate SOAP_WSDL's set_service() method in favour of setService().
* Remove deprecated parse() method from SOAP_WSDL.
* Fix subsequent failures if one transmission with a Transport class instance failed (Bug 7469).
Expand Down

0 comments on commit 2f05d7a

Please sign in to comment.