Hi,
First of all, HUGE thanks to Bear and Vinod. I am very grateful for your contributions - I've taken them on board, and I think I've got an idea how this could work...
But first, here's a bigger picture. The system spans two separate web applications - let's call them WebApp1 (Jsp1, Servlet1 and W.S.Client) and WebApp2 (WebService).
Jsp1<-->Servlet1<-->W.S.Client<--->WebService
There are two types of users for this system - let's call them 'TypeA' and 'TypeB'. The user type is identified at the web service.
When the user completes a form in Jsp1, the data is sent through Servlet1 and W.S.Client to the web service. If the web service identifies a TypeA user, data is processed immediately and returned through the web service client to Servlet1 for further action.
However, if the web service identifies a TypeB user, the user should be presented with a second form to complete. The second form has to be hosted by WebApp2. Additionally, the data from this form should be processed in WebApp2 and the result of the processing should be sent to WebApp1.
The only solution I can think of is that when the web service identifies a TypeB user, it should return a URI instead of the processed data result. WebApp1 can then use the URI to redirect the browser to WebApp2.
So, a TypeA transaction would look like this:
The form data entered by the user in Jsp1 is sent through Form1Servlet and the web service client to the web service. As the user type is identified as TypeA, the data is processed, a result is returned through the client to Form1Servlet, and the results are displayed in ResultJsp.
A TypeB transaction would look like this:
The form data entered by the user in Jsp1 is sent through Form1Servlet and the web service client to the web service. As the user type is identified as TypeB, some initial processing occurs and the URI for Form2Servlet is returned through the web service client to Form1Servlet. Form1Servlet identifies the returned data as a URI, and uses it to redirect the browser through Form2Servlet to Form2Jsp where the user enters more data.
When data entry is complete, the form data is processed by System2ResultServlet, the result of the transaction is sent along with a redirect to System1ResultServlet and the results are displayed in ResultJsp.
I've implemented most of this and so far, it seems to work. However, that doesn't mean it's a good strategy. It seems to be very convoluted, and I feel like it's just such a complete... FUDGE! I'm really anxious to get some feedback on this from experienced ranchers, and I'd be very grateful for your opinions.
Thanks,
Jenny