2009年5月7日星期四

Re: [fw-webservices] [Question] How to create a Java client for a Zend_Soap server using autodiscover functionality

Thanks Fabien for your answer. I'd like to create some web service functions
with array as parameter. I'll just give a documentation about the array
content. I'll have to find out how to write a Java client when Zend_soap
recieve and return array or object.

Jerome

PS: I went on your website I love the dog picture www.crespel.net :-D

Bugzilla from fabien@crespel.net wrote:
>
> Hello,
>
> mouneyrac wrote :
>> I have to pass some params inside the function that are a new java
>> generated
>> class call Array(), that should contains some sort of SOAPElement. I have
>> no
>> idea how to create these params. In the PHP server side you can see that
>> is
>> a associative array.
>> Were the classes well generated? How to use them ?
>
> As far as I know the soap-enc:Array type is not an associative array, but
> a
> classical "flat" one.. meanwhile, the type of the contained elements isn't
> described here, so the caller has no clue what kind of content the service
> expects. I wouldn't really recommend using "@param array" at all.
>
> Instead I would suggest using 2 string parameters like this:
>
> /**
> * Some description...
> * @param string $username
> * @param string $password
> * @return integer
> function get_token($username, $password) {
> if ($username == 'wsuser' && $password == 'wspassword') {
> return '456';
> } else {
> throw new moodle_exception('wrongusernamepassword');
> }
> }
>
> If you still want only 1 parameter, you could use a class, but it seems
> easier to
> use the solution above.
>
> - Fabien.
>
>
>

--
View this message in context: http://www.nabble.com/-Question--How-to-create-a-Java-client-for-a-Zend_Soap-server-using-autodiscover-functionality-tp23419682p23440735.html
Sent from the Zend Web Services mailing list archive at Nabble.com.

没有评论: