[jboss-user] [JBoss Web Services Users] - Newbie: Empty ArrayList Passed on WS Call

gwzoller do-not-reply at jboss.com
Mon Nov 30 11:53:12 EST 2009


Hello,

I'm having some difficulty getting a list of things passed successfully as a web service parameter.  A no-param, or simple (non-list) param works fine.  My web service is an EJB stateless session bean...code below.

The Interface:

  | @Remote
  | @WebService
  | @SOAPBinding(style = SOAPBinding.Style.RPC)
  | public interface OrderTakerRemote {
  | 	@WebMethod
  | 	public String msg(ArrayList<String> say);
  | }

The Implementation:

  | @WebService(endpointInterface="com.kepler.ecom.services.OrderTakerRemote")
  | @Stateless 
  | public class OrderTaker implements OrderTakerRemote {
  | 
  |     // Default constructor. 
  |     public OrderTaker() {
  |     }
  |     
  |     public String msg(ArrayList<String> say) {
  |     	StringBuffer sb = new StringBuffer();
  |         System.out.println(say.size());  // verify non-emtpy list
  |     	if( say != null ) {
  |         	sb.append("Hey you says ");
  |     		for(String one : say ) {
  |     			sb.append("\""+one+"\" ");
  |     		}
  |     	}
  |     	return sb.toString();
  |     }
  | }

The Client:

  | 	private void wsPlaceOrder() {
  | 		String endpointURI ="http://127.0.0.1:8080/keplerEAR-kepler/OrderTaker?wsdl";
  | 		try
  | 		{
  | 			ArrayList<String> stuff = new ArrayList<String>();
  | 			stuff.add("One");
  | 			stuff.add("Two");
  | 			stuff.add("Three");
  | 			this.wsOrderResult = (String) getPort(endpointURI).msg(stuff);
  | 		} catch (MalformedURLException e) {
  | 			e.printStackTrace();
  | 			throw new RuntimeException(e);
  | 		}
  | 	}

The ArrayList is clearly created and populated in the client.  The call is made...no errors on the console..and I do get a result string back, but its just the little header "Hey you says"...not the rest of it.  The console output from the implementation showing the received list size prints 0.

Any ideas why my list isn't going over the wire?

Thanks!
Greg

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4268142#4268142

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4268142



More information about the jboss-user mailing list