[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wsf-c-dev
Subject:    [wsf-c-dev] [jira] Issue Comment Edited: (WSFPHP-350) Classmap for
From:       "Benjamin Heek (JIRA)" <jira () wso2 ! org>
Date:       2008-10-21 12:01:42
Message-ID: 497224434.1224590502394.JavaMail.jira () 1ec2 ! wso2 ! org
[Download RAW message or body]


    [ https://wso2.org/jira/browse/WSFPHP-350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=19687#action_19687 \
] 

bheek edited comment on WSFPHP-350 at 10/21/08 12:00 PM:
-----------------------------------------------------------------

I've seen the test case, but that's not really what I mean.
So i changed the case a little bit, in hope that you'll understand it now.

You see some changes in the class names of 'Foo' and 'FooResponse'
The objects now have a prefix `Custom_`.

The classmap is also changed. 
What we expect that is with the help of the classmap the WSDL generator will look \
instead of class Foo for Custom_Foo and instead of FooResponse for \
Custom_FooResponse.

<?

class Bar
{
    private $value = "Test";
    private $end = "Test";

    
    function Bar($start, $end){
        $this->value = $start;
        $this->end = $end;
    }

    /**
     * echoValue function
     * @param object Foo $echoString echoString description
     * @return object FooResponse $echoStringResponse
     */
    function echoValue($echoString){

        $boo1 = new Boo();
        $boo1->boo1 = array("test1", "test2");
        $boo1->boo2 = array("test3", "test4");

        $boo2 = new Boo();
        $boo2->boo1 = array("test1", "test2");
        $boo2->boo2 = array("test3", "test4");

        //either following or the other
        return array("ret_value"=>array($boo1, $boo2));

        return  new FooResponse(array($boo1, $boo2));
    }
}
/**
 * classname Foo
 * @namespace http://mytest/xsd1 namespace of the class Foo
 */
class Custom_Foo
{
    /**
     * @var string $foo1
     */
    public $foo1;
    /**
     * @var string $foo2
     * maps to xs:QName
     */
    public $foo2;

    /**
     * @var array of string $foo3
     * maps to xs:dateTime
     */
    public $foo3;

    /**
     * @var object Bay $foo4
     */
    public $foo4;
}

/**
 * classname Bay
 * @namespace http://mytest/xsd2 namespace of the class Bay
 */
class Bay
{
    /**
     * @var array of string $bar1
     */
    public $bar1;

    /**
     * @var array of object Boo $bar2
     */
    public $bar2;
}

/**
 * classname Boo
 * @namespace http://mytest/xsd1
 */
class Boo
{
    /**
     * @var array of string $boo1
     */
    public $boo1;

    /**
     * @var array of string $boo2
     * maps to xs:duration
     */
    public $boo2;
}

/**
 * classname FooResponse
 * @namespace http://mytest/xsd3
 */
class Custom_FooResponse
{
    /**
     * @var array of object Boo $ret_value
     */
    public $ret_value;

    public function __construct($param_value)
    {
        $this->ret_value = $param_value;
    }
}


$operations = array("echoString" => "echoValue");
$opParams = array("echoValue" => "MIXED");
$actions = array("urn:echoString" => "echoString");

$classmap = array("Foo" => "Custom_Foo", "Bay" => "Bay", "Foo_Response" => \
"Custom_FooResponse");

$service = new WSService(array("classes" => 
                            array("Bar" => 
                                array("operations" => $operations,
                                      "args" => array("Welcome", "Bye!"))),
                               "bindingStyle"=> "doclit",
                               /* "bindingStyle"=> "rpc-enc", */
                               "cacheWSDL" => FALSE,
                               "actions" => $actions,
                               "classmap" => $classmap,
                               "opParams" => $opParams));
        
$service->reply();
?>

      was (Author: bheek):
    I've seen the test case, but that's not really what I mean.
So i changed the case a little bit, in hope that you'll understand it now.

You see some changes in the class names of 'Foo' and 'FooResponse'
The objects now have a prefix `Custom_`.

The classmap is also changed. 
What we expect that is with the help of the classmap the WSDL generator will look \
instead of class Foo for Custom_Foo and instead of FooResponse. for \
Custom_FooResponse.

<?

class Bar
{
    private $value = "Test";
    private $end = "Test";

    
    function Bar($start, $end){
        $this->value = $start;
        $this->end = $end;
    }

    /**
     * echoValue function
     * @param object Foo $echoString echoString description
     * @return object FooResponse $echoStringResponse
     */
    function echoValue($echoString){

        $boo1 = new Boo();
        $boo1->boo1 = array("test1", "test2");
        $boo1->boo2 = array("test3", "test4");

        $boo2 = new Boo();
        $boo2->boo1 = array("test1", "test2");
        $boo2->boo2 = array("test3", "test4");

        //either following or the other
        return array("ret_value"=>array($boo1, $boo2));

        return  new FooResponse(array($boo1, $boo2));
    }
}
/**
 * classname Foo
 * @namespace http://mytest/xsd1 namespace of the class Foo
 */
class Custom_Foo
{
    /**
     * @var string $foo1
     */
    public $foo1;
    /**
     * @var string $foo2
     * maps to xs:QName
     */
    public $foo2;

    /**
     * @var array of string $foo3
     * maps to xs:dateTime
     */
    public $foo3;

    /**
     * @var object Bay $foo4
     */
    public $foo4;
}

/**
 * classname Bay
 * @namespace http://mytest/xsd2 namespace of the class Bay
 */
class Bay
{
    /**
     * @var array of string $bar1
     */
    public $bar1;

    /**
     * @var array of object Boo $bar2
     */
    public $bar2;
}

/**
 * classname Boo
 * @namespace http://mytest/xsd1
 */
class Boo
{
    /**
     * @var array of string $boo1
     */
    public $boo1;

    /**
     * @var array of string $boo2
     * maps to xs:duration
     */
    public $boo2;
}

/**
 * classname FooResponse
 * @namespace http://mytest/xsd3
 */
class Custom_FooResponse
{
    /**
     * @var array of object Boo $ret_value
     */
    public $ret_value;

    public function __construct($param_value)
    {
        $this->ret_value = $param_value;
    }
}


$operations = array("echoString" => "echoValue");
$opParams = array("echoValue" => "MIXED");
$actions = array("urn:echoString" => "echoString");

$classmap = array("Foo" => "Custom_Foo", "Bay" => "Bay", "Response" => \
"Custom_FooFooResponse");

$service = new WSService(array("classes" => 
                            array("Bar" => 
                                array("operations" => $operations,
                                      "args" => array("Welcome", "Bye!"))),
                               "bindingStyle"=> "doclit",
                               /* "bindingStyle"=> "rpc-enc", */
                               "cacheWSDL" => FALSE,
                               "actions" => $actions,
                               "classmap" => $classmap,
                               "opParams" => $opParams));
        
$service->reply();
?>
  
> Classmap for WSDL-generation isn't mapping
> ------------------------------------------
> 
> Key: WSFPHP-350
> URL: https://wso2.org/jira/browse/WSFPHP-350
> Project: WSO2 WSF/PHP
> Issue Type: Bug
> Components: WSClient, WSDL Generation 
> Affects Versions: 2.0.0
> Reporter: Benjamin Heek
> Priority: High
> 
> Example:
> 	/**
> 	 * @param string $name
> 	 * @return object Email $Email
> 	 */
> 	function emailTest($name) 
> 	{	
> 		$Email  = new Email();
> 		
> 		$Email->emailadres = $name."@test.nl";
> 	    return $Email;
> 	}
> $classMap = array("Email"=>"Prefix_Email");
> If we call the WSService with this classmap, we expect that instead of the class \
> `Email` the class `Prefix_Email` is used to generate the WSDL. But unfortunately \
> the WSService will still be looking for the class `Email` instead of \
> `Prefix_Email`. I test it with making a file 'Email.php' which contains the class \
> `Email`.  When i use the $classmap, geneartion of the WSDL has to fail!! 
> Because the service has to look for the class `Prefix_Email` instead of `Email`, \
> but ... it works.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: \
                https://wso2.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

_______________________________________________
Wsf-c-dev mailing list
Wsf-c-dev@wso2.org
http://mailman.wso2.org/cgi-bin/mailman/listinfo/wsf-c-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic