|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
generating wsdl for complex return types
I was able to get a simple web service running w/ Axis2/C
using the approach shown here, 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(); } --
|
|
|
Re: generating wsdl for complex return typesDoug,
A basic WSDL is by no means simple. There are a number of different concepts that are captured in a complete WSDL document. I am not a big fan of buying books anymore, but the Developing Web Services with Apache Axis2 was VERY helpful in getting me jump started in the world of Axis2/C. The book focuses on Axis2/Java, but it does a wonderful job of explaining the basics of WSDL and show how to use the GUI editor in Eclipse to create and edit them. The best part of the book is that it is NOT wordy!!!! Now when I edit my Axis2/C WSDL's, I simply edit the XML directly.
Sam On Fri, Oct 16, 2009 at 2:41 PM, Doug Price <Doug.Price@...> wrote:
|
|
|
RE: generating wsdl for complex return types
Thanks for the tip. The book sounds like a good investment. --
From: Sam Carleton
[mailto:scarleton@...] Doug, A basic WSDL is by no means simple. There are a number
of different concepts that are captured in a complete WSDL document. I am
not a big fan of buying books anymore, but the Developing
Web Services with Apache Axis2 was VERY helpful in getting me jump
started in the world of Axis2/C. The book focuses on Axis2/Java, but it
does a wonderful job of explaining the basics of WSDL and show how to use the
GUI editor in Eclipse to create and edit them. The best part of the book
is that it is NOT wordy!!!! Now when I edit my Axis2/C WSDL's, I simply
edit the XML directly. Sam On Fri, Oct 16, 2009 at 2:41 PM, Doug Price <Doug.Price@...> wrote: I
was able to get a simple web service running w/ Axis2/C using the approach
shown here, 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(); } --
|
| Free embeddable forum powered by Nabble | Forum Help |