• Post Reply Bookmark Topic Watch Topic
  • New Topic

web service user defined data type Issue

 
Raghuveer Rawat
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi java world
I am writing a web service that return ArrayList and in this arraylist I am storing a user defined datatype. Now problem is how to register this datatype so that my client VB Client can retrieve information from this ArrayList.
sample code is as:
public ArrayList fncGetCampaignList() throws java.rmi.RemoteException
{
try
{

while (rs.next())
{
Campaign camp = new Campaign();
camp.id = rs.getInt(1);
camp.name = rs.getString(2);
// System.out.println(id + " = " + campName);
// map.put(new Integer(id), campName);
list.add(camp);
}


return list;
}

and Campaign class is:
public class Campaign implements java.io.Serializable
{

/** Creates a new instance of Campaign */
int id = 0;
String name ="";

}

Now problem is how to register this Campaign DataType with AXIS and Wsdl so that Client can understood it.
Thanx
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see this example escp the deploy.wsdd, it will tell you how to register Order datatype, you can try the same for Campaign class
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I would do if I were you is create a "CampaignList" class that contains an Array or ArrayList of Campaigns, then return that object from your Web Service. Running Java2WSDL on the resulting service should produce an output that can be easily and clearly understood by M$ tools.
Kyle
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!