Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You are having that "not nice" representation of an object because you are returning the object serialized(Serialization is converting the object and its state to a string representation). If you want to have an xml representation of the returned object you should change your function's return parameter type to an object. Because now is returning a string.</p> <p>I would recommend you to use the Zend_Soap_Server and Zend_Soap_Autodiscover components of the zend framework.</p> <p>With Zend_Soap_Autodiscover you can generate your web service definition (wsdl) dynamically , just by writing the docblocks of your functions. And Zend_Soap_Server is pretty cool too.</p> <p>If you use those components and document your types and your function to return an specific type without serializing it, then you are going to receive the xml represention according to the wsdl definition. Also each type you create is automatically converted by Zend_Soap_Autodiscover to a ComplexType in the wsdl generated.</p> <p>Sample:</p> <pre><code> public class Person{ public $id; public $name; } public class MyService { /** * * @param integer $UserID * @return Person */ function mi102($UserID) { $output = new Person(); $output-&gt;id = 2; $output-&gt;name = 'Peter'; return $output; } } // Generate WSDL relevant to code if (isset($_GET['wsdl'])){ $autodiscover = new Zend_Soap_AutoDiscover(); $autodiscover-&gt;setClass('MyService'); $autodiscover-&gt;handle(); } else { $server = new Zend_Soap_Server($serviceURL . "?wsdl"); $server-&gt;setClass('MyService'); $server-&gt;setObject(new MyService()); $server-&gt;handle(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload