dcsimg
Passing a Map of Vector through SOAP
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rami_Abramson
Posted On:   Monday, June 14, 2004 08:32 AM

			
Hello all,

Is it possible to pass a Map of Vector(s) through Axis SOAP ?
If the answer is YES, how do you do it?

Would appreciate your help.

all the best,

Rami

Re: Passing a Map of Vector through SOAP

Posted By:   Brian_Glodde  
Posted On:   Monday, June 14, 2004 06:53 PM

How about a Hashtable instead?

Object[] params = new Object[2];
params[0] = new RPCParam( "parms ", myhash);
params[1] = new RPCParam( "parms2 ", "myparam1");
// more params

Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL( "my_url"));
HashMap h = (HashMap) call.invoke("myservice", params);
return new Hashtable(h);

Server Side

class MyServiceProvider{
public static Hashtable myservice(Hashtable h, String param){

// receive hashtable here after the call
// process the request and return hashtable

MessageContext mc = MessageContext.getCurrentContext();
ServletContext sc ((HttpServlet) mc.getProperty(HTTPConstants.MC_HTTP_SERVLET))
.getServletContext();

//get the attributes of the request object
HttpServletRequest request (HttpServletRequest) mc.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
return hashtable;
}
}

Axis server condig.wsdd file:






Hope that helps!
About | Sitemap | Contact