This week's book giveaway is in the
General Computing
forum.
We're giving away four copies of
Arduino in Action
and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See
this thread
for details.
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Java
»
Web Services
Author
Display the username from this simple web service
Remi Desreumaux
Greenhorn
Joined: Sep 23, 2010
Posts: 19
posted
Sep 25, 2010 04:05:01
0
Hello, I have been following this tutorial :
http://www.mti.epita.fr/blogs/2008/05/08/howto-axis2-tutoriel-sur-lutilisation-des-webservices-avec-axis2/
Here , the web service code :
package ws.example; import java.util.ArrayList; public class UserService { public User getUser() { return new User(14, "sami", "15 Toto titi"); } public ArrayList getUsers() { ArrayList userList = new ArrayList(); userList.add(new User(13, "titi", "skl")); return userList; } }
and the User.java
package ws.example; public class User { int id; String name; String address; public User(int id, String name, String address) { super(); this.id = id; this.name = name; this.address = address; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
I have generated the stub with wsdl2java.bat and I was wondering how to get the address of user 14.
return new User(14, "sami", "15 Toto titi");
try { UserServiceSoap11BindingStub stub = new UserServiceSoap11BindingStub(); GetUserResponse gur = new GetUserResponse(); System.out.println("adresse" + ? ????? ) ; } catch (AxisFault e) { e.printStackTrace(); } catch (RemoteException e) { e.printStackTrace(); }
thanks
Remi Desreumaux
Greenhorn
Joined: Sep 23, 2010
Posts: 19
posted
Sep 25, 2010 06:19:19
0
just like that ))
UserServiceStub stub; try { stub = new UserServiceStub("http://localhost:8181/axis2/services/UserService?wsdl"); System.out.println("response "+ ((String)stub.getUser().get_return().getAddress()));
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Display the username from this simple web service
Similar Threads
struts 2: Stuck up with simple issue
Basic hibernate code explanation
displat:table tag pls help me
cannot find symbol
Setting Null Type for Parameters
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter