Hi Guido, I have recently migrated a proprietary(non-standard) web service implementation in a Struts based web app using Apache Axis http://ws.apache.org/axis/.
Struts and Axis are both servlets, Axis handles all XML messages and Struts handles all form processing. If all you need is another way to process your web service calls just use Axis or some other web service framework and leave Struts for form processing, templating/tiles and validation. The code snippet you have provided is exactly what a web service framework will do for you. HTH, Greg > -----Original Message----- > From: Guido Garc�a Bernardo [mailto:[EMAIL PROTECTED] > Sent: Monday, January 19, 2004 3:01 PM > To: Struts Users Mailing List > Subject: Struts and webservices > > Hello > > Our project is not Struts based. We must expose operations as xml > services (not standard web services) with a structure like the following > one: > <business id="login"> > <parameter name="username" value="ronaldinho" /> > <parameter name="pass" value="tiger" /> > </business> > > We want to migrate it to Struts, so the first step is to map that XML > structure into an ActionForm... I think we must overwrite > RequestProcessor doing: > > public MyRequestProcessor extends RequestProcessor { > ActionForm processActionForm( req, res ) { > if (client is a xml service) { > SAXBuilder builder = new SAXBuilder( req.getInputStream() ); > ... > > // THE MAIN PROBLEM IS HERE !! > ActionForm form = new LoginActionForm(); <------ > > form.setUserName( username ); > form.setPassword( pass ); > return form; > } else { > return super.processActionForm( req, res ); > } > } > } > > My questions are: > 1. How can I know the ActionForm class in each case (it is not > always a LoginActionForm...)? > 2. Is there any advantage/drawback with etending RequestProcessor? > (maybe I can't use other RequestProcessors like Tiles or Validator ones) > 3. Should we do anything with ActionServlet, extending it instead of > RequestProcessor, etc. > > Any kind of opinion, sugerence or any other consideration are welcome!! > > Thank you very very much, > Guido Garc�a Bernardo > PD. BTW, is there any practical information or project about integrating > Struts and standard webservices (soap...)? > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

