patricmutwiri / php-wsdl-creator

Automatically exported from code.google.com/p/php-wsdl-creator
GNU General Public License v3.0
0 stars 0 forks source link

Classmap issue #22

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have an complex array structure but the class name is not mapped correctly.
I'm not sure how to apply the PHP class on the WSDL class

================================================================================
====================================
class.ShopList.php:
class CustomerClass{
  /**
   * Retrieve shop list
   *
   * @param string $CardId is the card identifier string
   * @param string $RegisterId is the card identifier string
   * @return ShopListArray The results the items in the list
   */
  public function RetrieveShopList($CardId,$RegisterId) {
    global $DB;
    $CardId = $DB->real_escape_string(utf8_decode($CardId));
    $Result = new ShopListArray();
    $SQL = "some sql";
    if($RetrieveShopListResult = $DB->query($SQL)) {
      $Counter = 0;
      $TotalValue = 0;
      while($row = $RetrieveShopListResult->fetch_assoc()) {
        $Result->ShopListArray[$Counter]  = new ShopList(SOAP_ENC_ARRAY);
        $Counter++;
      }
      return $Result;
    } else {
      return $DB->error;
    }
  }

class ShopList{
  /**
   * A complex type ShopList
   *
   * @pw_element integer $ProductNumber A integer Product number
   * @pw_complex ShopList
   */
  public $ProductNumber=1;
}

  /**
   * A complex type ShopList
   *
   * @pw_complex ShopListArray Array The complex type name definition
   */

================================================================================
====================================

soap.php:
// Include the demonstration classes
require_once('class.ShopList.php');

// Initialize the PhpWsdl class
require_once('class.phpwsdl.php');
$soap=PhpWsdl::CreateInstance(
  null,                          // PhpWsdl will determine a good namespace
  null,                          // Change this to your SOAP endpoint URI (or keep it NULL and PhpWsdl will determine it)
  null,                          // Change this to a folder with write access
  Array(                        // All files with WSDL definitions in comments
    'class.ShopList.php',
  ),
  null,                          // The name of the class that serves the webservice will be determined by PhpWsdl
  null,                          // This demo contains all method definitions in comments
  null,                          // This demo contains all complex types in comments
  true,                          // Don't send WSDL right now
  true);                        // Don't start the SOAP server right now

// Disable caching for demonstration
ini_set('soap.wsdl_cache_enabled',0);    // Disable caching in PHP
PhpWsdl::$CacheTime=0;                  // Disable caching in PhpWsdl

// Run the SOAP server
if($soap->IsWsdlRequested())            // WSDL requested by the client?
  $soap->Optimize=false;                // Don't optimize WSDL to send it human readable to the browser
//$soap->ParseDocs=false;                // Uncomment this line to disable the 
whole documentation features
//$soap->IncludeDocs=false;              // Uncomment this line to disable 
writing the documentation in WSDL XML
//$wsdl=$soap->CreateWsdl();            // This would save the WSDL XML string 
in $wsdl
//$php=$soap->OutputPhp(false,false);    // This would save a PHP SOAP client 
as PHP source code string in $php
//$html=$soap->OutputHtml(false,false);  // This would save the HTML 
documentation string in $html
$soap->RunServer();                      // Finally, run the server
$DB->close();

================================================================================
====================================

I have the same issue as http://yetanotherprogrammingblog.com/node/11 but don't 
know how to define/solve in phpwsdl class.

Original issue reported on code.google.com by johan.sm...@leftclick.eu on 13 Mar 2013 at 6:19

GoogleCodeExporter commented 9 years ago
It was not an bug, it was a human error.
The problem was solved by when defining a cache directory.

Original comment by johan.sm...@leftclick.eu on 15 Mar 2013 at 6:46