When a Web Service request comes in (recognized by the presence of the SOAPAction header), the RequestProcessor parses the SOAP message contained in the body of the request. The parameters are then used to construct a query string because you cannot add parameters to an existing request object (I think you can in the latest servlet spec, but I didn't want to make that a requirement for this to work). Then, the request is forwarded back to ActionServlet in essence, but this time with the query string attached. So, the second time through, as far as Struts is concerned, it looks just like a form submission, it's no longer a Web Service request. This is necassery because the flow proceeds as usual from this point on, i.e., ActionForm is instantiated and populated, validated, and the Action is called. Once it's done, the RequestProcessor now knows that the ActionForward the Action returned is useless because this is a Web Service request, so it instead send the request to the JSP that generates the SOAP response (and the RequestProcessor sets the content type of the response to XML).
So, the short answer is that since I can't add parameters to the request object, the only way to pull this off without requiring changes to existing classes is to construct a query string and forward the request back through ActionServlet.
From: "Marco Mistroni" <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]> Subject: RE: Strus Web Service Enablement Date: Thu, 3 Jun 2004 15:08:24 +0100
Hi, One question... why would you put parameters as query string? Ideally what the client is sending is a SOAP request (or XML request), so The parameters are already embedded in the SOAP request. Only thing that you need is to open a connection to struts URL, for example http://myhost:myport/myapp/LoginAction.do
in my case, 'coz my app was 'XML only' enabled, Axis was building an SOAP message from what was written in the request. I was simply extracting the parameter that I needed. What I would think is that in your request processor u do exactly the same. The ActionForm can be populated automatically via reflection.....
Regards marco
-----Original Message----- From: Frank Zammetti [mailto:[EMAIL PROTECTED] Sent: 03 June 2004 14:53 To: [EMAIL PROTECTED] Subject: RE: Strus Web Service Enablement
>Also, I realized on the drive in that there's no need to put the parameters >as a query string as I'm doing... I can just put the parsed parameters >directly into the request object as an attribute. Since only the second >pass of a Web Service request would know or care about that object, it will >basically just remove some code and simplify things a bit.
Scratch that... It's still early in the morning for me, I wasn't thinking clearly... I STILL can't add the parameters direclty to request, so yes, I still have to construct the query string and do it that way. My bad.
_________________________________________________________________ MSN Toolbar provides one-click access to Hotmail from any Web page - FREE download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/
--------------------------------------------------------------------- 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]
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]