Zend_Soap issue, being forced to use xsd:anyType

General discussion forum for the Zend Server

Zend_Soap issue, being forced to use xsd:anyType

Postby asimsid on Mon Jan 28, 2013 9:51 am

Hi,

I'm using Zend Server CE's Zend_SOAP features.

I have a question, why does my Zend Autodiscovery always map by input variable as xsd:anyType and return as xsd:string?

To give you guys some sample of my coding (dataServe.php):

Code: Select all
        public function getCompany($P_KEY)
        {
         require_once('Zend/Db.php');
      
         $db = Zend_Db::Factory('Pdo_Oci', array(
            'host'       => '111.111.111.111',
            'username'   => 'user',
            'password'   => 'pass',
            'dbname'     => 'ssss'
            ));

         $query = "select company_name cname from companies where ckey = '" . $P_KEY . "'";

         $res = $db->fetchAll($query);
         $v_comp = $res[0]['CNAME'];
         //return 10;
         return "There is a TezExch Company called: " . $v_comp;
          }


I tried setting the return as 10 just to see if the ?wsdl will return something else.

This is what the /service.php?wsdl returns for this function:

Code: Select all
<message name="getCompanyIn">
<part name="P_KEY" type="xsd:anyType"/>
</message>
<message name="getCompanyOut">
[b]<part name="return" type="xsd:string"/>[/b]
</message>


if you notice its anyType and String. This is my precise problem - how can I control that? For example if I want integer input, then? Date input, then? Similarly for output...

in my service.php this is the simple code:

Code: Select all
    require_once('dataServe.php');

    if ($_SERVER['QUERY_STRING'] == 'wsdl') {
        require_once('Zend/Soap/AutoDiscover.php');

        $auto = new Zend_Soap_AutoDiscover();
        $auto->setClass('dataServe');
        $auto->handle();
    }
    else {
        require_once('Zend/Soap/Server.php');

        $wsdl = sprintf(
            'http://%s%s?wsdl',
            $_SERVER['HTTP_HOST'],
            $_SERVER['SCRIPT_NAME']
        );

        $soapServer = new Zend_Soap_Server($wsdl);
        $soapServer->setClass('dataServe');
        $soapServer->handle();


It all works, btw, its returning data. I'm just now thinking along the lines of tightening up what my client CAN or cannot send. I'm not a WSDL expert and rely on autodiscovery features instead of creating my own... However I would like some control over such things.

Any documentaion/examples you guys can share would be a great help.
asimsid
 
Posts: 8
Joined: Mon Jan 28, 2013 9:37 am

Return to Zend Server

Who is online

Users browsing this forum: No registered users and 2 guests