[Opensource] http request as xml instead of http parameters?

Peter A. Pilgrim peterp at xenonsoft.demon.co.uk
Thu Dec 12 19:50:52 PST 2002


Mike Traum wrote:
> I'm looking to take several of my applications in a different direction 
> - making them accessible completely through email.
>  
> I plan on doing this by writing a gateway-type application - it will 
> read email, post it to an expresso app, read the response, and send it 
> to the user. One advantage of MVC is the separation of the View. I 
> figure the gateway reading an expresso response it somewhat trivial, 
> because the view can be presented as xml. But, what about the request? 
> Can I easily replace expresso's requirement of http parameter-based 
> requests in favor of xml? This is sounding like SOAP, but I know little 
> about it.
>  

This question sort came up in the Struts user list. Is Struts tied
to the web app? Yes. The API for Action.perform() or Action.execute()
is a dead giveaway, both take HttpServletRequest and HttpServletResponse.

However in Expresso
`ControllerRequest' is supposed to be neutral
`ControllerResponse' is also designed to be that way.

But the base class `Controller' is a direct descendent of Struts
`Action'. So you either

1) transform the XML input and wrap up it into HTML servlet request
Read an XML object and a ServletRequestWrapper ( Servlet Spec 2.3? )

2) write a new base controller that understands XML input and output.
off the top my head e.g

`SOAPController
`SOAPControllerRequest.java'
`SOAPControllerResponse.java'

The only problem I think is that original Controller has to be hack
to know about the new SOAPController. A re-engineer task, because
if you hack for one protocol, then why not general it? Why not
make controller handling be dynamic or hot pluggable/



3) look at `com/jcorporate/expresso/core/utility/ControllerRun.java'

This may be easiest and fastest option.

I think the difficulty would be transform SOAP message, and
parameter to ControllerRequest objects, and also
transforming ControllerResponse object to a SOAP message.

It is something that Mike R should think about as well.

On the other hand I may be just talking rubbish. It is time for bed

ZZZZZ

-- 
Peter Pilgrim
ServerSide Java Specialist

My on-line resume and for interview videos about myself, J2EE
Open Source, Struts and Expresso.
    ||
    \\===>  `` http://www.xenonsoft.demon.co.uk/no-it-striker.html ''




More information about the Opensource mailing list