axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Price <Doug.Pr...@presagis.com>
Subject generating wsdl for complex return types
Date Fri, 16 Oct 2009 18:41:03 GMT
I was able to get a simple web service running w/ Axis2/C using the approach shown here<http://wso2.org/library/3534>,
which creates a WSDL file from a Java interface using the Axis2 java2wsdl and then uses the
WSDL file to create the C skeleton and stubs using wsdl2c.  So far so good.  Now I'd like
to create a more sophisticated interface.  For example, what if I need to return multiple
values, or a list of objects?

For example, let's say I have some data that represents a user (e.g. name, password, id, etc.)
and my service has two methods getUser and getActiveUsers.  The first would return the data
for the user w/ the given id and the second would return the data for all users that are currently
logged onto the system.  I'd expect the SOAP responses to be something like the following:

<getUserResponse>
    <User>
        <name>fred</name>
        ...
    </User>
</getUserResponse>

< getActiveUsersResponse>
    <User>
        <name>fred</name>
        ...
    </User>
    <User>
        <name>barney</name>
        ...
    </User>
</ getActiveUsersResponse>

How do I write the Java interface to produce such a result w/ java2wsdl?  I would have hoped
something like the following would have done it, but that WSDL generated seems like it wants
to pass the object reference instead.  Any help would be greatly appreciated.

class User {
    string name;
    ...
}

interface MyInterface {
    public User getUser(int id);
    public User [] getActiveUsers();
}


--
Doug Price
Research Director | Presagis

T. +1 972 943.2433 F. +1 469 467.4564 C. +1 469 867.8399

DISCLAIMER: This e-mail message is for the sole use of the intended recipient(s) and may contain
confidential and/or proprietary information. Do not read, copy, or disseminate this message
unless you are the addressee. Any unauthorized review, use, disclosure or distribution is
strictly prohibited. If you have received this message in error, please contact the sender
by reply e-mail and delete the original and any copies from your system.


Mime
View raw message